| Index: LayoutTests/fast/css/remove-sheet-no-layout.html
|
| diff --git a/LayoutTests/fast/css/remove-sheet-no-layout.html b/LayoutTests/fast/css/remove-sheet-no-layout.html
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..ba319dbfa6d8bdb5b25d35a51b1e40ab0253da2a
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/css/remove-sheet-no-layout.html
|
| @@ -0,0 +1,43 @@
|
| +<!DOCTYPE html>
|
| +<script src="../../resources/js-test.js"></script>
|
| +<style id="sheet">#removed { background-color: red; }</style>
|
| +<style>
|
| +@font-face {
|
| + font-family: dummy;
|
| + src: local(dummy);
|
| +}
|
| +
|
| +.green {
|
| + font-family: sans-serif;
|
| + background-color: green;
|
| +}
|
| +</style>
|
| +<div id="removed" class="green">
|
| + This text should have a green background.
|
| +</div>
|
| +<div>
|
| + <div></div>
|
| + <div></div>
|
| + <div></div>
|
| + <div></div>
|
| +</div>
|
| +<script>
|
| +description("Remove a stylesheet not affecting layout.");
|
| +
|
| +var red = "rgb(255, 0, 0)";
|
| +var green = "rgb(0, 128, 0)";
|
| +
|
| +shouldBe("getComputedStyle(removed).backgroundColor", "red");
|
| +document.body.offsetTop; // force layout
|
| +
|
| +sheet.parentNode.removeChild(sheet);
|
| +
|
| +if (window.internals) {
|
| + var recalcCount = internals.updateStyleAndReturnAffectedElementCount();
|
| + var layoutCount = internals.needsLayoutCount();
|
| + shouldBe("recalcCount", "1");
|
| + shouldBe("layoutCount", "0");
|
| +}
|
| +
|
| +shouldBe("getComputedStyle(removed).backgroundColor", "green");
|
| +</script>
|
|
|