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

Unified Diff: LayoutTests/fast/css/namespaces/insert-namespace-with-same-prefix.xhtml

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/namespaces/insert-namespace-with-same-prefix.xhtml
diff --git a/LayoutTests/fast/css/namespaces/insert-namespace-with-same-prefix.xhtml b/LayoutTests/fast/css/namespaces/insert-namespace-with-same-prefix.xhtml
new file mode 100644
index 0000000000000000000000000000000000000000..09969ebedff2c9200ea920ec4feb09cc28419d25
--- /dev/null
+++ b/LayoutTests/fast/css/namespaces/insert-namespace-with-same-prefix.xhtml
@@ -0,0 +1,26 @@
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<style>
+@namespace myprefix url(banana);
+</style>
+<div id="target1" xmlns="banana"></div>
+<div id="target2" xmlns="apple"></div>
+<div id="target3" xmlns="mango"></div>
+
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+
+<script>
+test(function(){
+ var styleSheet = document.styleSheets[0];
+ styleSheet.insertRule('@namespace myprefix url("mango");', styleSheet.cssRules.length);
+ styleSheet.insertRule('@namespace myprefix url("apple");', 0);
+ styleSheet.insertRule('div { background-color: red; }', styleSheet.cssRules.length);
+ styleSheet.insertRule('myprefix|div { background-color: green; }', styleSheet.cssRules.length);
+
+ assert_equals(getComputedStyle(document.getElementById('target1')).backgroundColor, 'rgb(255, 0, 0)');
+ assert_equals(getComputedStyle(document.getElementById('target2')).backgroundColor, 'rgb(0, 128, 0)');
+ assert_equals(getComputedStyle(document.getElementById('target3')).backgroundColor, 'rgb(255, 0, 0)');
+}, "If namespace prefix is declated more than once only the last declaration should be used");
+</script>
+</html>
« no previous file with comments | « LayoutTests/fast/css/css-namespace-rule-expected.txt ('k') | LayoutTests/fast/dom/css-mediarule-functions.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698