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

Issue 1049233003: Keep the selection of the text field when changed by JS. (Closed)

Created:
5 years, 8 months ago by Miyoung Shin(g)
Modified:
5 years, 5 months ago
CC:
blink-reviews, blink-reviews-events_chromium.org, dglazkov+blink, eae+blinkwatch, Donn Denman, yoichio
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Target Ref:
refs/heads/master
Project:
blink
Visibility:
Public.

Description

Keep the selection of the text field when changed by JS. Fixed to keep the selection of the text field in the input element after setSelectionRange is called by dom events when triggering the mouse event or the tap event. The problem is that the selection is cleared when handling mouse release. The selection should be kept if the selection is set by setSelectionRange during handling the mouse/tap event. BUG=32865, 429967, 438102, 440086, 457147 R=yosin@chromium.org, rbyers@chromium.org TEST= fast/events/touch/gesture/gesture-tap-input-after-composition.html fast/events/touch/gesture/gesture-tap-reset-selection-range.html fast/events/touch/gesture/gesture-tap-setrangetext-with-events.html fast/forms/setrangetext-out-of-range.html fast/forms/setrangetext-within-events.html Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=198752

Patch Set 1 #

Total comments: 7

Patch Set 2 : #

Patch Set 3 : #

Total comments: 15

Patch Set 4 : #

Total comments: 13

Patch Set 5 : #

Patch Set 6 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+217 lines, -2 lines) Patch
A LayoutTests/fast/events/touch/gesture/gesture-tap-input-after-composition.html View 1 2 3 4 1 chunk +32 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html View 1 2 3 4 5 1 chunk +21 lines, -0 lines 0 comments Download
A LayoutTests/fast/events/touch/gesture/gesture-tap-setrangetext-with-events.html View 1 2 3 4 1 chunk +45 lines, -0 lines 0 comments Download
A LayoutTests/fast/forms/setrangetext-out-of-range.html View 1 2 3 4 1 chunk +39 lines, -0 lines 0 comments Download
A LayoutTests/fast/forms/setrangetext-within-events.html View 1 2 3 4 1 chunk +53 lines, -0 lines 0 comments Download
M Source/core/editing/FrameSelection.h View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/editing/FrameSelection.cpp View 1 2 3 3 chunks +7 lines, -0 lines 0 comments Download
M Source/core/editing/SelectionController.h View 1 2 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/editing/SelectionController.cpp View 1 2 3 2 chunks +11 lines, -1 line 0 comments Download
M Source/core/input/EventHandler.cpp View 1 2 3 3 chunks +7 lines, -1 line 0 comments Download

Messages

