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

Unified Diff: LayoutTests/fast/dom/shadow/content-combinator-scoped.html

Issue 187353003: Implement /content/ combinator. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Patch for landing Created 6 years, 9 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/content-combinator-scoped.html
diff --git a/LayoutTests/fast/dom/shadow/content-combinator-scoped.html b/LayoutTests/fast/dom/shadow/content-combinator-scoped.html
new file mode 100644
index 0000000000000000000000000000000000000000..7574386b5884f0e3ce9ee0a1a1b1a075899c5ee6
--- /dev/null
+++ b/LayoutTests/fast/dom/shadow/content-combinator-scoped.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html>
+<head>
+<script src="resources/shadow-dom.js"></script>
+<script src="../../../resources/js-test.js"></script>
+</head>
+<body>
+ <div id="sandbox"></div>
+ <pre id="console"></pre>
+<script>
+
+function colorOf(node)
+{
+ return document.defaultView.getComputedStyle(node, null).getPropertyValue('color');
+}
+
+function cleanUp()
+{
+ document.getElementById('sandbox').innerHTML = '';
+}
+
+var sandbox = document.getElementById('sandbox');
+sandbox.appendChild(
+ createDOM('div', {'id': 'host'},
+ createShadowRoot(
+ createDOM('content', {'select': '#host-child1'}),
+ createDOM('div', {},
+ createDOM('content', {'select': '#host-child2'}),
+ createDOM('style', {'scoped': 'scoped'},
+ document.createTextNode('content /content/ div { color: green; }')))),
+ createDOM('div', {'id': 'host-child1'},
+ document.createTextNode('normal')),
+ createDOM('div', {'id': 'host-child2'},
+ document.createTextNode('green'))));
+
+shouldNotBe('colorOf(document.querySelector("#host > div#host-child1"))', '"rgb(0, 128, 0)"');
+shouldBe('colorOf(document.querySelector("#host > div#host-child2"))', '"rgb(0, 128, 0)"');
+
+cleanUp();
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698