Skip to content

Commit 2f1afae

Browse files
committed
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 w3c/csswg-drafts#8720 (comment)
1 parent 4194dc4 commit 2f1afae

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

test/unit/selector.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -1246,7 +1246,7 @@ QUnit.test( "pseudo - :target and :root", function( assert ) {
12461246
} );
12471247

12481248
QUnit.test( "pseudo - :lang", function( assert ) {
1249-
assert.expect( 105 );
1249+
assert.expect( 104 );
12501250

12511251
var docElem = document.documentElement,
12521252
docXmlLang = docElem.getAttribute( "xml:lang" ),
@@ -1319,8 +1319,17 @@ QUnit.test( "pseudo - :lang", function( assert ) {
13191319
anchor.parentNode.lang = "ara";
13201320
anchor.lang = "ara\\b";
13211321
assert.deepEqual( Sizzle( ":lang(ara\\b)", foo ), [], ":lang respects backslashes" );
1322-
assert.deepEqual( Sizzle( ":lang(ara\\\\b)", foo ), [ anchor ],
1323-
":lang respects escaped backslashes" );
1322+
1323+
// Support: Firefox 114+
1324+
// Firefox 114+ no longer match on backslashes in `:lang()`, even when escaped.
1325+
// It is an intentional change as `:lang()` parameters are supposed to be valid
1326+
// BCP 47 strings. Therefore, we won't attempt to patch it.
1327+
// We'll keep this test here until other browsers match the behavior.
1328+
// See https://bugzilla.mozilla.org/show_bug.cgi?id=1839747#c1
1329+
// See https://github.com/w3c/csswg-drafts/issues/8720#issuecomment-1509242961
1330+
// assert.deepEqual( Sizzle( ":lang(ara\\\\b)", foo ), [ anchor ],
1331+
// ":lang respects escaped backslashes" );
1332+
13241333
assert.throws( function() {
13251334
Sizzle.call( null, "#qunit-fixture:lang(c++)" );
13261335
}, function( e ) {

0 commit comments

Comments
 (0)