Files
sousa-gecko/testing/web-platform/tests/css/css-cascade/scope-import-parent-pseudo.html
T
Anders Hartvoll Ruud 2ac87e8d9a Bug 2025863 [wpt PR 58709] - [@scope] Drop tentative suffix for scoped import tests, a=testonly
Automatic update from web-platform-tests
[@scope] Drop tentative suffix for scoped import tests

This is now specified.

Bug: 369876911
Change-Id: I6f21067f2e8203bd5f3635c73242cb6e44a8e33b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7688598
Reviewed-by: Rune Lillesveen <futhark@chromium.org>
Commit-Queue: Anders Hartvoll Ruud <andruud@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1604048}

--

wpt-commits: 601ea75cc784f0b6a72c59443f461b12ff4463e5
wpt-pr: 58709
2026-03-30 08:09:33 +00:00

33 lines
1.1 KiB
HTML

<!DOCTYPE html>
<title>@import scope(), '&' selectors</title>
<link rel="help" href="https://drafts.csswg.org/css-cascade-6/#at-import">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
@import url("resources/scope-imported.css") scope((.scope));
</style>
<main id=main>
<div class=scope>
<div class=w>Inside</div>
<div class=scope>
<div class=w>Inner (W)</div>
<div class=u>Inner (U)</div>
</div>
</div>
</main>
<script>
test(() => {
let e = main.querySelector('#main > .scope > .w');
assert_equals(getComputedStyle(e).getPropertyValue('--w'), '1');
}, 'The & selector matches the scoping root');
test(() => {
let w = main.querySelector('#main > .scope > .scope > .w');
assert_equals(getComputedStyle(w).getPropertyValue('--w'), '1');
// The '& > & > .u' selector should behave like ':scope > :scope > .u'
// and therefore never match.
let u = main.querySelector('#main > .scope > .scope > .u');
assert_equals(getComputedStyle(u).getPropertyValue('--u'), '');
}, 'The & selector behaves like :scope');
</script>