Skip to content

Commit

Permalink
Selector: Detect incorrect escape handling by old Firefox
Browse files Browse the repository at this point in the history
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
Closes gh-456
  • Loading branch information
mgol committed Aug 20, 2019
1 parent 5d90d4f commit 11767a1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion 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-07-02
* Date: 2019-08-20
*/
( function( window ) {
var i,
Expand Down Expand Up @@ -846,6 +846,12 @@ 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" );
rbuggyQSA.push( ",.*:" );
Expand Down
Loading

0 comments on commit 11767a1

Please sign in to comment.