Files
firefox/testing/web-platform/tests/css/support/query-testcommon.js
T
Eric Willigers c89c7a7748 Bug 1664694 [wpt PR 25507] - CSS: Retire expansion-based implementation of :is and :where, a=testonly
Automatic update from web-platform-tests
CSS: Retire expansion-based implementation of :is and :where

We no longer attempt to expand :is and :where during style sheet loading.

Correct support for these selectors remains to be implemented.

In particular, we need:
- invalidation - RuleFeatureSet
- support for empty selector lists
- error recovery - CSSSelectorParser

Bug: 1127347
Change-Id: I28912cf5cb9b373c423d488b47c20251917329fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2405034
Commit-Queue: Eric Willigers <[email protected]>
Reviewed-by: Anders Hartvoll Ruud <[email protected]>
Cr-Commit-Position: refs/heads/master@{#808207}

--

wpt-commits: 140c8a2c352df047d2e60bfdef1169364daf2af7
wpt-pr: 25507
2020-09-23 09:03:02 +00:00

19 lines
570 B
JavaScript

'use strict';
function test_query_selector(parentNode, selector, expected) {
if (!Array.isArray(expected))
expected = [ expected ];
test(function(){
const elementList = parentNode.querySelectorAll(selector);
assert_equals(elementList.length, expected.length);
for (let i = 0; i < elementList.length; ++i) {
if (typeof expected[i] === 'string')
assert_equals(elementList[i].id, expected[i]);
else
assert_equals(elementList[i], expected[i]);
}
}, "Selector '" + selector + '" should find the expected elements');
}