OLD | NEW |
1 <!DOCTYPE html> | 1 <!DOCTYPE html> |
2 <script src="../../../resources/testharness.js"></script> | 2 <script src="../../../resources/testharness.js"></script> |
3 <script src="../../../resources/testharnessreport.js"></script> | 3 <script src="../../../resources/testharnessreport.js"></script> |
4 <style> | 4 <style> |
5 .t1 .sibling + *, | 5 .t1 .sibling + *, |
6 .t2 .sibling ~ *, | 6 .t2 .sibling ~ *, |
7 .t3 .sibling + :hover, | 7 .t3 .sibling + :hover, |
8 .t4 + .sibling, | 8 .t4 + .sibling, |
9 .t5 + *, | 9 .t5 + *, |
10 .t6 ~ .sibling, | 10 .t6 ~ .sibling, |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 document.body.offsetTop; | 83 document.body.offsetTop; |
84 | 84 |
85 test(function() { | 85 test(function() { |
86 assert_true(!!window.internals, "This test only works with internals exposed
present"); | 86 assert_true(!!window.internals, "This test only works with internals exposed
present"); |
87 }, "internals are exposed"); | 87 }, "internals are exposed"); |
88 | 88 |
89 test(function() { | 89 test(function() { |
90 assert_equals(getComputedStyle(r1).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 90 assert_equals(getComputedStyle(r1).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
91 | 91 |
92 t1.className = "t1"; | 92 t1.className = "t1"; |
93 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt
ree style recalc"); | 93 assert_equals(internals.updateStyleAndLayoutAndReturnAffectedElementCount(),
3, "Subtree style recalc"); |
94 assert_equals(getComputedStyle(r1).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 94 assert_equals(getComputedStyle(r1).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
95 }, "Adjacent with universal selector"); | 95 }, "Adjacent with universal selector"); |
96 | 96 |
97 test(function() { | 97 test(function() { |
98 assert_equals(getComputedStyle(r2).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 98 assert_equals(getComputedStyle(r2).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
99 | 99 |
100 t2.className = "t2"; | 100 t2.className = "t2"; |
101 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 4, "Subt
ree style recalc"); | 101 assert_equals(internals.updateStyleAndLayoutAndReturnAffectedElementCount(),
4, "Subtree style recalc"); |
102 assert_equals(getComputedStyle(r2).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 102 assert_equals(getComputedStyle(r2).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
103 }, "Indirect adjacent with universal selector"); | 103 }, "Indirect adjacent with universal selector"); |
104 | 104 |
105 test(function() { | 105 test(function() { |
106 assert_true(!!window.eventSender, "This test only works with eventSender pre
sent"); | 106 assert_true(!!window.eventSender, "This test only works with eventSender pre
sent"); |
107 | 107 |
108 eventSender.mouseMoveTo(r3.offsetLeft + 1, r3.offsetTop + 1); | 108 eventSender.mouseMoveTo(r3.offsetLeft + 1, r3.offsetTop + 1); |
109 assert_equals(getComputedStyle(r3).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 109 assert_equals(getComputedStyle(r3).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
110 | 110 |
111 t3.className = "t3"; | 111 t3.className = "t3"; |
112 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 3, "Subt
ree style recalc"); | 112 assert_equals(internals.updateStyleAndLayoutAndReturnAffectedElementCount(),
3, "Subtree style recalc"); |
113 assert_equals(getComputedStyle(r3).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 113 assert_equals(getComputedStyle(r3).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
114 }, "Adjacent with universal :hover selector"); | 114 }, "Adjacent with universal :hover selector"); |
115 | 115 |
116 test(function() { | 116 test(function() { |
117 assert_equals(getComputedStyle(r4).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 117 assert_equals(getComputedStyle(r4).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
118 | 118 |
119 t4.className = "t4"; | 119 t4.className = "t4"; |
120 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Subt
ree style recalc"); | 120 assert_equals(internals.updateStyleAndLayoutAndReturnAffectedElementCount(),
1, "Subtree style recalc"); |
121 assert_equals(getComputedStyle(r4).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 121 assert_equals(getComputedStyle(r4).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
122 }, "Class change affecting selector for sibling class"); | 122 }, "Class change affecting selector for sibling class"); |
123 | 123 |
124 test(function() { | 124 test(function() { |
125 assert_equals(getComputedStyle(r5).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 125 assert_equals(getComputedStyle(r5).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
126 | 126 |
127 t5.className = "t5"; | 127 t5.className = "t5"; |
128 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Subt
ree style recalc"); | 128 assert_equals(internals.updateStyleAndLayoutAndReturnAffectedElementCount(),
1, "Subtree style recalc"); |
129 assert_equals(getComputedStyle(r5).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 129 assert_equals(getComputedStyle(r5).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
130 }, "Class change affecting all sibling subtrees through a universal selector"); | 130 }, "Class change affecting all sibling subtrees through a universal selector"); |
131 | 131 |
132 test(function() { | 132 test(function() { |
133 assert_equals(getComputedStyle(r6).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 133 assert_equals(getComputedStyle(r6).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
134 | 134 |
135 t6.className = "t6"; | 135 t6.className = "t6"; |
136 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 1, "Subt
ree style recalc"); | 136 assert_equals(internals.updateStyleAndLayoutAndReturnAffectedElementCount(),
1, "Subtree style recalc"); |
137 assert_equals(getComputedStyle(r6).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 137 assert_equals(getComputedStyle(r6).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
138 }, "Class change affecting all sibling subtrees through an indirect adjacent com
binator"); | 138 }, "Class change affecting all sibling subtrees through an indirect adjacent com
binator"); |
139 | 139 |
140 test(function() { | 140 test(function() { |
141 assert_equals(getComputedStyle(r7).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 141 assert_equals(getComputedStyle(r7).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
142 | 142 |
143 t7.className = "t7"; | 143 t7.className = "t7"; |
144 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subt
ree style recalc"); | 144 assert_equals(internals.updateStyleAndLayoutAndReturnAffectedElementCount(),
2, "Subtree style recalc"); |
145 assert_equals(getComputedStyle(r7).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 145 assert_equals(getComputedStyle(r7).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
146 }, "Class change affecting sibling descendants through a universal selector"); | 146 }, "Class change affecting sibling descendants through a universal selector"); |
147 | 147 |
148 test(function() { | 148 test(function() { |
149 assert_equals(getComputedStyle(r8).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); | 149 assert_equals(getComputedStyle(r8).backgroundColor, "rgba(0, 0, 0, 0)", "Bac
kground color should initially be transparent"); |
150 | 150 |
151 t8.className = "t8"; | 151 t8.className = "t8"; |
152 assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subt
ree style recalc"); | 152 assert_equals(internals.updateStyleAndLayoutAndReturnAffectedElementCount(),
2, "Subtree style recalc"); |
153 assert_equals(getComputedStyle(r8).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); | 153 assert_equals(getComputedStyle(r8).backgroundColor, "rgb(0, 128, 0)", "Backg
round color is green after class change"); |
154 }, "Class change affecting universal descendants of webkit-any sibling"); | 154 }, "Class change affecting universal descendants of webkit-any sibling"); |
155 | 155 |
156 </script> | 156 </script> |
OLD | NEW |