2 <script src=
"../../../resources/js-test.js"></script>
4 .c5
> .c4 ~ .c3 .c2 + .c1 { background-color: green }
25 <div>This text should have a green background.
</div>
33 description("Check that targeted class invalidation works with when adjacent combinators are present.");
35 var transparent
= "rgba(0, 0, 0, 0)";
36 var green
= "rgb(0, 128, 0)";
38 var i1
= document
.getElementById("i1");
39 var i2
= document
.getElementById("i2");
40 var i3
= document
.getElementById("i3");
41 var i4
= document
.getElementById("i4");
42 var i5
= document
.getElementById("i5");
44 shouldBe("getComputedStyle(i1, null).backgroundColor", "transparent");
46 document
.body
.offsetTop
; // Force style recalc.
49 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
51 document
.body
.offsetTop
; // Force style recalc.
54 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
56 document
.body
.offsetTop
; // Force style recalc.
59 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
61 document
.body
.offsetTop
; // Force style recalc.
64 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
66 shouldBe("getComputedStyle(i1, null).backgroundColor", "transparent");
68 document
.body
.offsetLeft
; // force style recalc.
71 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
73 shouldBe("getComputedStyle(i1, null).backgroundColor", "green");