diff options
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/selector.js | 12 | ||||
-rw-r--r-- | test/unit/support.js | 15 |
2 files changed, 21 insertions, 6 deletions
diff --git a/test/unit/selector.js b/test/unit/selector.js index 2b0c251cf..b1529175b 100644 --- a/test/unit/selector.js +++ b/test/unit/selector.js @@ -931,13 +931,23 @@ QUnit.test( "pseudo - nth-last-of-type", function( assert ) { } ); QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "pseudo - has", function( assert ) { - assert.expect( 3 ); + assert.expect( 4 ); assert.t( "Basic test", "p:has(a)", [ "firstp", "ap", "en", "sap" ] ); assert.t( "Basic test (irrelevant whitespace)", "p:has( a )", [ "firstp", "ap", "en", "sap" ] ); assert.t( "Nested with overlapping candidates", "#qunit-fixture div:has(div:has(div:not([id])))", [ "moretests", "t2037", "fx-test-group", "fx-queue" ] ); + + // Support: Safari 15.4+, Chrome 105+ + // `qSA` in Safari/Chrome throws for `:has()` with only unsupported arguments + // but if you add a supported arg to the list, it will run and just potentially + // return no results. Make sure this is accounted for. (gh-5098) + // Note: Chrome 105 has this behavior only in 105.0.5195.125 or newer; + // initially it shipped with a fully forgiving parsing in `:has()`. + assert.t( "Nested with list arguments", + "#qunit-fixture div:has(faketag, div:has(faketag, div:not([id])))", + [ "moretests", "t2037", "fx-test-group", "fx-queue" ] ); } ); QUnit[ QUnit.jQuerySelectors ? "test" : "skip" ]( "pseudo - contains", function( assert ) { diff --git a/test/unit/support.js b/test/unit/support.js index 2892e06d7..e3a7778c4 100644 --- a/test/unit/support.js +++ b/test/unit/support.js @@ -59,19 +59,24 @@ testIframe( userAgent = window.navigator.userAgent, expectedMap = { ie_11: { - "reliableTrDimensions": false + cssSupportsSelector: false, + reliableTrDimensions: false }, chrome: { - "reliableTrDimensions": true + cssSupportsSelector: false, + reliableTrDimensions: true }, safari: { - "reliableTrDimensions": true + cssSupportsSelector: false, + reliableTrDimensions: true }, firefox: { - "reliableTrDimensions": false + cssSupportsSelector: false, + reliableTrDimensions: false }, ios: { - "reliableTrDimensions": true + cssSupportsSelector: false, + reliableTrDimensions: true } }; |