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

Unified Diff: LayoutTests/editing/input/resources/reveal-utilities.js

Issue 10382217: Merge 117307 - Avoid jumpscroll when entering new text in a multi-line editor. (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1132/
Patch Set: Created 8 years, 7 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/editing/input/scroll-to-edge-if-line-break-at-end-of-document-contenteditable.html » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/editing/input/resources/reveal-utilities.js
===================================================================
--- LayoutTests/editing/input/resources/reveal-utilities.js (revision 117418)
+++ LayoutTests/editing/input/resources/reveal-utilities.js (working copy)
@@ -64,3 +64,27 @@
document.execCommand("paste");
}
}
+
+function performJumpAtTheEdgeTest(useCtrlKeyModifier)
+{
+ var textArea = document.getElementById("input");
+ textArea.focus();
+ if (window.eventSender) {
+ var previousScrollTop = 0, currentScrollTop = 0;
+ var jumpDetected = false;
+ for (var i = 0; i < 120; ++i) {
+ previousScrollTop = document.body.scrollTop;
+ eventSender.keyDown("\r", useCtrlKeyModifier ? ["ctrlKey"] : []);
+ currentScrollTop = document.body.scrollTop;
+ // Smooth scrolls are allowed.
+ if (Math.abs(previousScrollTop - currentScrollTop) > 24) {
+ jumpDetected = true;
+ break;
+ }
+ }
+ if (!jumpDetected)
+ document.write("PASS");
+ else
+ document.write("FAIL<br>Jump scroll from " + previousScrollTop + " to " + currentScrollTop);
+ }
+}
« no previous file with comments | « no previous file | LayoutTests/editing/input/scroll-to-edge-if-line-break-at-end-of-document-contenteditable.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698