Skip to content
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

Attributes: remove the lower-casing logic for attribute names #2916

Closed
wants to merge 1 commit into from

Conversation

mgol
Copy link
Member

@mgol mgol commented Feb 10, 2016

jQuery used to lower-case the attribute names passed to the .attr setter
to workaround an old IE issue. This is no longer in jQuery 3.0 and
removing it may even "accidentally" make this API sort-of work on SVGs
(see gh-2910) so why not.

Manual lowercasing had to be added to the place where the proper
attrHook is retrieved so that it works regardless of the casing of the
provided name. A regular toLowerCase() is enough there as those few
attributes don't contain any non-ASCII characters.

Fixes gh-2914

-18 bytes

jQuery used to lower-case the attribute names passed to the .attr setter
to workaround an old IE issue. This is no longer in jQuery 3.0 and
removing it may even "accidentally" make this API sort-of work on SVGs
(see jquerygh-2910) so why not.

Manual lowercasing had to be added to the place where the proper
attrHook is retrieved so that it works regardless of the casing of the
provided name. A regular `toLowerCase()` is enough there as those few
attributes don't contain any non-ASCII characters.

Fixes jquerygh-2914
@mention-bot
Copy link

By analyzing the blame information on this pull request, we identified @timmywil, @pgilad and @markelog to be potential reviewers

@mgol
Copy link
Member Author

mgol commented Feb 10, 2016

I didn't add unit tests for that as we officially don't support SVG attribute manipulation but I've just noticed we have been testing that it works in some cases... So I'm not sure how to follow up on that one.

@dmethvin
Copy link
Member

Somehow I missed (twice!) that we back-ported this to 1.12.0/2.2,0, sorry! It makes sense to remove it for 3.0.0 since we were only lowercasing for old IE.

@mgol mgol closed this in 615d925 Feb 17, 2016
@mgol mgol deleted the attr-lowercase branch February 17, 2016 01:30
mgol added a commit to mgol/jquery that referenced this pull request May 29, 2016
Attribute hooks are determined for the lowercase versions of attribute names
but this has not been reflected in the bool attribute hooks. The code that
temporarily removed a handler to avoid an infinite loop was removing an
incorrect handler causing stack overflow.

Fixes jquerygh-3133
Refs jquerygh-2914
Refs jquerygh-2916
mgol added a commit to mgol/jquery that referenced this pull request May 29, 2016
Attribute hooks are determined for the lowercase versions of attribute names
but this has not been reflected in the bool attribute hooks. The code that
temporarily removed a handler to avoid an infinite loop was removing an
incorrect handler causing stack overflow.

Fixes jquerygh-3133
Refs jquerygh-2914
Refs jquerygh-2916
mgol added a commit to mgol/jquery that referenced this pull request May 29, 2016
Attribute hooks are determined for the lowercase versions of attribute names
but this has not been reflected in the bool attribute hooks. The code that
temporarily removed a handler to avoid an infinite loop was removing an
incorrect handler causing stack overflow.

Fixes jquerygh-3133
Refs jquerygh-2914
Refs jquerygh-2916
mgol added a commit to mgol/jquery that referenced this pull request May 31, 2016
Attribute hooks are determined for the lowercase versions of attribute names
but this has not been reflected in the bool attribute hooks. The code that
temporarily removed a handler to avoid an infinite loop was removing an
incorrect handler causing stack overflow.

Fixes jquerygh-3133
Refs jquerygh-2914
Refs jquerygh-2916
mgol added a commit to mgol/jquery that referenced this pull request Jun 3, 2016
Attribute hooks are determined for the lowercase versions of attribute names
but this has not been reflected in the bool attribute hooks. The code that
temporarily removed a handler to avoid an infinite loop was removing an
incorrect handler causing stack overflow.

Fixes jquerygh-3133
Refs jquerygh-2914
Refs jquerygh-2916
mgol added a commit to mgol/jquery that referenced this pull request Jun 3, 2016
Attribute hooks are determined for the lowercase versions of attribute names
but this has not been reflected in the bool attribute hooks. The code that
temporarily removed a handler to avoid an infinite loop was removing an
incorrect handler causing stack overflow.

Fixes jquerygh-3133
Refs jquerygh-2914
Refs jquerygh-2916
Closes jquerygh-3134
@lock lock bot locked as resolved and limited conversation to collaborators Jan 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants