diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2019-10-21 19:03:03 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-21 19:03:03 +0200 |
commit | 6eee5f7f181f9ebf5aa428e96356667e3cf7ddbd (patch) | |
tree | 5a02b5f912c82383e509e77383dbf9ad0d875e88 | |
parent | 1d624c10b4a6b97ac254bcefffa91058556075d2 (diff) | |
download | jquery-6eee5f7f181f9ebf5aa428e96356667e3cf7ddbd.tar.gz jquery-6eee5f7f181f9ebf5aa428e96356667e3cf7ddbd.zip |
Selector: Add a test for throwing on post-comma invalid selectors
Sizzle's PR jquery/sizzle#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 failed, making Opera fail quicker and not adding
a post-comma invalid selector to rbuggyQSA.
The issue was fixed in jquery/sizzle#463. This jQuery commit backports the test
that Sizzle PR added as no workarounds are needed in browsers jQuery supports.
Closes gh-4516
Ref jquery/sizzle#456
Ref jquery/sizzle#463
-rw-r--r-- | test/unit/selector.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/test/unit/selector.js b/test/unit/selector.js index dafb45e8a..f6e977094 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -179,7 +179,7 @@ QUnit.test( "XML Document Selectors", function( assert ) { } ); QUnit.test( "broken selectors throw", function( assert ) { - assert.expect( 32 ); + assert.expect( 33 ); function broken( name, selector ) { assert.throws( function() { @@ -197,6 +197,7 @@ QUnit.test( "broken selectors throw", function( assert ) { broken( "Broken Selector", "," ); broken( "Broken Selector", ",a" ); broken( "Broken Selector", "a," ); + broken( "Post-comma invalid selector", "*,:x" ); broken( "Identifier with bad escape", "foo\\\fbaz" ); broken( "Broken Selector", "[id=012345678901234567890123456789" ); broken( "Doesn't exist", ":visble" ); |