summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/dynamic/first-child-descendant.html
blob: 47cd8cb7388d5e2f7cbcaa36cd637f0f1560a603 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
<!DOCTYPE html>
<script src="../../resources/js-test.js"></script>
<style>
#b { color: green; }
#a:first-child #b { color: red }
</style>
<div id="t">
    <div id="a">
        <div id="b">This text should be green</div>
    </div>
</div>
<script>
description("Evaluation of :first-child affecting descendant.");

t.offsetTop;
a.style.backgroundColor = "white";
t.offsetTop;
t.insertBefore(document.createElement("div"), a);

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

shouldBe("getComputedStyle(b).color", "green");
</script>