diff options
author | Michał Gołębiowski-Owczarek <m.goleb@gmail.com> | 2023-06-27 18:05:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-06-27 18:05:46 +0200 |
commit | 62b9a2583460c2384f6de1d0a6aeaf05e51d523b (patch) | |
tree | bdf4381306e74c9e9f91eb566a675b922122189e | |
parent | 67cb1af7740a956e150e8d93266c4e601f55e8a4 (diff) | |
download | jquery-62b9a2583460c2384f6de1d0a6aeaf05e51d523b.tar.gz jquery-62b9a2583460c2384f6de1d0a6aeaf05e51d523b.zip |
Tests: Disable the ":lang respects escaped backslashes" test
Firefox 114+ no longer match on backslashes in `:lang()`, even when escaped.
It is an intentional change as `:lang()` parameters are supposed to be valid
BCP 47 strings. Therefore, we won't attempt to patch it.
We'll keep this test here until other browsers match the behavior.
Fixes gh-5271
Closes gh-5277
Ref https://bugzilla.mozilla.org/show_bug.cgi?id=1839747#c1
Ref https://github.com/w3c/csswg-drafts/issues/8720#issuecomment-1509242961
-rw-r--r-- | test/unit/selector.js | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/test/unit/selector.js b/test/unit/selector.js index 57e21ce6b..086726d43 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -1474,7 +1474,7 @@ QUnit.test( "pseudo - :target and :root", function( assert ) { } ); QUnit.test( "pseudo - :lang", function( assert ) { - assert.expect( QUnit.jQuerySelectors ? 105 : 55 ); + assert.expect( QUnit.jQuerySelectors ? 104 : 54 ); var docElem = document.documentElement, docXmlLang = docElem.getAttribute( "xml:lang" ), @@ -1547,8 +1547,18 @@ QUnit.test( "pseudo - :lang", function( assert ) { anchor.parentNode.lang = "ara"; anchor.lang = "ara\\b"; assert.deepEqual( jQuery( ":lang(ara\\b)", foo ).get(), [], ":lang respects backslashes" ); - assert.deepEqual( jQuery( ":lang(ara\\\\b)", foo ).get(), [ anchor ], - ":lang respects escaped backslashes" ); + + // Support: Firefox 114+ + // Firefox 114+ no longer match on backslashes in `:lang()`, even when escaped. + // It is an intentional change as `:lang()` parameters are supposed to be valid + // BCP 47 strings. Therefore, we won't attempt to patch it. + // We'll keep this test here until other browsers match the behavior. + // See https://bugzilla.mozilla.org/show_bug.cgi?id=1839747#c1 + // See https://github.com/w3c/csswg-drafts/issues/8720#issuecomment-1509242961 + // + // assert.deepEqual( jQuery( ":lang(ara\\\\b)", foo ).get(), [ anchor ], + // ":lang respects escaped backslashes" ); + assert.throws( function() { jQuery( "#qunit-fixture:lang(c++)" ); }, ":lang value must be a valid identifier" ); |