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

Side by Side Diff: LayoutTests/fast/css/invalidation/link-pseudo.html

Issue 540533004: Use style invalidation for more pseudo classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 3 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 unified diff | Download patch
OLDNEW
(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>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698