2 <script src=
"../../../resources/js-test.js"></script>
5 testRunner
.keepWebHistory();
8 :link, :visited { all: initial }
9 #match { background-color: red }
10 :link #match { background-color: green }
11 #link + div { color: pink }
17 <span id=
"match"></span>
27 description("Use descendant invalidation set for :link pseudo class.")
29 var red
= "rgb(255, 0, 0)";
30 var green
= "rgb(0, 128, 0)";
33 shouldBe("internals.computedStyleIncludingVisitedInfo(match).backgroundColor", "red");
35 link
.offsetTop
; // Force recalc.
36 link
.href
= "not-visited.html";
38 if (window
.internals
) {
39 // Ideally, the affected element count should be 2, but there is a _insideLink that
40 // causes inheritance to recalc all elements inside <a>.
41 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "5");
42 shouldBe("internals.computedStyleIncludingVisitedInfo(match).backgroundColor", "green");