1
0
Fork 0
firefox/testing/web-platform/tests/css/css-cascade/scope-overlapping-has.html
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

33 lines
1,000 B
HTML

<!DOCTYPE html>
<title>@scope - Overlapping scopes with :has(..:scope..) selector</title>
<link rel="help" href="https://drafts.csswg.org/css-cascade-6/#scope-atrule">
<link rel="help" href="https://issues.chromium.org/issues/383343312">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
:where(*) {
background-color: green;
}
@scope (.a) to (.limit) {
:scope:has(.b:not(:scope .a *)) .hello {
background-color: red;
}
}
</style>
<div class=a id=outer>
<div>
<div class=limit>
<div class=a id=inner>
<div class=b></div>
<div class=hello id=first>hello</div>
</div>
</div>
</div>
<div class=hello id=second>hello</div>
</div>
<script>
test(() => {
assert_equals(getComputedStyle(first).backgroundColor, 'rgb(255, 0, 0)');
assert_equals(getComputedStyle(second).backgroundColor, 'rgb(0, 128, 0)');
}, ':has() with inner :scope works when scopes overlap');
</script>