OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <html> |
3 <body> | 3 <body> |
4 <div style="width: 1000px; height: 1000px; position: absolute; top: 0; left:
0;"></div> | 4 <div style="width: 1000px; height: 1000px; position: absolute; top: 0; left:
0;"></div> |
5 <div style="width: 100px; height: 100px; position: absolute; top: 100px; lef
t: 0; background: green"></div> | 5 <div style="width: 100px; height: 100px; position: absolute; top: 100px; lef
t: 0; background: green"></div> |
6 <p> | 6 <p> |
7 Test for <i><a href="rdar://problem/6643103">rdar://problem/6643103</a> | 7 Test for <i><a href="rdar://problem/6643103">rdar://problem/6643103</a> |
8 Unscaled values from body.scrollHeight</i>. | 8 Unscaled values from body.scrollHeight</i>. |
9 </p> | 9 </p> |
10 <script src="../../resources/js-test.js"></script> | 10 <script src="../../resources/js-test.js"></script> |
11 <script> | 11 <script> |
12 setPrintTestResultsLazily(); | 12 setPrintTestResultsLazily(); |
13 | 13 |
14 var floatPrecision = 0.00001; | 14 var floatPrecision = 0.00001; |
15 function checkValue(actual, expected) | 15 function checkValue(actual, expected) |
16 { | 16 { |
17 if (window.eventSender) { | 17 if (window.eventSender) { |
18 shouldBeCloseTo(actual, expected, floatPrecision); | 18 shouldBeCloseTo(actual, expected, floatPrecision); |
19 } | 19 } |
20 } | 20 } |
21 | 21 |
22 if (window.testRunner) { | 22 if (window.testRunner) { |
23 testRunner.dumpAsText(); | 23 testRunner.dumpAsText(); |
24 checkValue('document.scrollingElement.scrollHeight', 1000) | 24 checkValue('document.scrollingElement.scrollHeight', 1000) |
25 checkValue('document.scrollingElement.scrollWidth', 1000); | 25 checkValue('document.scrollingElement.scrollWidth', 1000); |
26 | 26 |
27 // Scrolling right to 50. | 27 // Scrolling right to 40. |
28 document.scrollingElement.scrollLeft = 50; | 28 document.scrollingElement.scrollLeft = 40; |
29 checkValue('document.scrollingElement.scrollLeft', 50); | 29 checkValue('document.scrollingElement.scrollLeft', 40); |
30 | 30 |
31 // Zooming in. | 31 // Zooming in. |
32 eventSender.zoomPageIn(); | 32 eventSender.zoomPageIn(); |
33 checkValue('document.scrollingElement.scrollHeight', 1000); | 33 checkValue('document.scrollingElement.scrollHeight', 1000); |
34 checkValue('document.scrollingElement.scrollWidth', 1000); | 34 checkValue('document.scrollingElement.scrollWidth', 1000); |
35 checkValue('document.scrollingElement.scrollTop', 0); | 35 checkValue('document.scrollingElement.scrollTop', 0); |
36 checkValue('document.scrollingElement.scrollLeft', 50); | 36 checkValue('document.scrollingElement.scrollLeft', 40); |
37 | 37 |
38 // Scrolling down to 100. | 38 // Scrolling down to 100. |
39 document.scrollingElement.scrollTop = 100; | 39 document.scrollingElement.scrollTop = 100; |
40 checkValue('document.scrollingElement.scrollTop', 100); | 40 checkValue('document.scrollingElement.scrollTop', 100); |
41 | 41 |
42 // Zooming back out. | 42 // Zooming back out. |
43 eventSender.zoomPageOut(); | 43 eventSender.zoomPageOut(); |
44 checkValue('document.scrollingElement.scrollTop', 100); | 44 checkValue('document.scrollingElement.scrollTop', 100); |
45 checkValue('document.scrollingElement.scrollLeft', 50); | 45 checkValue('document.scrollingElement.scrollLeft', 40); |
46 } | 46 } |
47 </script> | 47 </script> |
48 </body> | 48 </body> |
49 </html> | 49 </html> |
OLD | NEW |