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

Side by Side Diff: LayoutTests/fast/dom/shadow/hostcontext-first-child.html

Issue 210813003: Rename :ancestor to :host-context. (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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script> 2 <script src="../../../resources/js-test.js"></script>
3 <script src="resources/shadow-dom.js"></script> 3 <script src="resources/shadow-dom.js"></script>
4 4
5 <div id="test"> 5 <div id="test">
6 <div id="first"></div> 6 <div id="first"></div>
7 </div> 7 </div>
8 8
9 <script> 9 <script>
10 description("Test that :ancestor(:first-child) is re-evaluated when :first-child changes."); 10 description("Test that :host-context(:first-child) is re-evaluated when :first-c hild changes.");
11 11
12 var test = document.getElementById("test"); 12 var test = document.getElementById("test");
13 var first = document.getElementById("first"); 13 var first = document.getElementById("first");
14 14
15 first.appendChild( 15 first.appendChild(
16 createDOM("div", {"id": "host"}, 16 createDOM("div", {"id": "host"},
17 createShadowRoot( 17 createShadowRoot(
18 createDOM('style', {}, 18 createDOM('style', {},
19 document.createTextNode(":ancestor(#first:first-child) { backgro und-color: red; }")), 19 document.createTextNode(":host-context(#first:first-child) { bac kground-color: red; }")),
20 createDOM('div', {}, 20 createDOM('div', {},
21 document.createTextNode("You should see no red."))))); 21 document.createTextNode("You should see no red.")))));
22 22
23 document.body.offsetTop; // Force style recalc. 23 document.body.offsetTop; // Force style recalc.
24 24
25 var red = "rgb(255, 0, 0)"; 25 var red = "rgb(255, 0, 0)";
26 26
27 shouldBe("getComputedStyle(first.firstChild, null).backgroundColor", "red"); 27 shouldBe("getComputedStyle(first.firstChild, null).backgroundColor", "red");
28 28
29 test.insertBefore(document.createElement("div"), first); 29 test.insertBefore(document.createElement("div"), first);
30 30
31 shouldNotBe("getComputedStyle(first.firstChild, null).backgroundColor", "red"); 31 shouldNotBe("getComputedStyle(first.firstChild, null).backgroundColor", "red");
32 </script> 32 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698