summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/pseudo-empty-adjacent-dynamic.html
blob: 8fdbd40591785395bc345b47e1d69f52b7a029cf (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<style>
:empty + div { background-color: green; }
</style>
<div id="empty">To be removed</div>
<div id="sibling">This text should be green</div>
<script>
description("Check that the sibling of an element that becomes :empty is properly recalculated");

var transparent = "rgba(0, 0, 0, 0)";
var green = "rgb(0, 128, 0)";

empty.offsetTop; // force recalc
empty.style.color = "red"; // force LocalStyleChange on #empty
empty.offsetTop; // force recalc

shouldBe("getComputedStyle(sibling, '').backgroundColor", "transparent");

empty.removeChild(empty.firstChild);
empty.offsetTop; // force recalc

shouldBe("getComputedStyle(sibling, '').backgroundColor", "green");
</script>