Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(120)

Unified Diff: LayoutTests/fast/css/remove-sheet-no-layout.html

Issue 1076163002: Don't clear FontFaceCache if no @font-face were removed. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/css/remove-sheet-no-layout-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/fast/css/remove-sheet-no-layout-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698