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> |