Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / pseudo-empty-adjacent-dynamic.html
blob8fdbd40591785395bc345b47e1d69f52b7a029cf
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">To be removed</div>
7 <div id="sibling">This text should be green</div>
8 <script>
9 description("Check that the sibling of an element that becomes :empty is properly recalculated");
11 var transparent = "rgba(0, 0, 0, 0)";
12 var green = "rgb(0, 128, 0)";
14 empty.offsetTop; // force recalc
15 empty.style.color = "red"; // force LocalStyleChange on #empty
16 empty.offsetTop; // force recalc
18 shouldBe("getComputedStyle(sibling, '').backgroundColor", "transparent");
20 empty.removeChild(empty.firstChild);
21 empty.offsetTop; // force recalc
23 shouldBe("getComputedStyle(sibling, '').backgroundColor", "green");
24 </script>