Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / invalidation / any-link-pseudo.html
blobb9daa2e5e309533da11d4e4341b421d1048339a3
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <style>
4 #link { background-color: red }
5 #link:-webkit-any-link { background-color: green }
6 #link + div { color: pink }
7 </style>
8 <a id="link">This link should have a green background.</a>
9 <div>
10 <div></div>
11 <div></div>
12 <div></div>
13 <div></div>
14 </div>
15 <script>
16 description("Use descendant invalidation set for :-webkit-any-link pseudo class.")
18 var red = "rgb(255, 0, 0)";
19 var green = "rgb(0, 128, 0)";
21 shouldBe("getComputedStyle(link).backgroundColor", "red");
23 link.offsetTop; // Force recalc.
24 link.href = "not-visited.html";
26 if (window.internals)
27 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1");
29 shouldBe("getComputedStyle(link).backgroundColor", "green");
30 </script>