Index: LayoutTests/fast/events/autoscroll-in-overflow-hidden-html.html |
diff --git a/LayoutTests/fast/events/autoscroll-in-overflow-hidden-html.html b/LayoutTests/fast/events/autoscroll-in-overflow-hidden-html.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..bb92f63955c99800abc53bd3e20b4032afdc5bfb |
--- /dev/null |
+++ b/LayoutTests/fast/events/autoscroll-in-overflow-hidden-html.html |
@@ -0,0 +1,77 @@ |
+<html> |
+ <head> |
+ <script src="../js/resources/js-test-pre.js"></script> |
+ <script> |
+ function log(msg) |
+ { |
+ document.getElementById('console').appendChild(document.createTextNode(msg + '\n')); |
+ } |
+ |
+ var iframe; |
+ var iframeDocument; |
+ var iframeScrollTopAfterAnchor = 0; |
+ |
+ function test() |
+ { |
+ if (window.testRunner) { |
+ testRunner.waitUntilDone(); |
+ testRunner.dumpAsText(); |
+ } |
+ |
+ iframe = document.getElementById('NoScrolliFrame'); |
+ iframeDocument = iframe.contentDocument; |
+ iframeScrollTopAfterAnchor = 0; |
+ |
+ var clickme = iframeDocument.getElementById('clickme'); |
+ var x = iframe.offsetLeft + clickme.offsetLeft + 7; |
+ var y = iframe.offsetTop + clickme.offsetTop + 7; |
+ if (window.eventSender) { |
+ eventSender.dragMode = false; |
+ eventSender.mouseMoveTo(x, y); |
+ eventSender.mouseDown(); |
+ eventSender.mouseUp(); |
+ } |
+ setTimeout(autoscrollTestPart1, 0); |
+ } |
+ |
+ function autoscrollTestPart1() |
+ { |
+ iframeScrollTopAfterAnchor = iframeDocument.body.scrollTop; |
+ if (iframeDocument.body.scrollTop == 0) |
+ log("FAILED: anchor clicking within non-scrollable inner frame failed."); |
+ |
+ if (window.eventSender) { |
+ var textInIframe = iframeDocument.getElementById('textInFrame'); |
+ var x = iframe.offsetLeft + textInIframe.offsetLeft - iframeDocument.body.scrollLeft + 7; |
+ var y = iframe.offsetTop + textInIframe.offsetTop - iframeDocument.body.scrollTop + 7; |
+ eventSender.dragMode = false; |
+ eventSender.mouseMoveTo(x, y); |
+ eventSender.mouseDown(); |
+ eventSender.mouseMoveTo(x, y - 10); |
+ y = iframe.offsetTop; |
+ eventSender.mouseMoveTo(x, y - 5); |
+ } |
+ setTimeout(autoscrollTestPart2, 100); |
+ } |
+ |
+ function autoscrollTestPart2() |
+ { |
+ if (window.eventSender) |
+ eventSender.mouseUp(); |
+ |
+ log("Document whose HTML or BODY tags have overflow:hidden should not autoscroll."); |
+ if (iframeScrollTopAfterAnchor == iframeDocument.body.scrollTop) |
+ log("PASSED: the autoscroll has not happened."); |
+ else |
+ log("FAILED: the autoscroll has happened."); |
+ |
+ if (window.testRunner) |
+ testRunner.notifyDone(); |
+ } |
+ </script> |
+ </head> |
+<body onload="test()"> |
+ <iframe id="NoScrolliFrame" style="height: 150px; width: 150px" src="resources/big-page-with-overflow-hidden-and-anchor-scroll.html" ></iframe> |
+ <div id="console"></div> |
+</body> |
+</html> |