OLD | NEW |
(Empty) | |
| 1 <!DOCTYPE html> |
| 2 <html> |
| 3 <head> |
| 4 <style> |
| 5 #test { |
| 6 width: 300px; |
| 7 height: 300px; |
| 8 overflow: auto; |
| 9 border: 1px solid silver; |
| 10 } |
| 11 #test > article { |
| 12 width: 1000px; |
| 13 height: 1000px; |
| 14 position: relative; |
| 15 } |
| 16 #top-left { |
| 17 position: absolute; |
| 18 top: 0; |
| 19 left: 0; |
| 20 } |
| 21 #bottom-right { |
| 22 position: absolute; |
| 23 bottom: 0; |
| 24 right: 0; |
| 25 } |
| 26 </style> |
| 27 <script src="../../resources/js-test.js"></script> |
| 28 </head> |
| 29 <body> |
| 30 <section id="test"> |
| 31 <article> |
| 32 <span id="top-left">top left</span> |
| 33 <span id="bottom-right">bottom right</span> |
| 34 </article> |
| 35 </section> |
| 36 <p> |
| 37 Tests that large scrollLeft/Top values aren't being ignored. |
| 38 </p> |
| 39 <script> |
| 40 var el = document.getElementById('test'); |
| 41 el.scrollLeft = 100000000; |
| 42 el.scrollTop = 100000000; |
| 43 |
| 44 var expectedScrollLeft = el.firstElementChild.offsetWidth - |
| 45 el.clientWidth; |
| 46 if (el.scrollLeft == expectedScrollLeft) { |
| 47 testPassed('Setting el.scrollLeft = 100000000 scrolls all ' + |
| 48 'the way to the right.'); |
| 49 } else { |
| 50 testFailed('Setting el.scrollLeft = 100000000 scrolls to ' + |
| 51 el.scrollLeft + ', expected ' + expectedScrollLeft + '.'); |
| 52 } |
| 53 |
| 54 var expectedScrollTop = el.firstElementChild.offsetHeight - |
| 55 el.clientHeight; |
| 56 if (el.scrollTop == expectedScrollTop) { |
| 57 testPassed('Setting el.scrollTop = 100000000 scrolls all ' + |
| 58 'the way to the bottom.'); |
| 59 } else { |
| 60 testFailed('Setting el.scrollTop = 100000000 scrolls to ' + |
| 61 el.scrollTop + ', expected ' + expectedScrollTop + '.'); |
| 62 } |
| 63 </script> |
| 64 </body> |
| 65 </html> |
OLD | NEW |