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

Side by Side Diff: LayoutTests/fast/dom/shadow/host-context-class-change.html

Issue 317953002: :host-context selectors may affect insertion point descendants. (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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/host-context-class-change-expected.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <script src="resources/shadow-dom.js"></script>
4 <style>
5 </style>
6 <div id="sandbox"></div>
7 <script>
8 description("Class change affecting a node in a distributed node's subtree.");
9
10 var sandbox = document.getElementById('sandbox');
11
12 sandbox.appendChild(
13 createDOM('parent-element', {},
14 createShadowRoot(
15 createDOM('div', {'id': 'a'},
16 createDOM('content', {}))),
17 createDOM('child-element', {},
18 createShadowRoot(
19 createDOM('style', {},
20 document.createTextNode(':host-context(.a) .b { background-c olor: green; }')),
21 createDOM('div', {},
22 createDOM('div', {'class': 'b'}))))));
23
24 var transparent = "rgba(0, 0, 0, 0)";
25 var green = "rgb(0, 128, 0)";
26
27 document.body.offsetTop; // force recalc
28
29 var a = sandbox.querySelector("parent-element").shadowRoot.querySelector("#a");
30 var b = sandbox.querySelector("child-element").shadowRoot.querySelector(".b");
31
32 shouldBe("getComputedStyle(b, null).backgroundColor", "transparent");
33
34 a.className = "a";
35 document.body.offsetTop; // force recalc.
36
37 shouldBe("getComputedStyle(b, null).backgroundColor", "green");
38 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/host-context-class-change-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698