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

Unified Diff: LayoutTests/fast/css/invalidation/targeted-class-content-pseudo.html

Issue 652223002: Support style invalidation for ::content. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missing removal of PseudoContent case when moving. Created 6 years, 2 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-content-pseudo-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-content-pseudo.html
diff --git a/LayoutTests/fast/css/invalidation/targeted-class-content-pseudo.html b/LayoutTests/fast/css/invalidation/targeted-class-content-pseudo.html
new file mode 100644
index 0000000000000000000000000000000000000000..779658bede554fe1c552063d0dab622aa309e114
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/targeted-class-content-pseudo.html
@@ -0,0 +1,66 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<div id="host1">
+ <div id="r1">
+ <div></div>
+ <div></div>
+ </div>
+ <div></div>
+ <div></div>
+</div>
+<div id="host2">
+ <div>
+ <div id="r2"></div>
+ </div>
+ <div></div>
+</div>
+<div id="host3">
+ <div id="r3"></div>
+</div>
+<script>
+description("Check that targeted class invalidation works for ::content selectors.");
+
+// Create shadow trees
+
+host1.createShadowRoot().innerHTML = '<style>.c1::content #r1 { background-color: green }</style><content id="i1"></content>';
+host2.createShadowRoot().innerHTML = '<style>.c2 ::content #r2 { background-color: green }</style><div id="i2"><div><content></content></div><div></div><div></div></div>';
+host3.createShadowRoot().innerHTML = '<style>.c3::content * { background-color: green }</style><content id="i3"></content>';
+
+var transparent = "rgba(0, 0, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+
+shouldBe("getComputedStyle(r1, null).backgroundColor", "transparent");
+
+document.body.offsetTop; // Force style recalc.
+var i1 = host1.shadowRoot.getElementById("i1");
+i1.className = "c1";
+
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "5");
+
+shouldBe("getComputedStyle(r1, null).backgroundColor", "green");
+
+shouldBe("getComputedStyle(r2, null).backgroundColor", "transparent");
+
+document.body.offsetTop; // Force style recalc.
+var i2 = host2.shadowRoot.getElementById("i2");
+i2.className = "c2";
+
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "4");
+
+shouldBe("getComputedStyle(r2, null).backgroundColor", "green");
+
+shouldBe("getComputedStyle(r3, null).backgroundColor", "transparent");
+
+document.body.offsetTop; // Force style recalc.
+var i3 = host3.shadowRoot.getElementById("i3");
+i3.className = "c3";
+
+if (window.internals)
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
+
+shouldBe("getComputedStyle(r3, null).backgroundColor", "green");
+
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/targeted-class-content-pseudo-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698