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

Side by Side Diff: third_party/WebKit/LayoutTests/editing/input/textcontrol-doubleclick-at-end.html

Issue 1478573002: Double-clicking whitespace after value text should select the last word in INPUT/TEXTAREA. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <body>
3 <script src="../../resources/testharness.js"></script>
4 <script src="../../resources/testharnessreport.js"></script>
5 <div id="log"></div>
6 <input value="foo" style="border:0; padding:0;" placeholder="input">
7 <textarea style="border:0; padding:0;" placeholder="textarea">foo</textarea>
8 <script>
9 test(function() {
10 var input = document.querySelector('input');
11 input.focus();
12 input.selectionStart = 0;
13 input.selectionEnd = 0;
14 eventSender.mouseMoveTo(input.offsetLeft + input.offsetWidth - 10, input.off setTop + 4);
15 eventSender.mouseDown();
16 eventSender.mouseUp();
17 eventSender.mouseDown();
18 eventSender.mouseUp();
19 assert_equals(input.selectionStart, 0);
20 assert_equals(input.selectionEnd, 3);
21 }, 'Double-clicking whitespace after the value in an INPUT element should select the last word.');
22
23 test(function() {
24 var textarea = document.querySelector('textarea');
25 textarea.focus();
26 textarea.selectionStart = 0;
27 textarea.selectionEnd = 0;
28 eventSender.mouseMoveTo(textarea.offsetLeft + textarea.offsetWidth - 10, tex tarea.offsetTop + 4);
29 eventSender.mouseDown();
30 eventSender.mouseUp();
31 eventSender.mouseDown();
32 eventSender.mouseUp();
33 assert_equals(textarea.selectionStart, 0);
34 assert_equals(textarea.selectionEnd, 3);
35 }, 'Double-clicking whitespace after the value in a TEXTAREA element should sele ct the last word.');
36 </script>
37 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698