Skip to content

Conversation

@mgol
Copy link
Member

@mgol mgol commented Oct 14, 2019

qSA in IE 11/Edge often (but not always) don't find elements with an empty
name attribute selector ([name=""]). Assigning a temporary name attribute to
the document root (& removing it afterwards) seems to resolve the issue.

EDIT: Detect that & fall back to Sizzle traversal.

Interestingly, IE 10 & older don't seem to have the issue.

Fixes jquery/jquery#4435

jQuery version of the PR: jquery/jquery#4510

@mgol
Copy link
Member Author

mgol commented Oct 14, 2019

+51 bytes

@mgol
Copy link
Member Author

mgol commented Oct 14, 2019

It looks like the workaround makes Sizzle tests pass in IE 11 & Edge 16-18 but it still fails in Edge 15... I don’t think they’d change the behavior around it somehow & then back so I worry about stability of this workaround.

@mgol
Copy link
Member Author

mgol commented Oct 14, 2019

I submitted #462 to update tested browsers but also add Edge 15 & 16 to the mix so that issues like the one described above are caught more often.

@mgol mgol force-pushed the attr-empty branch 4 times, most recently from 11f8395 to 4d71b18 Compare October 15, 2019 18:56
@mgol
Copy link
Member Author

mgol commented Oct 15, 2019

PR updated. [name=''] now falls back to Sizzle traversal & both IE 7-11 & Edge 15-18 pass all tests.

@mgol
Copy link
Member Author

mgol commented Oct 15, 2019

+26 +27 bytes, BTW.

qSA in IE 11/Edge often (but not always) don't find elements with an empty
name attribute selector (`[name=""]`). Detect that & fall back to Sizzle
traversal.

Interestingly, IE 10 & older don't seem to have the issue.

Fixes jquery/jquery#4435
@mgol mgol merged commit af16387 into jquery:master Oct 21, 2019
@mgol mgol deleted the attr-empty branch October 21, 2019 16:59
@mgol mgol added this to the 2.3.5 milestone Feb 28, 2020
mgol added a commit to mgol/jquery that referenced this pull request Sep 8, 2022
qSA in IE 11/Edge often (but not always) don't find elements with an empty
name attribute selector (`[name=""]`). Detect that & fall back to Sizzle
traversal.

Interestingly, IE 10 & older don't seem to have the issue.

Ref jquerygh-4435
Ref jquerygh-4510
Ref jquery/sizzle#461
mgol added a commit to mgol/jquery that referenced this pull request Sep 12, 2022
qSA in IE 11/Edge often (but not always) don't find elements with an empty
name attribute selector (`[name=""]`). Detect that & fall back to Sizzle
traversal.

Interestingly, IE 10 & older don't seem to have the issue.

Ref jquerygh-4435
Ref jquerygh-4510
Ref jquery/sizzle#461
mgol added a commit to mgol/jquery that referenced this pull request Sep 19, 2022
qSA in IE 11/Edge often (but not always) don't find elements with an empty
name attribute selector (`[name=""]`). Detect that & fall back to Sizzle
traversal.

Interestingly, IE 10 & older don't seem to have the issue.

Ref jquerygh-4435
Ref jquerygh-4510
Ref jquery/sizzle#461
mgol added a commit to mgol/jquery that referenced this pull request Sep 21, 2022
qSA in IE 11/Edge often (but not always) don't find elements with an empty
name attribute selector (`[name=""]`). Detect that & fall back to Sizzle
traversal.

Interestingly, IE 10 & older don't seem to have the issue.

Ref jquerygh-4435
Ref jquerygh-4510
Ref jquery/sizzle#461
mgol added a commit to mgol/jquery that referenced this pull request Oct 3, 2022
qSA in IE 11/Edge often (but not always) don't find elements with an empty
name attribute selector (`[name=""]`). Detect that & fall back to Sizzle
traversal.

Interestingly, IE 10 & older don't seem to have the issue.

Ref jquerygh-4435
Ref jquerygh-4510
Ref jquery/sizzle#461
mgol added a commit to mgol/jquery that referenced this pull request Oct 4, 2022
qSA in IE 11/Edge often (but not always) don't find elements with an empty
name attribute selector (`[name=""]`). Detect that & fall back to Sizzle
traversal.

Interestingly, IE 10 & older don't seem to have the issue.

Ref jquerygh-4435
Ref jquerygh-4510
Ref jquery/sizzle#461
mgol added a commit to mgol/jquery that referenced this pull request Nov 17, 2022
qSA in IE 11/Edge often (but not always) don't find elements with an empty
name attribute selector (`[name=""]`). Detect that & fall back to Sizzle
traversal.

Interestingly, IE 10 & older don't seem to have the issue.

Ref jquerygh-4435
Ref jquerygh-4510
Ref jquery/sizzle#461
mgol added a commit to mgol/jquery that referenced this pull request Dec 1, 2022
qSA in IE 11/Edge often (but not always) don't find elements with an empty
name attribute selector (`[name=""]`). Detect that & fall back to Sizzle
traversal.

Interestingly, IE 10 & older don't seem to have the issue.

Ref jquerygh-4435
Ref jquerygh-4510
Ref jquery/sizzle#461
mgol added a commit to mgol/jquery that referenced this pull request Dec 13, 2022
qSA in IE 11/Edge often (but not always) don't find elements with an empty
name attribute selector (`[name=""]`). Detect that & fall back to Sizzle
traversal.

Interestingly, IE 10 & older don't seem to have the issue.

Ref jquerygh-4435
Ref jquerygh-4510
Ref jquery/sizzle#461
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Bug of find element with empty attribute in v3.4

2 participants