Skip to content

Commit

Permalink
Selector: Throw on post-comma invalid selectors in Opera 10-11 again
Browse files Browse the repository at this point in the history
PR jquerygh-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 jquerygh-456
  • Loading branch information
mgol committed Oct 16, 2019
1 parent 102b3d6 commit d813a87
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 14 deletions.
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

0 comments on commit d813a87

Please sign in to comment.