Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(89)

Unified Diff: LayoutTests/fast/events/autoscroll-in-overflow-hidden-html.html

Issue 23450017: Scrolling allowed when overflow:hidden (seen on Acid2) (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Scrolling allowed when overflow:hidden (seen on Acid2) Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/events/autoscroll-in-overflow-hidden-html-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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>
« no previous file with comments | « no previous file | LayoutTests/fast/events/autoscroll-in-overflow-hidden-html-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698