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