Skip to content

Commit 3965b4a

Browse files
authored
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. Closes gh-463 Ref gh-456
1 parent dd77482 commit 3965b4a

File tree

5 files changed

+15
-14
lines changed

5 files changed

+15
-14
lines changed

dist/sizzle.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Released under the MIT license
77
* https://js.foundation/
88
*
9-
* Date: 2019-10-13
9+
* Date: 2019-10-16
1010
*/
1111
( function( window ) {
1212
var i,
@@ -840,6 +840,11 @@ setDocument = Sizzle.setDocument = function( node ) {
840840
if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) {
841841
rbuggyQSA.push( ".#.+[+~]" );
842842
}
843+
844+
// Support: Firefox <=3.6 - 5 only
845+
// Old Firefox doesn't throw on a badly-escaped identifier.
846+
el.querySelectorAll( "\\\f" );
847+
rbuggyQSA.push( "[\\r\\n\\f]" );
843848
} );
844849

845850
assert( function( el ) {
@@ -871,11 +876,6 @@ setDocument = Sizzle.setDocument = function( node ) {
871876
rbuggyQSA.push( ":enabled", ":disabled" );
872877
}
873878

874-
// Support: Firefox <=3.6 - 5 only
875-
// Old Firefox doesn't throw on a badly-escaped identifier.
876-
el.querySelectorAll( "\\\f" );
877-
rbuggyQSA.push( "[\\r\\n\\f]" );
878-
879879
// Support: Opera 10 - 11 only
880880
// Opera 10-11 does not throw on post-comma invalid pseudos
881881
el.querySelectorAll( "*,:x" );

0 commit comments

Comments
 (0)