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

Unified Diff: LayoutTests/fast/dom/shadow/content-combinator-with-shadow-all.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-with-shadow-all.html
diff --git a/LayoutTests/fast/dom/shadow/content-pseudo-element-with-hat.html b/LayoutTests/fast/dom/shadow/content-combinator-with-shadow-all.html
similarity index 73%
rename from LayoutTests/fast/dom/shadow/content-pseudo-element-with-hat.html
rename to LayoutTests/fast/dom/shadow/content-combinator-with-shadow-all.html
index 052d1bfb67e81c04fa8d59eeeb96c6bc68512aa1..58f1f51bace898482ecbeeb592a80a3be6941c71 100644
--- a/LayoutTests/fast/dom/shadow/content-pseudo-element-with-hat.html
+++ b/LayoutTests/fast/dom/shadow/content-combinator-with-shadow-all.html
@@ -9,10 +9,15 @@
<pre id="console"></pre>
</body>
<script>
-description("Test for ::content with /shadow-all/ and :host.");
+description("Test for /content/ with /shadow-all/ and :host.");
var sandbox = document.getElementById('sandbox');
+function colorOf(selector)
+{
+ return document.defaultView.getComputedStyle(document.querySelector(selector), null).getPropertyValue('color');
+}
+
function cleanUp()
{
sandbox.innerHTML = '';
@@ -23,7 +28,7 @@ sandbox.appendChild(
createShadowRoot(
createDOM('style', {},
document.createTextNode(
- ':host(#host1) /shadow-all/ #content1::content > .content { color: green; }')),
+ ':host(#host1) /shadow-all/ #content1 /content/ .content { color: green; }')),
createDOM('div', {},
createDOM('div', {'id': 'host2'},
createShadowRoot(
@@ -33,7 +38,7 @@ sandbox.appendChild(
createDOM('div', {'class': 'content'},
document.createTextNode('content'))));
-shouldBe('window.getComputedStyle(document.querySelector("#host1 > .content")).color', '"rgb(0, 128, 0)"');
+shouldBe('colorOf("#host1 > .content")', '"rgb(0, 128, 0)"');
cleanUp();
@@ -42,7 +47,7 @@ sandbox.appendChild(
createShadowRoot(
createDOM('style', {},
document.createTextNode(
- '#host2 /shadow-all/ #content2::content > #parentOfContent1 > #content1::content > .content { color: green; }')),
+ '#host2 /shadow-all/ #content2 /content/ #parentOfContent1 > #content1 /content/ .content { color: green; }')),
createDOM('div', {},
createDOM('div', {'id': 'host2'},
createShadowRoot(
@@ -52,7 +57,7 @@ sandbox.appendChild(
createDOM('div', {'class': 'content'},
document.createTextNode('content'))));
-shouldBe('window.getComputedStyle(document.querySelector("#host1 > .content")).color', '"rgb(0, 128, 0)"');
+shouldBe('colorOf("#host1 > .content")', '"rgb(0, 128, 0)"');
cleanUp();
@@ -61,7 +66,7 @@ sandbox.appendChild(
createShadowRoot(
createDOM('style', {},
document.createTextNode(
- ':host /shadow-all/ #content2::content > #shadow1::content > #content1::content > .content { color: red; }')),
+ ':host /shadow-all/ #content2 /content/ #shadow1 /content/ #content1 /content/ .content { color: red; }')),
createDOM('content', {'id': 'content1'})),
createShadowRoot(
createDOM('div', {},
@@ -73,7 +78,7 @@ sandbox.appendChild(
createDOM('div', {'class': 'content'},
document.createTextNode('content'))));
-shouldNotBe('window.getComputedStyle(document.querySelector("#host1 > .content")).color', '"rgb(255, 0, 0)"');
+shouldNotBe('colorOf("#host1 > .content")', '"rgb(255, 0, 0)"');
cleanUp();
@@ -82,7 +87,7 @@ sandbox.appendChild(
createShadowRoot(
createDOM('style', {},
document.createTextNode(
- ':host /shadow-all/ #content2::content > #parentOfContent1 > #content1::content > .content { color: red; }')),
+ ':host /shadow-all/ #content2 /content/ #parentOfContent1 > #content1 /content/ .content { color: red; }')),
createDOM('div', {},
createDOM('div', {'id': 'host2'},
createShadowRoot(
@@ -92,7 +97,7 @@ sandbox.appendChild(
createDOM('div', {'class': 'content'},
document.createTextNode('content'))));
-shouldNotBe('window.getComputedStyle(document.querySelector("#host1 > .content")).color', '"rgb(255, 0, 0)"');
+shouldNotBe('colorOf("#host1 > .content")', '"rgb(255, 0, 0)"');
cleanUp();

Powered by Google App Engine
This is Rietveld 408576698