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

Unified Diff: LayoutTests/fast/css/css-namespace-rule.html

Issue 1321943002: Support for CSSOM CSSNamespaceRule interface (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated as per review comments Created 5 years, 3 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
Index: LayoutTests/fast/css/css-namespace-rule.html
diff --git a/LayoutTests/fast/css/css-namespace-rule.html b/LayoutTests/fast/css/css-namespace-rule.html
new file mode 100644
index 0000000000000000000000000000000000000000..1f7f08d1972f97cc6b36efcd5f66effde9aa2832
--- /dev/null
+++ b/LayoutTests/fast/css/css-namespace-rule.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<script src="../../resources/js-test.js"></script>
+<style id="style1">
+@namespace url(default);
+@namespace my-namespace url(http://www.w3.org/1999/xhtml);
+body {
+ color:black;
+}
+my-namespace|body {
+ color:red;
+}
+</style>
+Here is some text!
+<script>
+description('Check the basic attribute support of CSSOM CSSNamespaceRule');
+
+shouldBe('CSSRule.NAMESPACE_RULE','10');
+var styleSheet = document.getElementById("style1").sheet;
+var defaultNamespacerule = styleSheet.cssRules[0];
+var namespacerule = styleSheet.cssRules[1];
+shouldBe('namespacerule.type','10');
+shouldBeEqualToString('namespacerule.namespaceURI','http://www.w3.org/1999/xhtml');
+shouldBeEqualToString('namespacerule.prefix','my-namespace');
+shouldBeEqualToString('defaultNamespacerule.cssText', '@namespace url("default");');
+shouldBeEqualToString('namespacerule.cssText', '@namespace my-namespace url("http://www.w3.org/1999/xhtml");');
+shouldBeEqualToString('getComputedStyle(document.body).color', 'rgb(255, 0, 0)');
+
+debug("Deleting namespace rule when other rules are present should throw InvalidStateException.");
+try {
+ styleSheet.deleteRule(namespacerule);
+} catch (e) {
+ shouldBe(e.code, '11');
+}
+
+debug("Inserting new namespace rule when other rules are present should throw InvalidStateException.");
+try {
+ styleSheet.insertRule("@namespace new-namespace url('test-namespace');", styleSheet.cssRules.length);
+} catch (e) {
+ shouldBe(e.code, '11');
+}
+
+</script>
« no previous file with comments | « LayoutTests/cssom/insertrule-namespace-mapping.html ('k') | LayoutTests/fast/css/css-namespace-rule-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698