Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / remove-sheet-no-layout.html
blobba319dbfa6d8bdb5b25d35a51b1e40ab0253da2a
1 <!DOCTYPE html>
2 <script src="../../resources/js-test.js"></script>
3 <style id="sheet">#removed { background-color: red; }</style>
4 <style>
5 @font-face {
6 font-family: dummy;
7 src: local(dummy);
10 .green {
11 font-family: sans-serif;
12 background-color: green;
14 </style>
15 <div id="removed" class="green">
16 This text should have a green background.
17 </div>
18 <div>
19 <div></div>
20 <div></div>
21 <div></div>
22 <div></div>
23 </div>
24 <script>
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");
43 </script>