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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/host-context-class-change-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/shadow/host-context-class-change.html
diff --git a/LayoutTests/fast/dom/shadow/host-context-class-change.html b/LayoutTests/fast/dom/shadow/host-context-class-change.html
new file mode 100644
index 0000000000000000000000000000000000000000..869bc89555ae3d6d023c163cf3f9593071e81782
--- /dev/null
+++ b/LayoutTests/fast/dom/shadow/host-context-class-change.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<script src="resources/shadow-dom.js"></script>
+<style>
+</style>
+<div id="sandbox"></div>
+<script>
+description("Class change affecting a node in a distributed node's subtree.");
+
+var sandbox = document.getElementById('sandbox');
+
+sandbox.appendChild(
+ createDOM('parent-element', {},
+ createShadowRoot(
+ createDOM('div', {'id': 'a'},
+ createDOM('content', {}))),
+ createDOM('child-element', {},
+ createShadowRoot(
+ createDOM('style', {},
+ document.createTextNode(':host-context(.a) .b { background-color: green; }')),
+ createDOM('div', {},
+ createDOM('div', {'class': 'b'}))))));
+
+var transparent = "rgba(0, 0, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+document.body.offsetTop; // force recalc
+
+var a = sandbox.querySelector("parent-element").shadowRoot.querySelector("#a");
+var b = sandbox.querySelector("child-element").shadowRoot.querySelector(".b");
+
+shouldBe("getComputedStyle(b, null).backgroundColor", "transparent");
+
+a.className = "a";
+document.body.offsetTop; // force recalc.
+
+shouldBe("getComputedStyle(b, null).backgroundColor", "green");
+</script>
« 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