| <script src="../../resources/js-test-pre.js"></script> |
| html, body { height: 100%; } |
| .tall-box { height: 100%; } |
| <div class="tall-box"></div> |
| <a id="target" href="#">target</a> |
| <div class="tall-box"></div> |
| description('This tests that scrolling to the focused element happens asynchronously.'); |
| window.onload = () => setTimeout(runTest, 0); |
| document.getElementById('target').focus(); |
| shouldBe('document.scrollingElement.scrollTop', '0'); |
| shouldBeTrue('document.scrollingElement.scrollTop > 100'); |
| setTimeout(finishJSTest, 0); |
| <script src="../../resources/js-test-post.js"></script> |