2 <script src="../../../resources/js-test.js"></script>
4 :empty + div { background-color: green }
7 <div id="emptySibling">
13 <div id="notEmpty"><div id="child"></div></div>
14 <div id="notEmptySibling">
21 description("Use descendant invalidation set for :empty pseudo class - sibling invalidation.")
23 var transparent = "rgba(0, 0, 0, 0)";
24 var green = "rgb(0, 128, 0)";
26 shouldBe("getComputedStyle(emptySibling, '').backgroundColor", "green");
28 empty.offsetTop; // force recalc
29 empty.appendChild(document.createElement("div"));
32 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "7");
34 shouldBe("getComputedStyle(emptySibling, '').backgroundColor", "transparent");
36 shouldBe("getComputedStyle(notEmptySibling, '').backgroundColor", "transparent");
38 notEmpty.offsetTop; // force recalc
39 notEmpty.removeChild(child);
42 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "6");
44 shouldBe("getComputedStyle(notEmptySibling, '').backgroundColor", "green");