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

Side by Side Diff: LayoutTests/fast/forms/setrangetext-out-of-range.html

Issue 764313004: Fix the problem to keep the selection when clicking the substring out of range (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 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 <script src="../../resources/js-test.js"></script>
3 <script>
4 description("This tests the selection of the text field when mouse event occ urs out of range");
5 window.onload = function() {
yosin_UTC9 2014/12/03 01:07:00 nit: Please add |jsTestIsAsync = true| and call |T
Miyoung Shin(g) 2014/12/03 03:39:10 Ok, I will update to use |jsTestIsAsync = true| an
6 runTest();
7 }
8 function runTest() {
9 var textfield = document.getElementById('textfield');
10 textfield.addEventListener('focus', setSelectionRange);
11 textfield.setSelectionRange(0, 1);
12 var tx = textfield.offsetLeft + textfield.offsetWidth - 4;
13 var ty = textfield.offsetTop + 4;
14
15 if (window.eventSender) {
16 eventSender.mouseMoveTo(tx, ty);
yosin_UTC9 2014/12/03 01:06:59 nit: Please use four spaces indentation.
Miyoung Shin(g) 2014/12/03 03:39:10 OK. I will update
17 eventSender.mouseDown();
18 eventSender.mouseUp();
19 shouldBeZero('textfield.selectionStart');
20 shouldBe('textfield.selectionEnd', '5');
21
22 eventSender.mouseMoveTo(textfield.offsetLeft, ty + 30);
23 eventSender.mouseDown();
24 eventSender.mouseUp();
25 debug('\nthe selection should be cleared');
26 shouldBeZero('textfield.selectionStart');
27 shouldBeZero('textfield.selectionEnd');
28 }
29 }
30
31 function setSelectionRange(e) {
32 var textfield = document.getElementById('textfield');
33 textfield.setSelectionRange(0, 5);
34 }
35 </script>
36 <input type="text" value="valueeeeeeeeeeeeeeeeeeeeeeeeeeee" id="textfield"></inp ut>
yosin_UTC9 2014/12/03 01:07:00 nit: It is better to use different characters rath
Miyoung Shin(g) 2014/12/03 03:39:10 OK. I will update
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/forms/setrangetext-out-of-range-expected.txt » ('j') | Source/core/page/EventHandler.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698