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

Unified Diff: LayoutTests/fast/dom/shadow/ancestor-first-child.html

Issue 201573003: Reset SelectorCheckingContext.elementStyle for :ancestor matching. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/ancestor-first-child-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/dom/shadow/ancestor-first-child.html
diff --git a/LayoutTests/fast/dom/shadow/ancestor-first-child.html b/LayoutTests/fast/dom/shadow/ancestor-first-child.html
new file mode 100644
index 0000000000000000000000000000000000000000..ebccd8424d67390c09d8082e040f55a85d76ecff
--- /dev/null
+++ b/LayoutTests/fast/dom/shadow/ancestor-first-child.html
@@ -0,0 +1,32 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<script src="resources/shadow-dom.js"></script>
+
+<div id="test">
+ <div id="first"></div>
+</div>
+
+<script>
+description("Test that :ancestor(:first-child) is re-evaluated when :first-child changes.");
+
+var test = document.getElementById("test");
+var first = document.getElementById("first");
+
+first.appendChild(
+ createDOM("div", {"id": "host"},
+ createShadowRoot(
+ createDOM('style', {},
+ document.createTextNode(":ancestor(#first:first-child) { background-color: red; }")),
+ createDOM('div', {},
+ document.createTextNode("You should see no red.")))));
+
+document.body.offsetTop; // Force style recalc.
+
+var red = "rgb(255, 0, 0)";
+
+shouldBe("getComputedStyle(first.firstChild, null).backgroundColor", "red");
+
+test.insertBefore(document.createElement("div"), first);
+
+shouldNotBe("getComputedStyle(first.firstChild, null).backgroundColor", "red");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/dom/shadow/ancestor-first-child-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698