| <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN"> |
| <html> |
| <head> |
| <script src="../../resources/accessibility-helper.js"></script> |
| <script src="../../resources/js-test.js"></script> |
| </head> |
| <body> |
| |
| <div id="group" style="overflow: scroll; width:100px; height:100px;"> |
| test test test test <br> |
| test test test test <br> |
| test test test test <br> |
| test test test test <br> |
| test test test test <br> |
| test test test test <br> |
| test test test test <br> |
| test test test test <br> |
| test test test test <br> |
| <button id="button">button</button> |
| </div> |
| |
| <script> |
| var output = "This tests that the scrollToMakeVisible accessibility action works as expected on the Mac.\n\n"; |
| |
| if (window.accessibilityController) { |
| window.jsTestIsAsync = true; |
| |
| var button = accessibilityController.accessibleElementById("button"); |
| var initialButtonX = button.x; |
| var initialButtonY = button.y; |
| |
| output += "Gathered initial button position and now scrolling to make it visible.\n"; |
| button.scrollToMakeVisible(); |
| |
| var newButtonX, newButtonY; |
| setTimeout(async function() { |
| await waitFor(() => button.x == initialButtonX && button.y > initialButtonY); |
| newButtonX = button.x; |
| newButtonY = button.y; |
| |
| output += "Scroll to make visible was performed. The X position should be the same, but the Y position should have changed.\n"; |
| output += expect("newButtonX == initialButtonX", "true"); |
| output += expect("newButtonY > initialButtonY", "true"); |
| |
| document.getElementById("group").style.visibility = "hidden"; |
| |
| debug(output); |
| finishJSTest(); |
| }, 0); |
| } |
| </script> |
| </body> |
| </html> |
| |