| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <link rel="stylesheet" href="../../../fast/js/resources/js-test-style.css"> | |
| 4 <script src="../../../fast/js/resources/js-test-pre.js"></script> | |
| 5 </head> | |
| 6 <body> | |
| 7 | |
| 8 <p id="description"></p> | |
| 9 | |
| 10 <div style="border: 1px solid #000; height: 5000px;">5000-pixel box</div> | |
| 11 <button id="target" style="height: 5000px;">Target</button> | |
| 12 | |
| 13 <div id="console"></div> | |
| 14 | |
| 15 <script> | |
| 16 description("Tests that scrolling to make a certain region within an element vis
ible successfully scrolls the main window."); | |
| 17 | |
| 18 function runTest() { | |
| 19 var target = document.getElementById("target"); | |
| 20 | |
| 21 if (window.accessibilityController) { | |
| 22 target.focus(); | |
| 23 var targetAccessibleObject = accessibilityController.focusedElement; | |
| 24 } | |
| 25 | |
| 26 // Reset the initial scroll position (since calling focus() can scroll the p
age too). | |
| 27 window.scrollTo(0, 0); | |
| 28 shouldBe("window.pageYOffset", "0"); | |
| 29 | |
| 30 // Scroll to make the midpoint of the target visible and check. | |
| 31 if (window.accessibilityController) | |
| 32 targetAccessibleObject.scrollToMakeVisibleWithSubFocus(0, 2500, 100, 260
0); | |
| 33 window.minYOffset = target.offsetTop + 2500 - window.innerHeight; | |
| 34 window.maxYOffset = target.offsetTop + 2500; | |
| 35 shouldBe("window.pageYOffset >= minYOffset", "true"); | |
| 36 shouldBe("window.pageYOffset <= maxYOffset", "true"); | |
| 37 | |
| 38 finishJSTest(); | |
| 39 } | |
| 40 | |
| 41 runTest(); | |
| 42 | |
| 43 </script> | |
| 44 | |
| 45 <script src="../../../fast/js/resources/js-test-post.js"></script> | |
| 46 </body> | |
| 47 </html> | |
| OLD | NEW |