Skip to content

Commit 25a1b08

Browse files
authored
Tests: Fix selector tests in Chrome 141
Chrome 141 incorrectly matches `:lang()` selectors with values with a trailing `-`. This is fixed in Chrome 142, so just skip these tests in v141. See https://issues.chromium.org/issues/451355198 Closes gh-5716 Ref gh-5717
1 parent 65e3545 commit 25a1b08

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

test/unit/selector.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1537,7 +1537,17 @@ QUnit.test( "pseudo - :lang", function( assert ) {
15371537
assert.ok( jQuery( elem ).is( selector ), text + " match " + selector );
15381538
},
15391539
assertNoMatch = function( text, elem, selector ) {
1540-
assert.ok( !jQuery( elem ).is( selector ), text + " fail " + selector );
1540+
1541+
// Support: Chrome 141 only
1542+
// Chrome 141 incorrectly matches `:lang()` selectors with values with a trailing `-`.
1543+
// This is fixed in Chrome 142, so just skip these tests in v141.
1544+
// See https://issues.chromium.org/issues/451355198
1545+
if ( /\b(?:headless)?chrome\/141\./i.test( navigator.userAgent ) &&
1546+
selector.slice( -2 ) === "-)" ) {
1547+
assert.ok( true, "Broken handling in Chrome 141: " + text + " fail " + selector );
1548+
} else {
1549+
assert.ok( !jQuery( elem ).is( selector ), text + " fail " + selector );
1550+
}
15411551
};
15421552

15431553
// Prefixing and inheritance

0 commit comments

Comments
 (0)