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

Side by Side Diff: LayoutTests/fast/events/touch/gesture/gesture-tap-input-after-composition.html

Issue 1049233003: Keep the selection of the text field when changed by JS. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 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
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../../resources/js-test.js"></script>
3 <input id="input1" type="input">
4 <input id="input2" type="input">
5 <script>
6 description("This tests if the composition is reset before tapping of gesture");
7
8 var sucessInput = false;
9 if (window.eventSender) {
10 var input = document.getElementById('input1');
11 var context = input.inputMethodContext;
12 input.focus();
13
14 textInputController.setMarkedText('abcde', 1, 3);
15 shouldEvaluateTo('context.compositionStartOffset', 0);
16 shouldEvaluateTo('context.compositionEndOffset', 5);
17
18 var input2 = document.getElementById('input2');
19 input2.addEventListener('input', function () {
20 sucessInput = true;
21 });
22 var x = input2.offsetLeft + input2.offsetWidth / 2;
23 var y = input2.offsetTop + input2.offsetHeight / 2;
24 eventSender.gestureTapDown(x, y);
25 eventSender.gestureShowPress(x, y);
26 eventSender.gestureTap(x, y);
27
28 eventSender.keyDown('a');
29 shouldBeTrue('sucessInput');
30 }
31 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698