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