| Index: LayoutTests/fast/css/invalidation/targeted-class-host-pseudo.html
|
| diff --git a/LayoutTests/fast/css/invalidation/targeted-class-host-pseudo.html b/LayoutTests/fast/css/invalidation/targeted-class-host-pseudo.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..7f2b0a1ddf95f0b61994d63474407bb898006281
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/css/invalidation/targeted-class-host-pseudo.html
|
| @@ -0,0 +1,49 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../../resources/js-test.js"></script>
|
| +<div id="host1"></div>
|
| +<div id="host2"></div>
|
| +<div id="host3" class="c3"></div>
|
| +<script>
|
| +description("Check that targeted class invalidation works with the :host pseudo class.");
|
| +
|
| +// Create shadow trees
|
| +
|
| +var host1 = document.getElementById("host1");
|
| +host1.createShadowRoot().innerHTML = "<style>:host(.c1) { background-color: green }</style><div></div><div></div><div></div><div></div><div></div>";
|
| +
|
| +var host2 = document.getElementById("host2");
|
| +host2.createShadowRoot().innerHTML = '<style>:host(.c2) .inner { background-color: green }</style><div></div><div></div><div></div><div><span id="inner" class="inner"></span></div>';
|
| +
|
| +var host3 = document.getElementById("host3");
|
| +host3.createShadowRoot().innerHTML = "<style>:host(:not(.c3)) { background-color: green }</style><div></div><div></div><div></div><div></div>";
|
| +
|
| +var transparent = "rgba(0, 0, 0, 0)";
|
| +var green = "rgb(0, 128, 0)";
|
| +
|
| +var inner = host2.shadowRoot.getElementById("inner");
|
| +
|
| +shouldBe("getComputedStyle(host1, null).backgroundColor", "transparent");
|
| +shouldBe("getComputedStyle(inner, null).backgroundColor", "transparent");
|
| +shouldBe("getComputedStyle(host3, null).backgroundColor", "transparent");
|
| +
|
| +document.body.offsetLeft; // force style recalc.
|
| +
|
| +host1.className = "c1";
|
| +if (window.internals)
|
| + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
|
| +shouldBe("getComputedStyle(host1, null).backgroundColor", "green");
|
| +
|
| +document.body.offsetLeft; // force style recalc.
|
| +
|
| +host2.className = "c2";
|
| +if (window.internals)
|
| + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
|
| +shouldBe("getComputedStyle(inner, null).backgroundColor", "green");
|
| +
|
| +document.body.offsetLeft; // force style recalc.
|
| +
|
| +host3.className = "";
|
| +if (window.internals)
|
| + shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "6");
|
| +shouldBe("getComputedStyle(host3, null).backgroundColor", "green");
|
| +</script>
|
|
|