Index: LayoutTests/fast/css/invalidation/any-link-pseudo.html |
diff --git a/LayoutTests/fast/css/invalidation/any-link-pseudo.html b/LayoutTests/fast/css/invalidation/any-link-pseudo.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..b9daa2e5e309533da11d4e4341b421d1048339a3 |
--- /dev/null |
+++ b/LayoutTests/fast/css/invalidation/any-link-pseudo.html |
@@ -0,0 +1,30 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/js-test.js"></script> |
+<style> |
+#link { background-color: red } |
+#link:-webkit-any-link { background-color: green } |
+#link + div { color: pink } |
+</style> |
+<a id="link">This link should have a green background.</a> |
+<div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+</div> |
+<script> |
+description("Use descendant invalidation set for :-webkit-any-link pseudo class.") |
+ |
+var red = "rgb(255, 0, 0)"; |
+var green = "rgb(0, 128, 0)"; |
+ |
+shouldBe("getComputedStyle(link).backgroundColor", "red"); |
+ |
+link.offsetTop; // Force recalc. |
+link.href = "not-visited.html"; |
+ |
+if (window.internals) |
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
+ |
+shouldBe("getComputedStyle(link).backgroundColor", "green"); |
+</script> |