| Index: LayoutTests/fast/css/invalidation/shadow-add-sheet-host.html
|
| diff --git a/LayoutTests/fast/css/invalidation/shadow-add-sheet-host.html b/LayoutTests/fast/css/invalidation/shadow-add-sheet-host.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..5852e0d86f505cefb9efa3d5cd9727e858958a6b
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/css/invalidation/shadow-add-sheet-host.html
|
| @@ -0,0 +1,36 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../../resources/js-test.js"></script>
|
| +<style>
|
| + #outerHost { color: red }
|
| +</style>
|
| +<div>
|
| + <div id="outerHost"></div>
|
| + <div></div>
|
| + <div></div>
|
| +</div>
|
| +<script>
|
| + description("Insert a style element into a shadow tree affecting the host.");
|
| +
|
| + var outerRoot = outerHost.createShadowRoot();
|
| + outerRoot.innerHTML = "<div><div id='host1'></div></div><div></div>";
|
| +
|
| + var host1 = outerRoot.querySelector("#host1");
|
| + var root1 = host1.createShadowRoot();
|
| + root1.innerHTML = "<div><div id='host2'></div></div><div></div>";
|
| +
|
| + var host2 = root1.querySelector("#host2");
|
| + var root2 = host2.createShadowRoot();
|
| + root2.innerHTML = "This text should be green";
|
| +
|
| + shouldBeEqualToString("getComputedStyle(host2).color", "rgb(255, 0, 0)");
|
| +
|
| + document.body.offsetTop;
|
| + var sheet = document.createElement("style");
|
| + sheet.appendChild(document.createTextNode(":host { color: green }"));
|
| + root2.appendChild(sheet);
|
| +
|
| + if (window.internals)
|
| + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
|
| +
|
| + shouldBeEqualToString("getComputedStyle(host2).color", "rgb(0, 128, 0)");
|
| +</script>
|
|
|