From 2f1afae2abb6aef7c9862fbe2ecfae8496a8fd0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Go=C5=82e=CC=A8biowski-Owczarek?= Date: Thu, 7 Sep 2023 16:51:31 +0200 Subject: [PATCH] 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. Ref jquery/jquery#5271 Ref jquery/jquery#5277 Ref https://bugzilla.mozilla.org/show_bug.cgi?id=1839747#c1 Ref https://github.com/w3c/csswg-drafts/issues/8720#issuecomment-1509242961 --- test/unit/selector.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/test/unit/selector.js b/test/unit/selector.js index bf56e854..47bcea27 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -1246,7 +1246,7 @@ QUnit.test( "pseudo - :target and :root", function( assert ) { } ); QUnit.test( "pseudo - :lang", function( assert ) { - assert.expect( 105 ); + assert.expect( 104 ); var docElem = document.documentElement, docXmlLang = docElem.getAttribute( "xml:lang" ), @@ -1319,8 +1319,17 @@ QUnit.test( "pseudo - :lang", function( assert ) { anchor.parentNode.lang = "ara"; anchor.lang = "ara\\b"; assert.deepEqual( Sizzle( ":lang(ara\\b)", foo ), [], ":lang respects backslashes" ); - assert.deepEqual( Sizzle( ":lang(ara\\\\b)", foo ), [ 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( Sizzle( ":lang(ara\\\\b)", foo ), [ anchor ], + // ":lang respects escaped backslashes" ); + assert.throws( function() { Sizzle.call( null, "#qunit-fixture:lang(c++)" ); }, function( e ) {