Index: third_party/WebKit/LayoutTests/fast/css/stylerule-set-selectortext-ns.html |
diff --git a/third_party/WebKit/LayoutTests/fast/css/stylerule-set-selectortext-ns.html b/third_party/WebKit/LayoutTests/fast/css/stylerule-set-selectortext-ns.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..baf0b8e588f8d00c3c939d15ebe091eddb22471f |
--- /dev/null |
+++ b/third_party/WebKit/LayoutTests/fast/css/stylerule-set-selectortext-ns.html |
@@ -0,0 +1,20 @@ |
+<!DOCTYPE html> |
+<script src="../../resources/js-test.js"></script> |
+<style id="testsheet"> |
+ p { color: green } |
+ .nomatch { color: red } |
+</style> |
+<p>This text should be green</p> |
+<script> |
+description("Should not be allowed to set selectorText with unknown namespace"); |
+ |
+var green = "rgb(0, 128, 0)"; |
+var p = document.querySelector("p"); |
+var sheet = document.querySelector("#testsheet").sheet; |
+shouldBe("getComputedStyle(p).color", "green"); |
+ |
+sheet.cssRules[1].selectorText = "bogus|p"; |
+ |
+shouldBeEqualToString("sheet.cssRules[1].selectorText", ".nomatch"); |
+shouldBe("getComputedStyle(p).color", "green"); |
+</script> |