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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/access-namespace-rule-after-delete-rule.html

Issue 2459843002: Copy m_namespaceRules when copying StyleSheetContents to avoid crashing. (Closed)
Patch Set: Rename test, move comment Created 4 years, 1 month 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/StyleRule.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/access-namespace-rule-after-delete-rule.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/access-namespace-rule-after-delete-rule.html b/third_party/WebKit/LayoutTests/fast/css/access-namespace-rule-after-delete-rule.html
new file mode 100644
index 0000000000000000000000000000000000000000..edc3e1ec20a35d5b074cda362fc9bf82abcac0da
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/access-namespace-rule-after-delete-rule.html
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<style>@namespace a "a"; div { }</style>
+<style>@namespace a "a"; div { }</style>
+
+<script>
+
+test(function() {
+ document.styleSheets[0].deleteRule(1);
+ assert_equals(document.styleSheets[0].cssRules.length, 1);
+ var rule = document.styleSheets[0].cssRules[0];
+ assert_equals(rule.type, CSSRule.NAMESPACE_RULE);
+ assert_equals(rule.namespaceURI, 'a');
+
+ // The other stylesheet should not be affected.
+ assert_equals(document.styleSheets[1].cssRules.length, 2);
+ var rule1 = document.styleSheets[1].cssRules[0];
+ assert_equals(rule1.type, CSSRule.NAMESPACE_RULE);
+ assert_equals(rule1.namespaceURI, 'a');
+ var rule2 = document.styleSheets[1].cssRules[1];
+ assert_equals(rule2.type, CSSRule.STYLE_RULE);
+ assert_equals(rule2.selectorText, 'div');
+}, 'Access namespace rule after deleting child rule');
+
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/StyleRule.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698