Opened 7 years ago

Closed 7 years ago

#16611 closed defect (invalid)

selector/lite should pass through rooted queries in modern browsers

Reported by: Kitson Kelly Owned by:
Priority: undecided Milestone: tbd
Component: Core Version: 1.8.3
Keywords: Cc:
Blocked By: Blocking:

Description

The selector/lite, when doing a rooted query, utilises a method to add a temporary ID to the root node and then adds it to the selector to avoid, what is described in the code as "strange" behaviours with Element.querySelectorAll. This may have been the case once upon a time, but all available information indicates that it doesn't appear to behave that way anymore.

For example http://dev.w3.org/2006/webapi/selectors-api-testsuite/level1-additional-report.html is reporting that for CSS3 selectors, with an exception of a few edge cases, the browsers are compliant. There is a non-trivial performance hit with the way lite handles rooted queries and it is likely not needed in modern browsers.

At the very least, there should be a has branch to avoid this performance hit for modern browsers to use the native Element.querySelectorAll.

Change History (1)

comment:1 Changed 7 years ago by Kitson Kelly

Resolution: invalid
Status: newclosed

Actually more research indicates that Element.querySelectorAll still is counterintuitive in its design, which is why the useRoot is there. For example you cannot use Element.querySelectorAll("> li"), plus other oddness with it that means that the functionality wouldn't be possible. Sorry...

Note: See TracTickets for help on using tickets.