Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Side by Side Diff: LayoutTests/fast/css/invalidation/targeted-class-host-pseudo.html

Issue 208013002: Support invalidation sets for :host pseudo. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <div id="host1"></div>
4 <div id="host2"></div>
5 <div id="host3" class="c3"></div>
6 <script>
7 description("Check that targeted class invalidation works with the :host pseudo class.");
8
9 // Create shadow trees
10
11 var host1 = document.getElementById("host1");
12 host1.createShadowRoot().innerHTML = "<style>:host(.c1) { background-color: gree n }</style><div></div><div></div><div></div><div></div><div></div>";
13
14 var host2 = document.getElementById("host2");
15 host2.createShadowRoot().innerHTML = '<style>:host(.c2) .inner { background-colo r: green }</style><div></div><div></div><div></div><div><span id="inner" class=" inner"></span></div>';
16
17 var host3 = document.getElementById("host3");
18 host3.createShadowRoot().innerHTML = "<style>:host(:not(.c3)) { background-color : green }</style><div></div><div></div><div></div><div></div>";
19
20 var transparent = "rgba(0, 0, 0, 0)";
21 var green = "rgb(0, 128, 0)";
22
23 var inner = host2.shadowRoot.getElementById("inner");
24
25 shouldBe("getComputedStyle(host1, null).backgroundColor", "transparent");
26 shouldBe("getComputedStyle(inner, null).backgroundColor", "transparent");
27 shouldBe("getComputedStyle(host3, null).backgroundColor", "transparent");
28
29 document.body.offsetLeft; // force style recalc.
30
31 host1.className = "c1";
32 if (window.internals)
33 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
34 shouldBe("getComputedStyle(host1, null).backgroundColor", "green");
35
36 document.body.offsetLeft; // force style recalc.
37
38 host2.className = "c2";
39 if (window.internals)
40 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
41 shouldBe("getComputedStyle(inner, null).backgroundColor", "green");
42
43 document.body.offsetLeft; // force style recalc.
44
45 host3.className = "";
46 if (window.internals)
47 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "6");
48 shouldBe("getComputedStyle(host3, null).backgroundColor", "green");
49 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698