Skip to content

Commit 553df81

Browse files
committed
Bug 1979328 [wpt PR 53975] - :host::part() should only match with part and rule in the same tree, a=testonly
Automatic update from web-platform-tests :host::part() should only match with part and rule in the same tree Bug: 432289354 Change-Id: I2ec026f2d9718a0c021aaef6ad7aa1c7d27cc946 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/6780977 Reviewed-by: Daniil Sakhapov <sakhapovchromium.org> Commit-Queue: Rune Lillesveen <futharkchromium.org> Cr-Commit-Position: refs/heads/main{#1491938} -- wpt-commits: 4e3f36bc65d9795eb0067567240f0a3f5f045f6c wpt-pr: 53975 UltraBlame original commit: af0037887105746ede10ecbe18d50fea210b0208
1 parent 5022366 commit 553df81

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
<!DOCTYPE html>
2+
<title>CSS Shadow Parts - :host::part() not matching in inner scope</title>
3+
<link rel="help" href="https://drafts.csswg.org/css-shadow-parts/#part">
4+
<link rel="help" href="https://drafts.csswg.org/css-scoping/#host-selector">
5+
<script src="/resources/testharness.js"></script>
6+
<script src="/resources/testharnessreport.js"></script>
7+
<div id="outer">
8+
<template shadowrootmode="open">
9+
<style>
10+
:host::part(x) {
11+
color: red;
12+
}
13+
</style>
14+
<div id="inner">
15+
<template shadowrootmode="open">
16+
<style>
17+
p { color: green; }
18+
</style>
19+
<p part="x">This should not be red</p>
20+
</template>
21+
</div>
22+
</template>
23+
</div>
24+
<script>
25+
test(() => {
26+
const part = outer.shadowRoot.querySelector("#inner").shadowRoot.querySelector("p");
27+
assert_equals(getComputedStyle(part).color, "rgb(0, 128, 0)");
28+
}, ":host::part() should only match when the part is in the same tree as the rule");
29+
</script>

0 commit comments

Comments
 (0)