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

Unified Diff: LayoutTests/fast/css/invalidation/targeted-class-shadow-combinator.html

Issue 206513004: Support invalidation sets for shadow combinators. (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/css/invalidation/targeted-class-shadow-combinator-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/invalidation/targeted-class-shadow-combinator.html
diff --git a/LayoutTests/fast/css/invalidation/targeted-class-shadow-combinator.html b/LayoutTests/fast/css/invalidation/targeted-class-shadow-combinator.html
new file mode 100644
index 0000000000000000000000000000000000000000..a487e369e08751256de7c5e7e4c6b2b4e4fded42
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/targeted-class-shadow-combinator.html
@@ -0,0 +1,48 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+.t1 #host1 /shadow/ .match { background-color: green; }
+.t2 /shadow-deep/ .match { background-color: green; }
+</style>
+<div id="t1">
+ <div id="host1"></div>
+ <div></div>
+</div>
+<div id="t2">
+ <div id="host2"></div>
+ <div></div>
+</div>
+<script>
+description("Check that targeted class invalidation works for /shadow/ and /shadow-deep/ combinators.");
+
+// Create shadow trees
+
+var host1 = document.getElementById("host1");
+var match1 = host1.createShadowRoot().appendChild(document.createElement("div"));
+match1.className = "match";
+
+var host2 = document.getElementById("host2");
+var innerHost = host2.createShadowRoot().appendChild(document.createElement("div"));
+var match2 = innerHost.createShadowRoot().appendChild(document.createElement("div"));
+match2.className = "match";
+
+var transparent = "rgba(0, 0, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+shouldBe("getComputedStyle(match1, null).backgroundColor", "transparent");
+shouldBe("getComputedStyle(match2, null).backgroundColor", "transparent");
+
+document.body.offsetLeft; // force style recalc.
+
+document.getElementById("t1").className = "t1";
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
+shouldBe("getComputedStyle(match1, null).backgroundColor", "green");
+
+document.body.offsetLeft; // force style recalc.
+
+document.getElementById("t2").className = "t2";
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2");
+shouldBe("getComputedStyle(match2, null).backgroundColor", "green");
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/targeted-class-shadow-combinator-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698