Files
Rune Lillesveen cf454d0413 Bug 1906072 [wpt PR 46976] - Fix spec links in css-conditional/container-queries, a=testonly
Automatic update from web-platform-tests
Fix spec links in css-conditional/container-queries

Spec and test directory was moved, but spec links were out of date.

Change-Id: I815fb24d7fdf08ed97bb056ba48edbd2eb78a110
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5672853
Commit-Queue: Rune Lillesveen <[email protected]>
Reviewed-by: Daniil Sakhapov <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1322694}

--

wpt-commits: 46cc5c1b6e2886e90ecb6c3c347b1a6f9e061a86
wpt-pr: 46976
2024-07-11 07:59:40 +00:00

45 lines
1.2 KiB
HTML

<!DOCTYPE html>
<title>@scope - inner @container</title>
<link rel="help" href="https://drafts.csswg.org/css-cascade-6/#scope-atrule">
<link rel="help" href="https://drafts.csswg.org/css-conditional-5/#container-rule">
<link rel="help" href="https://drafts.csswg.org/css-cascade-5/#scope-scope">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
main {
width: 100px;
height: 100px;
container-type: size;
}
@scope (.a) {
@container (width > 0px) {
:scope {
z-index: 1;
}
.b {
background-color: green;
}
}
}
</style>
<main>
<div class=a>
<div class=b>
</div>
</div>
<div class=b></div>
</main>
<script>
test(() => {
let a = document.querySelector('main > .a');
let b = document.querySelector('main > .a > .b');
assert_equals(getComputedStyle(a).zIndex, '1');
assert_equals(getComputedStyle(b).backgroundColor, 'rgb(0, 128, 0)');
let out_of_scope_b = document.querySelector('main > .b');
assert_equals(getComputedStyle(out_of_scope_b).backgroundColor, 'rgba(0, 0, 0, 0)');
}, 'Style rules within @container are scoped');
</script>