Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / invalidation / empty-pseudo-sibling.html
blobc897b4e7056901a38d8ae49d9d452d844c55c7ce
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <style>
4 :empty + div { background-color: green }
5 </style>
6 <div id="empty"></div>
7 <div id="emptySibling">
8 <div></div>
9 <div></div>
10 <div></div>
11 <div></div>
12 </div>
13 <div id="notEmpty"><div id="child"></div></div>
14 <div id="notEmptySibling">
15 <div></div>
16 <div></div>
17 <div></div>
18 <div></div>
19 </div>
20 <script>
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"));
31 if (window.internals)
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);
41 if (window.internals)
42 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "6");
44 shouldBe("getComputedStyle(notEmptySibling, '').backgroundColor", "green");
45 </script>