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

Side by Side Diff: LayoutTests/editing/input/caret-at-the-edge-of-contenteditable.html

Issue 9969106: Revert 103073 - Scroll non-visible edit controls and caret into the center of the view when startin… (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1084/
Patch Set: Created 8 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | LayoutTests/editing/input/caret-at-the-edge-of-input.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <head>
3 </head>
4 <body>
5 <div>When the caret reaches the edge of the input box or content editable div, o n the next input if must jump to the center of the control.</div>
6 <span style="position:absolute; visibility:hidden" id="single-digit">0</span>
7 <div style="border:thin solid black; white-space:nowrap; overflow:hidden" conten teditable="true" id="input-contenteditable">012345678901234567890123456789</div>
8 <script>
9
10 var contentEditable = document.getElementById("input-contenteditable");
11 var singleDigitWidth = document.getElementById("single-digit").clientWidth;
12 var contentEditableSize = 10;
13 contentEditable.style.width = (singleDigitWidth * contentEditableSize) + "px";
14 contentEditable.focus();
15 // Move the caret to the beginning of the input.
16 getSelection().collapse(contentEditable.firstChild, 0);
17 var editableContent = contentEditable.textContent;
18 if (window.eventSender) {
19 for (var i = 0; i < contentEditableSize * 1.2; ++i)
20 eventSender.keyDown(editableContent[i]);
21 }
22
23 </script>
24 </body>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/editing/input/caret-at-the-edge-of-input.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698