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

Unified Diff: LayoutTests/fast/css/invalidation/visited-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/visited-pseudo.html
diff --git a/LayoutTests/fast/css/invalidation/visited-pseudo.html b/LayoutTests/fast/css/invalidation/visited-pseudo.html
new file mode 100644
index 0000000000000000000000000000000000000000..8c3af566c8e54eae72006b53d68b6081564c44de
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/visited-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 }
+:visited #match { background-color: green }
+#visited + div { color: pink }
+</style>
+<a id="visited">
+ <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 :visited pseudo class.")
+
+var red = "rgb(255, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+if (window.internals)
+ shouldBe("internals.computedStyleIncludingVisitedInfo(match).backgroundColor", "red");
+
+visited.offsetTop; // Force recalc.
+visited.href = "";
+
+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