Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Selector: Throw on post-comma invalid selectors in Opera 10-11 again
PR gh-456 introduced a test catching not throwing on badly-escaped identifiers
by Firefox 3.6-5. Unfortunately, it was placed just before a test Opera 10-11
fails, making Opera fail quicker and not adding a post-comma invalid selector
to rbuggyQSA.

This commit fixes the regression & introduces a unit test ensuring the throwing.
Unfortunately, the issue is fixed in Opera 11.6 which is the lowest one Sizzle
officially supports but I verified the fix manually against Opera 10.6, 11.1
& 11.5.

Ref gh-456
  • Loading branch information
mgol committed Oct 16, 2019
commit d813a87b5ab284ec3e1c1432048e0380fe006c1d
12 changes: 6 additions & 6 deletions dist/sizzle.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* Released under the MIT license
* https://js.foundation/
*
* Date: 2019-10-13
* Date: 2019-10-16
*/
( function( window ) {
var i,
Expand Down Expand Up @@ -840,6 +840,11 @@ setDocument = Sizzle.setDocument = function( node ) {
if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
rbuggyQSA.push( ".#.+[+~]" );
}

// Support: Firefox <=3.6 - 5 only
// Old Firefox doesn't throw on a badly-escaped identifier.
el.querySelectorAll( "\\\f" );
rbuggyQSA.push( "[\\r\\n\\f]" );
} );

assert( function( el ) {
Expand Down Expand Up @@ -871,11 +876,6 @@ setDocument = Sizzle.setDocument = function( node ) {
rbuggyQSA.push( ":enabled", ":disabled" );
}

// Support: Firefox <=3.6 - 5 only
// Old Firefox doesn't throw on a badly-escaped identifier.
el.querySelectorAll( "\\\f" );
rbuggyQSA.push( "[\\r\\n\\f]" );

// Support: Opera 10 - 11 only
// Opera 10-11 does not throw on post-comma invalid pseudos
el.querySelectorAll( "*,:x" );
Expand Down
Loading