| <!DOCTYPE html> |
| |
| <html> |
| <head> |
| <meta name="viewport" content="initial-scale=1.0"> |
| <style> |
| body { |
| margin: 0; |
| height: 2000px; |
| } |
| |
| .box { |
| height: 100px; |
| width: 100px; |
| background-color: blue; |
| } |
| |
| .outer { |
| position: absolute; |
| top: 0; |
| } |
| |
| .box:hover { |
| background-color: green; |
| } |
| |
| .container { |
| position: absolute; |
| top: 50px; |
| left: 50px; |
| height: 300px; |
| width: 300px; |
| overflow: scroll; |
| -webkit-overflow-scrolling: touch; |
| border: 1px solid black; |
| pointer-events: none; |
| box-shadow: 0 0 10px black; |
| } |
| |
| .content { |
| height: 600px; |
| } |
| </style> |
| <script src="../../../resources/js-test-pre.js"></script> |
| <script> |
| window.jsTestIsAsync = true; |
| |
| function getUIScript() |
| { |
| return ` |
| (function() { |
| uiController.dragFromPointToPoint(60, 200, 60, 100, 0.5, function() { |
| uiController.uiScriptComplete(""); |
| }); |
| })();` |
| } |
| |
| var hitElement; |
| function runTest() |
| { |
| hitElement = document.elementFromPoint(20, 20); |
| shouldBeEqualToString("hitElement.id", "under-target"); |
| |
| var scroller = document.getElementById('scroller'); |
| shouldBe("scroller.scrollTop", "0"); |
| |
| if (testRunner.runUIScript) { |
| testRunner.runUIScript(getUIScript(), function() { |
| setTimeout(function() { |
| debug("swipe complete"); |
| shouldBe("scroller.scrollTop", "0"); |
| shouldBe("document.scrollingElement.scrollTop", "90"); |
| finishJSTest(); |
| }, 0); |
| }); |
| } |
| } |
| window.addEventListener('load', runTest, false); |
| </script> |
| </head> |
| <body> |
| <div class="outer box" id="under-target"> |
| </div> |
| |
| <div id="scroller" class="container" onscroll="debug('overflow scroll')"> |
| <div class="content"> |
| Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. |
| <div class="inner box" style="visibility: visible"> |
| </div> |
| </div> |
| </div> |
| <script src="../../../resources/js-test-post.js"></script> |
| </body> |
| </html> |