mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-21 11:40:34 -10:00
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
19 lines
570 B
JavaScript
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');
|
|
}
|