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

Unified Diff: LayoutTests/fast/css/invalidation/link-pseudo.html

Issue 540533004: Use style invalidation for more pseudo classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 3 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
Index: LayoutTests/fast/css/invalidation/link-pseudo.html
diff --git a/LayoutTests/fast/css/invalidation/link-pseudo.html b/LayoutTests/fast/css/invalidation/link-pseudo.html
new file mode 100644
index 0000000000000000000000000000000000000000..c2f609fb4ea1247bedafbf3c025d5c46413ebf8f
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/link-pseudo.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<script>
+if (window.testRunner)
+ testRunner.keepWebHistory();
+</script>
+<style>
+:link, :visited { all: initial }
+#match { background-color: red }
+:link #match { background-color: green }
+#link + div { color: pink }
+</style>
+<a id="link">
+ <span></span>
+ <span>
+ <span></span>
+ <span id="match"></span>
+ </span>
+</a>
+<div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+</div>
+<script>
+description("Use descendant invalidation set for :link pseudo class.")
+
+var red = "rgb(255, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+if (window.internals)
+ shouldBe("internals.computedStyleIncludingVisitedInfo(match).backgroundColor", "red");
+
+link.offsetTop; // Force recalc.
+link.href = "not-visited.html";
+
+if (window.internals) {
+ // Ideally, the affected element count should be 2, but there is a _insideLink that
+ // causes inheritance to recalc all elements inside <a>.
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "5");
+ shouldBe("internals.computedStyleIncludingVisitedInfo(match).backgroundColor", "green");
+}
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698