Chromium Code Reviews
DescriptionWebFrame::selectRange should behave like moveCaret
selectRange and moveCaret are used to alter the current selection by a
user dragging an insertion/selection handle on Android and ChromeOS.
There are two expected behaviors that this change fixes. First, if the
current selection is in an editable element, the new selection will be
within the same editable element. Second, the selection should stay
horizontally aligned with the handle.
Currently, selectRange doesn't even consider the second behavior and it
sort of gets the first behavior by restricting the resulting selection
to not cross editable boundaries and assuming that the focus point is
within the current editable element. This is incredibly fragile.
This extracts the logic used for determining selection when dragging the
mouse, selectionExtentRespectingEditingBoundary, from EventHandler.cpp so
that it can also be used for selectRange/moveCaret so that all these
behaviors can be consistent.
To better reflect what these functions do (and that they are really
paired together) this change introduces new names for these two
functions: WebFrame::moveCaretSelection and WebFrame::moveRangeSelection.
NOTRY=true
BUG=232385, 238329, 238334
Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=151125
Patch Set 1 #Patch Set 2 : #
Total comments: 4
Patch Set 3 : #
Total comments: 2
Patch Set 4 : Move to method of VisibleSelection, fix style nits #
Total comments: 3
Patch Set 5 : Rebase #Patch Set 6 : Address comment #Messages
Total messages: 23 (0 generated)
|