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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/invalidation/slotted.html

Issue 1717703002: Use invalidation sets to invalidate slotted elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed expected text Created 4 years, 10 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 | third_party/WebKit/LayoutTests/fast/css/invalidation/slotted-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/invalidation/slotted.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/invalidation/slotted.html b/third_party/WebKit/LayoutTests/fast/css/invalidation/slotted.html
new file mode 100644
index 0000000000000000000000000000000000000000..8c781aa3cb2d39ac7c237ca66ed59312b4861bf1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/invalidation/slotted.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<div id="host">
+ <div>
+ <span></span>
+ <span></span>
+ </div>
+ <div id="slotted">
+ <span></span>
+ <span></span>
+ </div>
+ <div>
+ <span></span>
+ <span></span>
+ </div>
+</host>
+<script>
+description("Style invalidation of slotted elements.");
+
+var root = host.attachShadow({"mode":"open"});
+root.innerHTML = '<style>.outer ::slotted(#slotted) { background-color: red } .outer .inner::slotted(#slotted) { background-color: green }</style><div id="outer"><slot id="inner"></slot></div>';
+
+shouldBeEqualToString("getComputedStyle(slotted).backgroundColor", "rgba(0, 0, 0, 0)");
+
+host.offsetTop; // force recalc
+
+root.querySelector("#outer").className = "outer";
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+shouldBeEqualToString("getComputedStyle(slotted).backgroundColor", "rgb(255, 0, 0)");
+
+host.offsetTop; // force recalc
+
+root.querySelector("#inner").className = "inner";
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+shouldBeEqualToString("getComputedStyle(slotted).backgroundColor", "rgb(0, 128, 0)");
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/invalidation/slotted-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698