2 <script src=
"../../../resources/testharness.js"></script>
3 <script src=
"../../../resources/testharnessreport.js"></script>
7 #t3 + div + div + #r3 { background-color: rgb(
0,
128,
0); }
31 document
.body
.offsetTop
;
34 assert_true(!!window
.internals
, "This test only works with internals exposed present");
35 }, "internals are exposed");
38 var i1
= document
.getElementById('i1');
39 var r1
= document
.getElementById('r1');
40 assert_equals(getComputedStyle(r1
).backgroundColor
, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
42 i1
.parentNode
.insertBefore(document
.createElement('div'), i1
);
43 assert_equals(internals
.updateStyleAndReturnAffectedElementCount(), 4, "Subtree style recalc");
44 assert_equals(getComputedStyle(r1
).backgroundColor
, "rgb(0, 128, 0)", "Background color is green after class change");
45 }, "Insert between siblings");
48 var i2
= document
.getElementById('i2');
49 var r2
= document
.getElementById('r2');
50 assert_equals(getComputedStyle(r2
).backgroundColor
, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
52 var t2
= document
.createElement('div');
54 i2
.parentNode
.insertBefore(t2
, i2
);
55 assert_equals(internals
.updateStyleAndReturnAffectedElementCount(), 5, "Subtree style recalc");
56 assert_equals(getComputedStyle(r2
).backgroundColor
, "rgb(0, 128, 0)", "Background color is green after class change");
57 }, "Insert before siblings");
60 var d3
= document
.getElementById('d3');
61 var r3
= document
.getElementById('r3');
62 assert_true(!!window
.eventSender
, "This test only works with eventSender present");
64 d3
.parentNode
.removeChild(d3
);
65 assert_equals(internals
.updateStyleAndReturnAffectedElementCount(), 3, "Subtree style recalc");
66 assert_equals(getComputedStyle(r3
).backgroundColor
, "rgb(0, 128, 0)", "Background color is green after class change");
67 }, "Remove between siblings");