2 <script src=
"../../resources/js-test.js"></script>
3 <style id=
"sheet">#removed { background-color: red; }
</style>
11 font-family: sans-serif;
12 background-color: green;
15 <div id=
"removed" class=
"green">
16 This text should have a green background.
25 description("Remove a stylesheet not affecting layout.");
27 var red
= "rgb(255, 0, 0)";
28 var green
= "rgb(0, 128, 0)";
30 shouldBe("getComputedStyle(removed).backgroundColor", "red");
31 document
.body
.offsetTop
; // force layout
33 sheet
.parentNode
.removeChild(sheet
);
35 if (window
.internals
) {
36 var recalcCount
= internals
.updateStyleAndReturnAffectedElementCount();
37 var layoutCount
= internals
.needsLayoutCount();
38 shouldBe("recalcCount", "1");
39 shouldBe("layoutCount", "0");
42 shouldBe("getComputedStyle(removed).backgroundColor", "green");