OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <script src="../../../resources/js-test.js"></script> |
| 3 <script> |
| 4 if (window.testRunner) |
| 5 testRunner.keepWebHistory(); |
| 6 </script> |
| 7 <style> |
| 8 :link, :visited { all: initial } |
| 9 #match { background-color: red } |
| 10 :link #match { background-color: green } |
| 11 #link + div { color: pink } |
| 12 </style> |
| 13 <a id="link"> |
| 14 <span></span> |
| 15 <span> |
| 16 <span></span> |
| 17 <span id="match"></span> |
| 18 </span> |
| 19 </a> |
| 20 <div> |
| 21 <div></div> |
| 22 <div></div> |
| 23 <div></div> |
| 24 <div></div> |
| 25 </div> |
| 26 <script> |
| 27 description("Use descendant invalidation set for :link pseudo class.") |
| 28 |
| 29 var red = "rgb(255, 0, 0)"; |
| 30 var green = "rgb(0, 128, 0)"; |
| 31 |
| 32 if (window.internals) |
| 33 shouldBe("internals.computedStyleIncludingVisitedInfo(match).backgroundColor
", "red"); |
| 34 |
| 35 link.offsetTop; // Force recalc. |
| 36 link.href = "not-visited.html"; |
| 37 |
| 38 if (window.internals) { |
| 39 // Ideally, the affected element count should be 2, but there is a _insideLi
nk that |
| 40 // causes inheritance to recalc all elements inside <a>. |
| 41 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "5"); |
| 42 shouldBe("internals.computedStyleIncludingVisitedInfo(match).backgroundColor
", "green"); |
| 43 } |
| 44 |
| 45 </script> |
OLD | NEW |