mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-10 05:08:36 +02:00
Automatic update from web-platform-testsCheck slot re-assignment for getComputedStyle. We only checked if we needed to update v0 shadow distribution before skipping style recalc for getComputedStyle and friends. Slot re- assignment for shadow dom v1 also needs to be done as it may affect inheritance ancestors for the element in question. This may be the reason for issue 900138, but we have no repro, so hard to say. Bug: 900138 Change-Id: Ie2ceae97141aabed0e26de3070b1f170e9eedeed Reviewed-on: https://chromium-review.googlesource.com/c/1307396 Reviewed-by: Hayato Ito <hayato@chromium.org> Commit-Queue: Rune Lillesveen <futhark@chromium.org> Cr-Commit-Position: refs/heads/master@{#604187} -- wpt-commits: 4b8cb25d91bc5961fd484a60be9c6c06b12ab744 wpt-pr: 13786
19 lines
755 B
HTML
19 lines
755 B
HTML
<!DOCTYPE html>
|
|
<script src="/resources/testharness.js"></script>
|
|
<script src="/resources/testharnessreport.js"></script>
|
|
<link rel="help" href="https://drafts.csswg.org/css-scoping/#slots-in-shadow-tree">
|
|
<div id="host"><span id="slotted">This text should be green.</span></div>
|
|
<script>
|
|
const root = host.attachShadow({mode:"open"});
|
|
root.innerHTML = '<slot name="nomatch" style="color:green"></slot><slot style="color:red"></slot>';
|
|
|
|
test(() => {
|
|
assert_equals(getComputedStyle(slotted).color, "rgb(255, 0, 0)");
|
|
}, "Initial computed color.");
|
|
|
|
test(() => {
|
|
root.querySelector("slot").removeAttribute("name");
|
|
assert_equals(getComputedStyle(slotted).color, "rgb(0, 128, 0)");
|
|
|
|
}, "Computed color after re-slotting.");
|
|
</script>
|