Boolean attribute getters throw if the attribute name is not all lowercase #3133

Closed
mgol opened this Issue May 29, 2016 · 2 comments

Projects

None yet

1 participant

@mgol
Member
mgol commented May 29, 2016

Description

In #2916 we removed our logic that lowercased attribute names. This caused one regression: any attribute getter using a name for boolean attributes but not all lowercased is going into an infinite recursion, exceeding the stack call limit.

Amongst others, this is breaking the AngularJS test suite when tested with jQuery 3.0.0-rc1.

Link to test case

https://jsfiddle.net/shnann6y/2/

Basically, $('<div>').attr('requiRed') is enough to trigger the error.

@mgol mgol added this to the 3.0.1 milestone May 29, 2016
@mgol mgol self-assigned this May 29, 2016
@mgol mgol added a commit to mgol/jquery that referenced this issue May 29, 2016
@mgol mgol Attributes: Avoid infinite recursion on non-lowercase attribute getters
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 gh-3133
Refs gh-2914
Refs gh-2916
d12e13d
@mgol
Member
mgol commented May 29, 2016

PR: #3134.

@mgol mgol removed the Needs review label May 29, 2016
@mgol mgol modified the milestone: 3.0.0, 3.0.1 May 29, 2016
@mgol
Member
mgol commented May 29, 2016

We can discuss but I'm changing the milestone to 3.0.0 for now as it breaks the Angular test suite.

@mgol mgol added the Needs review label May 29, 2016
@mgol mgol added a commit to mgol/jquery that referenced this issue May 29, 2016
@mgol mgol Attributes: Avoid infinite recursion on non-lowercase attribute getters
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 gh-3133
Refs gh-2914
Refs gh-2916
cb90c0e
@mgol mgol added a commit to mgol/jquery that referenced this issue May 29, 2016
@mgol mgol Attributes: Avoid infinite recursion on non-lowercase attribute getters
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 gh-3133
Refs gh-2914
Refs gh-2916
b49507d
@mgol mgol added a commit to mgol/jquery that referenced this issue May 31, 2016
@mgol mgol Attributes: Avoid infinite recursion on non-lowercase attribute getters
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 gh-3133
Refs gh-2914
Refs gh-2916
bc991fa
@mgol mgol added Has Pull Request and removed Needs review labels Jun 2, 2016
@mgol mgol added a commit to mgol/jquery that referenced this issue Jun 3, 2016
@mgol @mgol mgol + mgol Attributes: Avoid infinite recursion on non-lowercase attribute getters
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 gh-3133
Refs gh-2914
Refs gh-2916
159c4c5
@mgol mgol added a commit to mgol/jquery that referenced this issue Jun 3, 2016
@mgol mgol Attributes: Avoid infinite recursion on non-lowercase attribute getters
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 gh-3133
Refs gh-2914
Refs gh-2916
Closes gh-3134
e06fda6
@mgol mgol closed this in #3134 Jun 3, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment