Skip to content

Commit 32cfb01

Browse files
committed
Selector: Detect incorrect escape handling by old Firefox
According to: https://www.w3.org/TR/css-syntax-3/#ident-token-diagram the escape doesn't need to be followed by a whitespace only if it's not a hex digit or a newline. However, old Firefox (3.6 - 5 only) doesn't throw if an escaped newline is not followed by a space. Fallback to Sizzle in such cases. Fixes gh-454
1 parent 5d90d4f commit 32cfb01

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/sizzle.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -846,6 +846,12 @@ setDocument = Sizzle.setDocument = function( node ) {
846846
rbuggyQSA.push( ":enabled", ":disabled" );
847847
}
848848

849+
// Support: Firefox <=3.6 - 5 only
850+
// Old Firefox doesn't throw on a badly-escaped identifier.
851+
el.querySelectorAll( "\\\f" );
852+
rbuggyQSA.push( "[\\r\\n\\f]" );
853+
854+
// Support: Opera 10 - 11 only
849855
// Opera 10-11 does not throw on post-comma invalid pseudos
850856
el.querySelectorAll( "*,:x" );
851857
rbuggyQSA.push( ",.*:" );

0 commit comments

Comments
 (0)