Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit bfb16db

Browse files
lillesmoz-wptsync-bot
authored andcommitted
Bug 1835033 [wpt PR 40220] - [@container] Inheritance propagation lost at style query change, a=testonly
Automatic update from web-platform-tests [@container] Inheritance propagation lost at style query change Based modified the StyleRecalcChange on style query evaluation changes instead of the child_change that captured the change from RecalcOwnStyle. Base on child_change instead. Bug: 1445876 Change-Id: I2e064b03c2ef3f823cc51a7f733bf04ab2574b59 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4565675 Commit-Queue: Rune Lillesveen <[email protected]> Reviewed-by: Anders Hartvoll Ruud <[email protected]> Cr-Commit-Position: refs/heads/main@{#1149034} -- wpt-commits: 414a38ccc898aa9bb3b7317f35702350f7892460 wpt-pr: 40220
1 parent e30a5a3 commit bfb16db

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!DOCTYPE html>
2+
<title>CSS Container Query Test: named style container query change with inherited custom property</title>
3+
<link rel="help" href="https://drafts.csswg.org/css-contain-3/#container-rule">
4+
<script src="/resources/testharness.js"></script>
5+
<script src="/resources/testharnessreport.js"></script>
6+
<script src="support/cq-testcommon.js"></script>
7+
<style>
8+
#container {
9+
container-name: container;
10+
}
11+
.match {
12+
--match: true;
13+
}
14+
#inner {
15+
color: red;
16+
}
17+
@container container style(--match: true) {
18+
#inner {
19+
color: green;
20+
}
21+
}
22+
</style>
23+
<div id="container">
24+
<div id="outer">
25+
<div id="inner"></div>
26+
</div>
27+
</div>
28+
<script>
29+
setup(() => assert_implements_container_queries());
30+
31+
test(() => {
32+
assert_equals(getComputedStyle(inner).color, "rgb(255, 0, 0)");
33+
assert_equals(getComputedStyle(inner).getPropertyValue("--match"), "");
34+
assert_equals(getComputedStyle(outer).getPropertyValue("--match"), "");
35+
assert_equals(getComputedStyle(container).getPropertyValue("--match"), "");
36+
}, "Pre-conditions");
37+
38+
test(() => {
39+
container.className = "match";
40+
assert_equals(getComputedStyle(inner).color, "rgb(0, 128, 0)");
41+
assert_equals(getComputedStyle(inner).getPropertyValue("--match"), "true");
42+
assert_equals(getComputedStyle(outer).getPropertyValue("--match"), "true");
43+
assert_equals(getComputedStyle(container).getPropertyValue("--match"), "true");
44+
}, "Changed --match inherits down descendants and affects container query");
45+
</script>

0 commit comments

Comments
 (0)