| <script src="../../resources/basic-gestures.js"></script> |
| <script src="../../resources/ui-helper.js"></script> |
| testRunner.waitUntilDone(); |
| if (!testRunner.runUIScript) |
| await UIHelper.activateElementAndWaitForInputSession(document.getElementById('editable')); |
| await UIHelper.enterText("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTest"); |
| var firstPageOffset = window.pageYOffset; |
| if (window.pageYOffset > 0) |
| output += 'PASS: page has scrolled when caret is behind software keyboard.'; |
| output += 'FAIL: page has failed to scroll when caret is behind software keyboard.'; |
| await UIHelper.enterText("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nTest"); |
| if (window.pageYOffset > 0 && window.pageYOffset > firstPageOffset) |
| output += 'PASS: page has continuted to scroll when caret is beyond the edge of the screen.'; |
| output += 'FAIL: page has failed to scroll when caret is beyond the edge of the screen.'; |
| document.getElementById('editable').innerHTML = output; |
| window.addEventListener('load', runTest, false); |
| background-color: silver; |
| This test presses return until the cursor would be behind the keyboard, |
| forcing the content to be scrolled to stay in view with a software keyboard on screen. |
| <div id="editable" contenteditable> |