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

Unified Diff: LayoutTests/fast/dom/shadow/multiple-content-combinator.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/multiple-content-combinator.html
diff --git a/LayoutTests/fast/dom/shadow/multiple-content-combinator.html b/LayoutTests/fast/dom/shadow/multiple-content-combinator.html
new file mode 100644
index 0000000000000000000000000000000000000000..449e92948a71b5bf5d0b7e835fe43f13df03da7d
--- /dev/null
+++ b/LayoutTests/fast/dom/shadow/multiple-content-combinator.html
@@ -0,0 +1,49 @@
+<!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 = '';
+}
+
+// This is the same test as content-pseudo-element-nested.html did.
+// i.e. nested ::content => multiple /content/.
+var sandbox = document.getElementById('sandbox');
+sandbox.appendChild(
+ createDOM('div', {'id': 'host'},
+ createShadowRoot(
+ createDOM('div', {'id': 'nested-host'},
+ createShadowRoot(
+ createDOM('style', {},
+ document.createTextNode('div content /content/ div content /content/ div.green { color: green; }')),
+ document.createTextNode('text1'),
+ createDOM('div', {},
+ document.createTextNode('text2'),
+ createDOM('content', {'select': 'div'}))),
+ createDOM('div', {'class': 'green'},
+ document.createTextNode('text3'),
+ createDOM('content', {})))),
+ createDOM('div', {'class': 'green'},
+ document.createTextNode('green')),
+ createDOM('div', {},
+ document.createTextNode('normal'))));
+
+shouldBe('colorOf(document.querySelector("#host > div.green"))', '"rgb(0, 128, 0)"');
+
+cleanUp();
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698