test_bug1062406.html (1262B)
1 <!DOCTYPE HTML> 2 <html> 3 <!-- 4 https://bugzilla.mozilla.org/show_bug.cgi?id=1062406 5 --> 6 <head> 7 <title>Test for Bug 1062406</title> 8 <script src="/tests/SimpleTest/SimpleTest.js"></script> 9 <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/> 10 </head> 11 <body> 12 <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=1062406">Mozilla Bug 1062406</a> 13 <div id="content" style="display: none"> 14 15 </div> 16 <div style="width:10000px; height:10000px"></div> 17 <pre id="test"> 18 <script type="application/javascript"> 19 20 /** Test for Bug 1062406 */ 21 window.scroll(100, 100); 22 window.scroll(NaN, NaN); 23 is(window.scrollX, 0, "window.scroll x parameter must treat NaN as 0."); 24 is(window.scrollY, 0, "window.scroll y parameter must treat NaN as 0."); 25 26 window.scroll(100, 100); 27 window.scroll(Infinity, Infinity); 28 is(window.scrollX, 0, "window.scroll x parameter must treat Infinity as 0."); 29 is(window.scrollY, 0, "window.scroll y parameter must treat Infinity as 0."); 30 31 window.scroll(100, 100); 32 window.scroll(-Infinity, -Infinity); 33 is(window.scrollX, 0, "window.scroll x parameter must treat -Infinity as 0."); 34 is(window.scrollY, 0, "window.scroll y parameter must treat -Infinity as 0."); 35 36 </script> 37 </pre> 38 </body> 39 </html>