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

Unified Diff: LayoutTests/fast/dom/shadow/style-scoped-not-enabled.html

Issue 315173002: 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/dom/shadow/style-scoped-not-enabled.html
diff --git a/LayoutTests/fast/dom/shadow/style-scoped-not-enabled.html b/LayoutTests/fast/dom/shadow/style-scoped-not-enabled.html
new file mode 100644
index 0000000000000000000000000000000000000000..7a8af0e022798bcadec0c100cfd0ac7501125881
--- /dev/null
+++ b/LayoutTests/fast/dom/shadow/style-scoped-not-enabled.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="../../../resources/js-test.js"></script>
+<script>
+if (window.internals)
+ window.internals.settings.setStyleScopedEnabled(false);
+</script>
+</head>
+<body>
+<div id="host"></div>
+<span id='shouldNotBeApplied'>Should not be blue</span>
+<div>
+ <style scoped> p { color: red; } </style>
+ <p id='insideScope'>Should be red</p>
+</div>
+<p id='shouldNotBeScoped'>Should be red</p>
+<script>
+description("This test ensures content element feature can be disabled");
+var host = document.getElementById("host");
+var shadow = host.createShadowRoot();
+shadow.innerHTML = "<style> span { color: blue; } </style><span id='shouldBeApplied'>Should be blue</span>";
+var shouldBeApplied = shadow.getElementById("shouldBeApplied");
+var shouldNotBeApplied = document.getElementById("shouldNotBeApplied");
+var shouldNotBeScoped = document.getElementById("shouldNotBeScoped");
+var insideScope = document.getElementById("insideScope");
+shouldBe("window.getComputedStyle(shouldBeApplied).color", "'rgb(0, 0, 255)'");
+shouldBe("window.getComputedStyle(shouldNotBeApplied).color", "'rgb(0, 0, 0)'");
+shouldBe("window.getComputedStyle(insideScope).color", "'rgb(255, 0, 0)'");
+shouldBe("window.getComputedStyle(shouldNotBeScoped).color", "'rgb(255, 0, 0)'");
+finishJSTest();
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698