Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / invalidation / target-pseudo.html
blob25afebae85e15c00879624f2497dd41b833e834f
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <style>
4 :target #match { background-color: green }
5 #target + div { color: pink }
6 </style>
7 <div id="target">
8 <div></div>
9 <div></div>
10 <div>
11 <div></div>
12 <div id="match"></div>
13 </div>
14 <div></div>
15 </div>
16 <div>
17 <div></div>
18 <div></div>
19 <div></div>
20 <div></div>
21 </div>
22 <script>
23 description("Use descendant invalidation set for :target pseudo class.")
25 var transparent = "rgba(0, 0, 0, 0)";
26 var green = "rgb(0, 128, 0)";
28 shouldBe("getComputedStyle(match, '').backgroundColor", "transparent");
30 target.offsetTop; // Force recalc.
32 document.location.hash = "#target";
34 // Should have checked that internals.updateStyleAndReturnAffectedElementCount()
35 // equals 2 here, but the target style is updated synchronously from where the
36 // target is set.
38 shouldBe("getComputedStyle(match, '').backgroundColor", "green");
39 </script>