Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / invalidation / no-invalidation-set-local-style.html
blob75f15727eda5e840899cdae17d0dcfb302f79044
1 <!DOCTYPE html>
2 <script src="../../../resources/js-test.js"></script>
3 <style>
4 #t1 div + .test { background-color: green }
5 #t2 div ~ .test { background-color: green }
6 #t3 :not(.nomatch) .test { background-color: green }
7 </style>
8 <div id="t1">
9 <div></div>
10 <div>
11 <span></span>
12 <span></span>
13 <span></span>
14 <span></span>
15 </div>
16 </div>
17 <div id="t2">
18 <div></div>
19 <span></span>
20 <div>
21 <span></span>
22 <span></span>
23 <span></span>
24 <span></span>
25 </div>
26 </div>
27 <div id="t3">
28 <div>
29 <div>
30 <span></span>
31 <span></span>
32 <span></span>
33 <span></span>
34 </div>
35 </div>
36 </div>
37 <script>
38 description("Class selectors in rightmost compound selector should cause LocalStyleChange even if we cannot use invalidation sets.");
40 var tests = [
41 [ "#t1 > div + div", 1 ],
42 [ "#t2 > div ~ div", 1 ],
43 [ "#t3 > div > div", 1 ]
46 var green = 'rgb(0, 128, 0)';
48 for (var i=0; i<tests.length; i++) {
49 var test = tests[i];
50 var elm = document.querySelector(test[0]);
51 document.body.offsetLeft;
52 elm.className = "test";
53 if (window.internals)
54 shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "" + test[1]);
55 shouldBe("getComputedStyle(elm, null).backgroundColor", "green");
57 </script>