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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/forms/text/text-selection-after-type-change.html

Issue 2878613002: INPUT/TEXTAREA elements: Fix incorrect selectionStart/selectionEnd values after blur. (Closed)
Patch Set: Cache in TextControlElement::DefaultEventHandler() Created 3 years, 7 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 <body>
3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5
6 <input>
7
8 <script>
9 var t = async_test('selectionStart/selectionEnd should be kept after input type changes.');
10 t.step(() => {
11 var element = document.querySelector('input');
yosin_UTC9 2017/05/12 04:03:52 nit: Please add: |assert_exists(window, 'eventSend
tkent 2017/05/12 08:41:07 Done.
12 element.value = '';
13 element.focus();
14 eventSender.keyDown('c');
15 assert_equals(element.selectionStart, 1);
16 element.type = 'button';
17 assert_equals(element.selectionStart, null);
18 element.type = 'text';
19
20 // TODO(tkent): We need some delay before checking selectionStart because
21 // input type change doesn't update selectionStart immediately to avoid force
22 // layout. crbug.com/721217
23 setTimeout(t.step_func_done(() => {
yosin_UTC9 2017/05/12 04:03:52 nit: How about using t.step_timeout()[1]? [1] "Ti
tkent 2017/05/12 08:41:07 Done.
24 assert_equals(element.selectionStart, 1);
25 }), 1);
26 });
27 </script>
28 </body>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698