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

Unified Diff: LayoutTests/fast/css/style-scoped/style-scoped-scoping-nodes-different-order.html

Issue 317143002: Revert of Remove scoped styles. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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/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>
+

Powered by Google App Engine
This is Rietveld 408576698