Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / invalidation / toggle-style-inside-shadow-root.html
blobfabef1eb236e09bccec6e2da1550042678c36098
1 <script src="../../../resources/js-test.js"></script>
2 <div></div>
3 <script>
4 var div = document.querySelector('div');
5 var root = div.createShadowRoot();
6 root.innerHTML = '<style> .red { background: red; }</style><div>tap to toggle red</div>';
7 var rootDiv = root.querySelector('div');
8 rootDiv.offsetHeight;
10 rootDiv.classList.toggle('red');
11 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", '1');
12 shouldBe('getComputedStyle(rootDiv).backgroundColor', '"rgb(255, 0, 0)"');
14 rootDiv.offsetHeight;
15 rootDiv.classList.toggle('red');
16 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", '1');
17 shouldBe('getComputedStyle(rootDiv).backgroundColor', '"rgba(0, 0, 0, 0)"');
18 </script>