OLD | NEW |
1 <script src="../../../resources/js-test.js"></script> | 1 <script src="../../../resources/js-test.js"></script> |
2 <style> | 2 <style> |
3 body { | 3 body { |
4 font: 16px Ahem; | 4 font: 16px Ahem; |
5 } | 5 } |
6 | 6 |
7 #base { | 7 #base { |
8 width: 300px; | 8 width: 300px; |
9 height: 100px; | 9 height: 100px; |
10 } | 10 } |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 document.documentElement.appendChild(bbox); | 126 document.documentElement.appendChild(bbox); |
127 } | 127 } |
128 | 128 |
129 var fail = undefined; | 129 var fail = undefined; |
130 | 130 |
131 var expectedResults = [ | 131 var expectedResults = [ |
132 /*1*/ { left: 8, top: 40, width: 300, height: 100 }, | 132 /*1*/ { left: 8, top: 40, width: 300, height: 100 }, |
133 /*2*/ { left: 8, top: 188, width: 320, height: 120 }, | 133 /*2*/ { left: 8, top: 188, width: 320, height: 120 }, |
134 /*3*/ { left: 18, top: 356, width: 300, height: 100 }, | 134 /*3*/ { left: 18, top: 356, width: 300, height: 100 }, |
135 /*4*/ { left: 37.289, top: 483.289, width: 141.421, height: 141.421 }, | 135 /*4*/ { left: 37.289, top: 483.289, width: 141.421, height: 141.421 }, |
136 /*5*/ { left: 8, top: 652, width: 300, height: 374 }, | 136 /*5*/ { left: 8, top: 652, width: 300, height: 368 }, |
137 /*6*/ { left: fail, top: fail, width: fail, height: fail }, | 137 /*6*/ { left: fail, top: fail, width: fail, height: fail }, |
138 /*7*/ { left: 8, top: 1490, width: 288, height: 464 }, | 138 /*7*/ { left: 8, top: 1484, width: 288, height: 464 }, |
139 /*8*/ { left: 8, top: 2002, width: 300, height: 74 }, | 139 /*8*/ { left: 8, top: 1996, width: 300, height: 74 }, |
140 /*9*/ { left: 8, top: 2140, width: 300, height: 90 }, | 140 /*9*/ { left: 8, top: 2134, width: 300, height: 90 }, |
141 /*10*/ { left: 8, top: 2280, width: 300, height: 34 }, | 141 /*10*/ { left: 8, top: 2274, width: 300, height: 34 }, |
142 /*11*/ { left: 10, top: 2402, width: 147, height: 34 }, | 142 /*11*/ { left: 10, top: 2396, width: 147, height: 34 }, |
143 /*12*/ { left: 8, top: 2538, width: 100, height: 100 }, | 143 /*12*/ { left: 8, top: 2532, width: 100, height: 100 }, |
144 /*13*/ { left: 8, top: 2789, width: 260, height: 16 }, | 144 /*13*/ { left: 8, top: 2783, width: 260, height: 16 }, |
145 /*14*/ { left: 8, top: 2869, width: 300, height: 232 }, | 145 /*14*/ { left: 8, top: 2863, width: 300, height: 232 }, |
146 /*15*/ { left: 8, top: 3165, width: 0, height: 0 } | 146 /*15*/ { left: 8, top: 3159, width: 0, height: 0 } |
147 ]; | 147 ]; |
148 | 148 |
149 function test(number, element) | 149 function test(number, element) |
150 { | 150 { |
151 debug("Test " + number); | 151 debug("Test " + number); |
152 | 152 |
153 if (element.className.match("knownFailure")) { | 153 if (element.className.match("knownFailure")) { |
154 debug("Known failure. Skipping."); | 154 debug("Known failure. Skipping."); |
155 debug(""); | 155 debug(""); |
156 return; | 156 return; |
157 } | 157 } |
158 | 158 |
159 var boundingRect = element.getBoundingClientRect(); | 159 var boundingRect = element.getBoundingClientRect(); |
160 addBBoxOverClientRect(boundingRect); | 160 addBBoxOverClientRect(boundingRect); |
161 testClientRect(boundingRect, expectedResults[number - 1]); | 161 testClientRect(boundingRect, expectedResults[number - 1]); |
162 } | 162 } |
163 | 163 |
164 var tests = document.getElementsByClassName("testBox"); | 164 var tests = document.getElementsByClassName("testBox"); |
165 for (var i = 0; i < tests.length; ++i) | 165 for (var i = 0; i < tests.length; ++i) |
166 test(i + 1, tests[i]); | 166 test(i + 1, tests[i]); |
167 | 167 |
168 if (window.testRunner) { | 168 if (window.testRunner) { |
169 var area = document.getElementById('testArea'); | 169 var area = document.getElementById('testArea'); |
170 area.parentNode.removeChild(area); | 170 area.parentNode.removeChild(area); |
171 } | 171 } |
172 </script> | 172 </script> |
OLD | NEW |