#14636 closed bug (invalid)
Sizzle returns incorrect result in IE for the use case
Reported by: | johnslegers | Owned by: | johnslegers |
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 1.10.2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
Use case :
I'm working on a library that provides cross-browser support for some of the most interesting features of web components.
I used the html-shiv to add support in IE8- for the 'template' and 'content' tag.
When using Sizzle with the selector 'content[select]' to select 'content' tags that have a 'select' attribute, Sizzle fails to produce the correct result in IE8.
I did, however, get the expected result when disabling native support for doc.querySelectorAll in IE8, by doing the following :
See the following code on line 608 :
if ( (support.qsa = rnative.test( doc.querySelectorAll )) ) { [ ... ] }
I replaced it with this :
try { document.querySelectorAll('html:root'); var querySelectorSupported = true; } catch (err) { var querySelectorSupported = false; } if ((support.qsa = querySelectorSupported)) { [ ... ] }
For me, this solves the problem. However, I guess there are better ways to solve this bug, which is why I'm logging a ticket rather than submitting a patch.
Change History (4)
comment:1 Changed 9 years ago by
comment:2 Changed 9 years ago by
Owner: | set to johnslegers |
---|---|
Status: | new → pending |
Can you provide a test case please? jsfiddle or jsbin
comment:3 Changed 9 years ago by
Resolution: | → invalid |
---|---|
Status: | pending → closed |
Because we get so many tickets, we often need to return them to the initial reporter for more information. If that person does not reply within 14 days, the ticket will automatically be closed, and that has happened in this case. If you still are interested in pursuing this issue, feel free to add a comment with the requested information and we will be happy to reopen the ticket if it is still valid. Thanks!
comment:4 Changed 9 years ago by
I just tried creating a jsfiddle and noticed the issue was slightly more complex than I initially realized. It seems the problem is specific to cloned HTML5 nodes.
I created a new ticket http://bugs.jquery.com/ticket/14656 with more details and a JSBin demo.
See also https://github.com/jquery/sizzle/issues/234