Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / css / invalidation / webkit-any-universal.html
blob5e39ab0d2520485b222f8b14e07f7d898a217cf9
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <style>
5 .t1 :-webkit-any(*, .dummy),
6 .t2 :-webkit-any(:-webkit-any(.dummy, *), .dummy),
7 .t3 :-webkit-any(:focus, dummy) { background-color: rgb(0, 128, 0); }
9 #r3 { width: 10px; height: 10px }
10 </style>
11 <div id="t1">
12 <div id="r1"></div>
13 </div>
14 <div id="t2">
15 <div id="r2"></div>
16 </div>
17 <div id="t3">
18 <div id="r3" tabIndex="1"></div>
19 </div>
20 <script>
21 document.body.offsetTop;
23 test(function() {
24 assert_true(!!window.internals, "This test only works with internals exposed present");
25 }, "internals are exposed");
27 test(function() {
28 assert_equals(getComputedStyle(r1).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
30 t1.className = "t1";
31 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subtree style recalc");
32 assert_equals(getComputedStyle(r1).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change");
33 }, ":-webkit-any() with universal selector");
35 test(function() {
36 assert_equals(getComputedStyle(r2).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
38 t2.className = "t2";
39 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subtree style recalc");
40 assert_equals(getComputedStyle(r2).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change");
41 }, "Nested :-webkit-any() with universal selector");
43 test(function() {
44 r3.focus();
45 assert_equals(getComputedStyle(r3).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
47 t3.className = "t3";
48 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subtree style recalc");
49 assert_equals(getComputedStyle(r3).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change");
50 }, ":-webkit-any() with universal :focus selector");
51 </script>