Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "[editing] adjust selection to avoid select
user-select:none
…
… element when triple-click" This reverts commit 31a47fc. Reason for revert: Caused crbug.com/1410448 Original change's description: > [editing] adjust selection to avoid select `user-select:none` element when triple-click > > Consider this testcase: > <div style="user-select: none;"> > <div style="user-select: text;">line1</div> > <input type="text" value="input" /> > </div> > <div>line2</div> > > renderered as: > line1 > InputElement: input > line2 > > Before this patch, when triple-clicking at 1st line, > 'line1' of 1st line and the input element will be selected. > > In this case, the extent value of the selection returned by > ExpandWithGranularity is "DIV#two offset[0]". > When `anchor_node` is TextControlElement, > current situation is that the return value of > IsVisuallyEquivalentCandidate depends on > whether the parent node is selectable. > > `VisibleSelection` affect every thing, but `user-select` > should affect only for user interaction, so we should > shrink selection in `SelectionController`. > > This patch introduce new function `AdjustSelectionByUserSelect`. > `AdjustSelectionByUserSelect` will do: > 1. expand selection to to respect `user-select: all` > 2. scan backward from `anchor_node` to the base of > `expanded_selection`, > when position is not selectable, shrink the seleciton. > 3. scan forward from `anchor_node` to the extent of > `expanded_selection`, > when position is not selectable, shrink the seleciton. > > Bug: 1372847 > > Test: SelectionControllerTest.AdjustSelectionByUserSelect > > Change-Id: Ic3d014c5b7334947b4185afdf3a81256df3f1b22 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3954728 > Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org> > Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org> > Cr-Commit-Position: refs/heads/main@{#1064183} Bug: 1372847,1410448 Change-Id: I004b0ec38c099a81129ba7c2c34b03ee131b992f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4205687 Commit-Queue: Prudhvikumar Bommana <pbommana@google.com> Reviewed-by: Srinivas Sista <srinivassista@chromium.org> Owners-Override: Prudhvikumar Bommana <pbommana@google.com> Cr-Commit-Position: refs/branch-heads/5569@{#3} Cr-Branched-From: 48c4dbe-refs/heads/main@{#1098540}
- Loading branch information