-
Notifications
You must be signed in to change notification settings - Fork 164
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: support non-canonicalised srcset attribute name #2958 #2968
Conversation
fyi: both locally and in github codespaces I've been unable to get the tests to run. After running
I tried adding adding a test but since removed it since it was failing. I don't think it was testing the right thing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @gg-kialo,
Thank you for your contribution. We really appreciate your help. To preserve this fix from future changes, please add a test that checks this behavior.
I've pushed with an added test. I managed to figure how to get them to run locally (you have to open the qunit server 🤦). fyi, I'll be OoO until Tuesday. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for your contribution. Please take a look at my suggestions.
Some frameworks, like React, use non-canonicalised attribute names. The spec and browsers allow this, but hammerhead is only checking if the attribute name without canonicalisation matches `srcset`. By using the `loweredAttr` for the comparison, hammerhead will be more accepting of inputs and resolve srcset issues with React projects (fixes DevExpress#2958). See facebook/react#10863 for more background.
Release v31.6.3 addresses this. |
Some frameworks, like React, use non-canonicalised attribute names. The spec and browsers allow this, but hammerhead is only checking if the attribute name without canonicalisation matches
srcset
.By using the
loweredAttr
for the comparison, hammerhead will be more accepting of inputs and resolve srcset issues with React projects (fixes #2958).See facebook/react#10863 for more background.
Purpose
Fixes #2958 to better support
srcSet
attributes in React applications.Approach
Canonicalises the attribute name before comparing to
srcset
.References
Related react issue (and there are various duplicates of this) - facebook/react#10863
Pre-Merge TODO