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

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

Issue 889803003: Use style invalidation for :-webkit-any-link. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 11 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/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>
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/any-link-pseudo-expected.txt » ('j') | Source/core/html/HTMLAnchorElement.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698