mirror of
https://github.com/servo/servo.git
synced 2025-08-13 01:15:34 +01:00
Update web-platform-tests to revision b'e0214318249f1b6ea09b837db6eac7b0facd1b52'
This commit is contained in:
parent
3429e8fe3b
commit
febcb80385
141 changed files with 2568 additions and 986 deletions
|
@ -26,4 +26,5 @@
|
|||
<div class="test"></div>
|
||||
<div class="test"></div>
|
||||
<div class="test"></div>
|
||||
<div class="test"></div>
|
||||
</body>
|
||||
|
|
|
@ -80,6 +80,14 @@
|
|||
background-color: green !important;
|
||||
}
|
||||
|
||||
/* & at top level counts as :scope, i.e. the root element here */
|
||||
& .test-12 {
|
||||
background-color: green;
|
||||
}
|
||||
& > .test-12 {
|
||||
background-color: red !important;
|
||||
}
|
||||
|
||||
body * + * {
|
||||
margin-top: 8px;
|
||||
}
|
||||
|
@ -100,4 +108,5 @@
|
|||
<div class="test test-9 t9-- t9-"><div></div></div>
|
||||
<div class="test test-10"><div></div></div>
|
||||
<div class="test test-11"><div></div></div>
|
||||
<div class="test test-12"></div>
|
||||
</body>
|
||||
|
|
|
@ -0,0 +1,30 @@
|
|||
<!doctype html>
|
||||
<title>Top-level & is treated like :scope</title>
|
||||
<link rel="author" title="Steinar H. Gunderson" href="mailto:sesse@chromium.org">
|
||||
<link rel="help" href="https://drafts.csswg.org/css-nesting-1/">
|
||||
<script src="/resources/testharness.js"></script>
|
||||
<script src="/resources/testharnessreport.js"></script>
|
||||
|
||||
<div id="p">
|
||||
<div class="match" id="level1">
|
||||
<div class="match" id="level2"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
test(() => {
|
||||
let matched = [];
|
||||
for (const elem of p.querySelectorAll('& .match')) {
|
||||
matched.push(elem.getAttribute('id'));
|
||||
}
|
||||
assert_array_equals(matched, ['level1', 'level2']);
|
||||
}, '& as direct ancestor');
|
||||
|
||||
test(() => {
|
||||
let matched = [];
|
||||
for (const elem of p.querySelectorAll('& > .match')) {
|
||||
matched.push(elem.getAttribute('id'));
|
||||
}
|
||||
assert_array_equals(matched, ['level1']);
|
||||
}, '& matches scoped element only, not everything');
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue