Skip to main content

Bug Tracker

Side navigation

#14636 closed bug (invalid)

Opened December 13, 2013 04:07PM UTC

Closed December 28, 2013 09:02AM UTC

Last modified December 28, 2013 01:03PM UTC

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.

Attachments (0)
Change History (4)

Changed December 13, 2013 04:10PM UTC by johnslegers comment:1

Changed December 13, 2013 04:45PM UTC by dmethvin comment:2

owner: → johnslegers
status: newpending

Can you provide a test case please? jsfiddle or jsbin

Changed December 28, 2013 09:02AM UTC by trac-o-bot comment:3

resolution: → invalid
status: pendingclosed

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!

Changed December 28, 2013 01:03PM UTC by johnslegers comment:4

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.