Index: LayoutTests/fast/css/style-scoped/style-scoped-scoping-nodes-different-order.html |
diff --git a/LayoutTests/fast/css/style-scoped/style-scoped-scoping-nodes-different-order.html b/LayoutTests/fast/css/style-scoped/style-scoped-scoping-nodes-different-order.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..712ddb640a1c2494515751e49882ae1a16dfb352 |
--- /dev/null |
+++ b/LayoutTests/fast/css/style-scoped/style-scoped-scoping-nodes-different-order.html |
@@ -0,0 +1,42 @@ |
+<!doctype html> |
+<html> |
+<head> |
+<script src="../../../resources/js-test.js"></script> |
+</head> |
+<body> |
+ <div id="insert"></div> |
+ <div> |
+ <div> |
+ <style scoped> |
+ span { |
+ color: grey; |
+ } |
+ </style> |
+ <span id="target"></span> |
+ </div> |
+ <style scoped> |
+ span { |
+ border: 1px solid green; |
+ } |
+ </style> |
+ </div> |
+ <pre id='console'></pre> |
+ <script> |
+ var style = document.createElement('style'); |
+ style.innerHTML = 'span { color: green; }'; |
+ document.getElementById('insert').appendChild(style); |
+ |
+ function borderColor(id) { |
+ return getComputedStyle(document.getElementById(id)).borderColor; |
+ } |
+ |
+ description('Test a case whether order of scoping nodes is different from order of style elements.'); |
+ shouldBe('document.styleSheets.length', '4'); |
+ shouldBe('document.styleSheets[1].cssRules[0].cssText', '"span { color: green; }"'); |
+ shouldBe('document.styleSheets[2].cssRules[0].cssText', '"span { color: grey; }"'); |
+ shouldBe('document.styleSheets[3].cssRules[0].cssText', '"span { border: 1px solid green; }"'); |
+ shouldBe('borderColor("target")', '"rgb(0, 128, 0)"'); |
+ </script> |
+</body> |
+</html> |
+ |