2 <script src=
"../../../resources/js-test.js"></script>
4 :empty { background-color: green }
5 #empty + div, #not-empty + div { color: pink }
14 <div id=
"notEmpty"><div id=
"child"></div></div>
22 description("Use descendant invalidation set for :empty pseudo class.")
24 var transparent
= "rgba(0, 0, 0, 0)";
25 var green
= "rgb(0, 128, 0)";
27 shouldBe("getComputedStyle(empty, '').backgroundColor", "green");
29 empty
.offsetTop
; // force recalc
30 empty
.appendChild(document
.createElement("div"));
33 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
35 shouldBe("getComputedStyle(empty, '').backgroundColor", "transparent");
37 shouldBe("getComputedStyle(notEmpty, '').backgroundColor", "transparent");
39 notEmpty
.offsetTop
; // force recalc
40 notEmpty
.removeChild(child
);
43 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
45 shouldBe("getComputedStyle(notEmpty, '').backgroundColor", "green");