2 <script src=
"../../resources/js-test.js"></script>
4 .a1 .b1::before { background-color: green; content:
"X" }
5 .a2 .b2::after { background-color: green; content:
"X" }
6 .a3 .b3::first-line { background-color: green }
7 .a4 .b4::first-letter { background-color: green }
9 /* workaround for issue
351322 */
10 .b3::first-line { background-color: transparent }
13 <div class=
"b1" id=
"r1"> < Background of 'X' should be green
</div>
14 <span></span><span></span><span></span><span></span><span></span><span></span>
17 <div class=
"b2" id=
"r2">Background of 'X' should be green
> </div>
18 <span></span><span></span><span></span><span></span><span></span><span></span>
21 <div class=
"b3" id=
"r3">Background should be green
</div>
22 <span></span><span></span><span></span><span></span><span></span><span></span>
25 <div class=
"b4" id=
"r4">Background of first letter should be green
</div>
26 <span></span><span></span><span></span><span></span><span></span><span></span>
29 description("Change classes affecting pseudo elements")
31 function forceLayout() {
32 document
.body
.offsetLeft
;
35 document
.body
.offsetTop
; // force style recalc.
37 var transparent
= 'rgba(0, 0, 0, 0)';
38 var green
= 'rgb(0, 128, 0)';
40 var t1
= document
.getElementById("t1");
41 var r1
= document
.getElementById("r1");
42 shouldBe("getComputedStyle(r1, '::before').backgroundColor", "transparent");
48 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
50 shouldBe("getComputedStyle(r1, '::before').backgroundColor", "green");
52 var t2
= document
.getElementById("t2");
53 var r2
= document
.getElementById("r2");
54 shouldBe("getComputedStyle(r2, '::after').backgroundColor", "transparent");
60 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
62 shouldBe("getComputedStyle(r2, '::after').backgroundColor", "green");
64 var t3
= document
.getElementById("t3");
65 var r3
= document
.getElementById("r3");
66 shouldBe("getComputedStyle(r3, '::first-line').backgroundColor", "transparent");
72 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "9");
74 shouldBe("getComputedStyle(r3, '::first-line').backgroundColor", "green");
76 var t4
= document
.getElementById("t4");
77 var r4
= document
.getElementById("r4");
78 shouldBe("getComputedStyle(r4, '::first-letter').backgroundColor", "transparent");
84 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "10");
86 document
.body
.offsetLeft
; // workaround for issue 351308
87 shouldBe("getComputedStyle(r4, '::first-letter').backgroundColor", "green");