1 <script src=
"../../../resources/js-test.js"></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');
10 rootDiv
.classList
.toggle('red');
11 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", '1');
12 shouldBe('getComputedStyle(rootDiv).backgroundColor', '"rgb(255, 0, 0)"');
15 rootDiv
.classList
.toggle('red');
16 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", '1');
17 shouldBe('getComputedStyle(rootDiv).backgroundColor', '"rgba(0, 0, 0, 0)"');