| Index: LayoutTests/fast/dom/shadow/host-context-class-change.html
|
| diff --git a/LayoutTests/fast/dom/shadow/host-context-class-change.html b/LayoutTests/fast/dom/shadow/host-context-class-change.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..869bc89555ae3d6d023c163cf3f9593071e81782
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/dom/shadow/host-context-class-change.html
|
| @@ -0,0 +1,38 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../../resources/js-test.js"></script>
|
| +<script src="resources/shadow-dom.js"></script>
|
| +<style>
|
| +</style>
|
| +<div id="sandbox"></div>
|
| +<script>
|
| +description("Class change affecting a node in a distributed node's subtree.");
|
| +
|
| +var sandbox = document.getElementById('sandbox');
|
| +
|
| +sandbox.appendChild(
|
| + createDOM('parent-element', {},
|
| + createShadowRoot(
|
| + createDOM('div', {'id': 'a'},
|
| + createDOM('content', {}))),
|
| + createDOM('child-element', {},
|
| + createShadowRoot(
|
| + createDOM('style', {},
|
| + document.createTextNode(':host-context(.a) .b { background-color: green; }')),
|
| + createDOM('div', {},
|
| + createDOM('div', {'class': 'b'}))))));
|
| +
|
| +var transparent = "rgba(0, 0, 0, 0)";
|
| +var green = "rgb(0, 128, 0)";
|
| +
|
| +document.body.offsetTop; // force recalc
|
| +
|
| +var a = sandbox.querySelector("parent-element").shadowRoot.querySelector("#a");
|
| +var b = sandbox.querySelector("child-element").shadowRoot.querySelector(".b");
|
| +
|
| +shouldBe("getComputedStyle(b, null).backgroundColor", "transparent");
|
| +
|
| +a.className = "a";
|
| +document.body.offsetTop; // force recalc.
|
| +
|
| +shouldBe("getComputedStyle(b, null).backgroundColor", "green");
|
| +</script>
|
|
|