We should move following members into another place
- granularity_; being removed, see 230267
- is_directional; FrameSelection and TextFormControlElement
- is_handle_visible_; UX feature for Android, move to FrameSelection
The following revision refers to this bug:
https://chromium.googlesource.com/chromium/src.git/+/8bb1cbaee778761d1716d455e51e033e32687022
commit 8bb1cbaee778761d1716d455e51e033e32687022
Author: Xiaocheng Hu <xiaochengh@chromium.org>
Date: Wed Nov 29 05:30:04 2017
Simplify TextControlElement::ComputeSelectionStart/End
We used to need such handling for different selection granularities
in the above mentioned functions because when granularity is not
character, we used to have a mismatch between:
- FrameSelection::SelectionInDOMTree::ComputeStart/EndPosition()
- FrameSelection::ComputeVisibleSelectionInDOMTree::Start/End()
Now that granularity is completely moved to FrameSelection, there is
no longer such mismatch. So we can use the same logic for all
granularities. As a side effect, this also allows us to remove some
call sites of ComputeVisibleSelectionInDOMTreeDeprecated().
Note that this patch changes the calculation of IndexForPosition from
using the canonicalized position to the un-canonicalized position.
This doesn't change the result, because there is only plain text in
text control elements, while canonicalization doesn't skip any plain
text (unless there is bug in canonicalization).
Behavior covered by layout tests:
- fast/forms/onselect-textfield.html
- fast/forms/textarea/onselect-textarea.html
Bug: 698633, 740804
Change-Id: Id19d694284a5b439dd4585b88c0e40ad99f33f75
Reviewed-on: https://chromium-review.googlesource.com/786397
Reviewed-by: Yoichi Osato <yoichio@chromium.org>
Reviewed-by: Yoshifumi Inoue <yosin@chromium.org>
Reviewed-by: Koji Ishii <kojii@chromium.org>
Commit-Queue: Yoichi Osato <yoichio@chromium.org>
Cr-Commit-Position: refs/heads/master@{#520020}
[modify] https://crrev.com/8bb1cbaee778761d1716d455e51e033e32687022/third_party/WebKit/Source/core/html/forms/TextControlElement.cpp
Comment 1 by yosin@chromium.org
, Jul 11 2017