Total messages: 25 (5 generated)
Miyoung Shin(g)
PTAL. The patch was reverted at http://crrev.com/965203003. I've uploaded the new patch to fix the ...
5 years, 8 months ago (2015-03-31 16:24:47 UTC) #1
Rick Byers
There's clearly (given the 4 different regressions caused by the first attempts to land this) ...
5 years, 8 months ago (2015-04-09 19:39:46 UTC) #3
yosin_UTC9
On 2015/04/09 19:39:46, Rick Byers wrote: > Is this behavior spec'd anywhere? I've never seen ...
5 years, 8 months ago (2015-04-10 01:51:11 UTC) #4
yosin_UTC9
My suggestion is make EventHandler simpler and selection updates in different place, e.g. SelectionController or ...
5 years, 8 months ago (2015-04-10 02:06:10 UTC) #5
Miyoung Shin(g)
https://codereview.chromium.org/1049233003/diff/1/Source/core/page/EventHandler.cpp File Source/core/page/EventHandler.cpp (right): https://codereview.chromium.org/1049233003/diff/1/Source/core/page/EventHandler.cpp#newcode3133 Source/core/page/EventHandler.cpp:3133: void EventHandler::notifySelectionChanged() On 2015/04/10 02:06:09, Yosi_UTC9 wrote: > It ...
5 years, 8 months ago (2015-04-22 15:32:37 UTC) #6
yosin_UTC9
https://codereview.chromium.org/1049233003/diff/1/Source/core/page/EventHandler.cpp File Source/core/page/EventHandler.cpp (right): https://codereview.chromium.org/1049233003/diff/1/Source/core/page/EventHandler.cpp#newcode3133 Source/core/page/EventHandler.cpp:3133: void EventHandler::notifySelectionChanged() On 2015/04/22 15:32:37, Miyoung Shin(g) wrote: > ...
5 years, 8 months ago (2015-04-28 01:59:54 UTC) #8
Miyoung Shin(g)
On 2015/04/28 01:59:54, Yosi_UTC9 wrote: > https://codereview.chromium.org/1049233003/diff/1/Source/core/page/EventHandler.cpp > File Source/core/page/EventHandler.cpp (right): > > https://codereview.chromium.org/1049233003/diff/1/Source/core/page/EventHandler.cpp#newcode3133 > ...
5 years, 7 months ago (2015-04-29 11:58:09 UTC) #9
Rick Byers
On 2015/04/29 11:58:09, Miyoung Shin(g) wrote: > On 2015/04/28 01:59:54, Yosi_UTC9 wrote: > > > ...
5 years, 7 months ago (2015-04-29 18:19:20 UTC) #10
yosin_UTC9
On 2015/04/29 18:19:20, Rick Byers wrote: > On 2015/04/29 11:58:09, Miyoung Shin(g) wrote: > > ...
5 years, 7 months ago (2015-04-30 02:08:11 UTC) #11
Miyoung Shin(g)
On 2015/04/30 02:08:11, Yosi_UTC9 wrote: > On 2015/04/29 18:19:20, Rick Byers wrote: > > On ...
5 years, 7 months ago (2015-04-30 09:19:31 UTC) #12
Miyoung Shin(g)
yosin@, PTAL.
5 years, 5 months ago (2015-07-05 15:19:41 UTC) #13
yosin_UTC9
https://codereview.chromium.org/1049233003/diff/60001/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html File LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html (right): https://codereview.chromium.org/1049233003/diff/60001/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html#newcode10 LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html:10: shouldBeGreaterThan('window.getSelection().rangeCount', '0'); We don't need to check this. Other ...
5 years, 5 months ago (2015-07-06 01:57:30 UTC) #14
Miyoung Shin(g)
https://codereview.chromium.org/1049233003/diff/60001/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html File LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html (right): https://codereview.chromium.org/1049233003/diff/60001/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html#newcode10 LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html:10: shouldBeGreaterThan('window.getSelection().rangeCount', '0'); On 2015/07/06 01:57:29, Yosi_UTC9 wrote: > We ...
5 years, 5 months ago (2015-07-13 03:32:57 UTC) #15
yosin_UTC9
https://codereview.chromium.org/1049233003/diff/80001/LayoutTests/fast/events/touch/gesture/gesture-tap-input-after-composition.html File LayoutTests/fast/events/touch/gesture/gesture-tap-input-after-composition.html (right): https://codereview.chromium.org/1049233003/diff/80001/LayoutTests/fast/events/touch/gesture/gesture-tap-input-after-composition.html#newcode10 LayoutTests/fast/events/touch/gesture/gesture-tap-input-after-composition.html:10: if (window.eventSender) { nit: Could you use early return ...
5 years, 5 months ago (2015-07-13 03:47:22 UTC) #16
Miyoung Shin(g)
https://codereview.chromium.org/1049233003/diff/80001/LayoutTests/fast/events/touch/gesture/gesture-tap-input-after-composition.html File LayoutTests/fast/events/touch/gesture/gesture-tap-input-after-composition.html (right): https://codereview.chromium.org/1049233003/diff/80001/LayoutTests/fast/events/touch/gesture/gesture-tap-input-after-composition.html#newcode10 LayoutTests/fast/events/touch/gesture/gesture-tap-input-after-composition.html:10: if (window.eventSender) { On 2015/07/13 03:47:22, Yosi_UTC9 wrote: > ...
5 years, 5 months ago (2015-07-13 04:23:49 UTC) #17
yosin_UTC9
lgtm for core/editing/ and tests +tkent@ for EventHandler.cpp changes. https://codereview.chromium.org/1049233003/diff/80001/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html File LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html (right): https://codereview.chromium.org/1049233003/diff/80001/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html#newcode19 LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html:19: ...
5 years, 5 months ago (2015-07-13 04:39:57 UTC) #19
tkent
EventHandler lgtm https://codereview.chromium.org/1049233003/diff/80001/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html File LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html (right): https://codereview.chromium.org/1049233003/diff/80001/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html#newcode19 LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html:19: if (window.testRunner) On 2015/07/13 04:39:56, Yosi_UTC9 wrote: ...
5 years, 5 months ago (2015-07-13 04:51:10 UTC) #20
Miyoung Shin(g)
https://codereview.chromium.org/1049233003/diff/80001/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html File LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html (right): https://codereview.chromium.org/1049233003/diff/80001/LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html#newcode19 LayoutTests/fast/events/touch/gesture/gesture-tap-reset-selection-range.html:19: if (window.testRunner) On 2015/07/13 04:51:10, tkent wrote: > On ...
5 years, 5 months ago (2015-07-13 05:19:09 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1049233003/120001
5 years, 5 months ago (2015-07-13 05:34:23 UTC) #24
commit-bot: I haz the power
5 years, 5 months ago (2015-07-13 06:45:14 UTC) #25
Message was sent while issue was closed.
Committed patchset #6 (id:120001) as
https://src.chromium.org/viewvc/blink?view=rev&revision=198752

Powered by Google App Engine
This is Rietveld 408576698