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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/null-ruleset-non-matching-media-crash.html

Issue 2650743002: Return ActiveSheetsChanged when rulesets change in common prefix. (Closed)
Patch Set: Documentation and more descriptive variable name. Created 3 years, 11 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 | third_party/WebKit/Source/core/css/ActiveStyleSheets.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/null-ruleset-non-matching-media-crash.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/null-ruleset-non-matching-media-crash.html b/third_party/WebKit/LayoutTests/fast/css/null-ruleset-non-matching-media-crash.html
new file mode 100644
index 0000000000000000000000000000000000000000..e5663feda5693a9cc931908a738281631bf19d3a
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/null-ruleset-non-matching-media-crash.html
@@ -0,0 +1,22 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<style>#t1 { color: red }</style>
+<div id="t1">Should be green.</div>
+<script>
+ test(() => {
+ // Triggers synch active stylesheet update.
+ var sheet = document.styleSheets[0];
+ // Clears the previous RuleSet for rebuild.
+ sheet.insertRule("#dummy {}", 0);
+ // No Ruleset recreated since media does not match.
+ sheet.media.mediaText = "nomatch";
+ var newStyle = document.createElement("style");
+ newStyle.appendChild(document.createTextNode("div { color: green }"));
+ // New sheet triggers active stylesheet update and style recalc for #t1.
+ document.head.appendChild(newStyle);
+ }, "Check that appending a stylesheet while clearing the RuleSet of an existing sheet does not crash");
+
+ test(() => assert_equals(getComputedStyle(t1).color, "rgb(0, 128, 0)"),
+ "Check that the #t1 rule no longer applies.");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/ActiveStyleSheets.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698