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

Unified 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, 1 month 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
Index: third_party/WebKit/LayoutTests/editing/input/textcontrol-doubleclick-at-end.html
diff --git a/third_party/WebKit/LayoutTests/editing/input/textcontrol-doubleclick-at-end.html b/third_party/WebKit/LayoutTests/editing/input/textcontrol-doubleclick-at-end.html
new file mode 100644
index 0000000000000000000000000000000000000000..ac3e9ca6df7cb31dbbc24502fa7614d810cb90ff
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/editing/input/textcontrol-doubleclick-at-end.html
@@ -0,0 +1,37 @@
+<!DOCTYPE html>
+<body>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+<div id="log"></div>
+<input value="foo" style="border:0; padding:0;" placeholder="input">
+<textarea style="border:0; padding:0;" placeholder="textarea">foo</textarea>
+<script>
+test(function() {
+ var input = document.querySelector('input');
+ input.focus();
+ input.selectionStart = 0;
+ input.selectionEnd = 0;
+ eventSender.mouseMoveTo(input.offsetLeft + input.offsetWidth - 10, input.offsetTop + 4);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ assert_equals(input.selectionStart, 0);
+ assert_equals(input.selectionEnd, 3);
+}, 'Double-clicking whitespace after the value in an INPUT element should select the last word.');
+
+test(function() {
+ var textarea = document.querySelector('textarea');
+ textarea.focus();
+ textarea.selectionStart = 0;
+ textarea.selectionEnd = 0;
+ eventSender.mouseMoveTo(textarea.offsetLeft + textarea.offsetWidth - 10, textarea.offsetTop + 4);
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ eventSender.mouseDown();
+ eventSender.mouseUp();
+ assert_equals(textarea.selectionStart, 0);
+ assert_equals(textarea.selectionEnd, 3);
+}, 'Double-clicking whitespace after the value in a TEXTAREA element should select the last word.');
+</script>
+</body>

Powered by Google App Engine
This is Rietveld 408576698