DescriptionRevert of Do not send redundant selectionchange-events (patchset #28 id:540001 of https://codereview.chromium.org/2616623002/ )
Reason for revert:
Broke webkit_tests: https://bugs.chromium.org/p/chromium/issues/detail?id=706119
Original issue's description:
> Do not send redundant selectionchange-events (decouple focus)
>
> Background:
> Blink tells browser-side when a new <input>-element gets focus.
> The information is passed in the
> ViewHostMsg_TextInputStateChanged-message.
>
> Problem:
> With current logic, RenderFrameImpl::didChangeSelection is
> called twice so two ViewHostMsg_TextInputStateChanged-messages
> are sent to browser-side:
> (1) when focus leaves an <input>-field (unnecessary!).
> (2) when focus enters another <input>-field.
>
> Worse, also the web page gets two selectionchange events.
> The first one is immediately invalid so the webpage should
> not react to it.
>
> (1) happens because FocusController::setFocusedElement()
> always clears the selection when a new element gets focus.
>
> Solution:
> When JavaScript moves focus to an element, element.focus(),
> and when the user moves focus using tab-key navigation or
> mouse, we don't clear the old selection (we hide it). This
> means, we only send one selectionchange event, not two, for
> each caret jump (as in Firefox).
>
> Test updates:
> 1. Check for one selectionchange event, not two.
> 2. LayoutTests' trees now expect the "hidden" selection.
> 3. A new test in WebFrameTest.cpp tests tab-key navigation.
>
> Follow-up will remove the remaining redundant clears:
> crbug.com/692898 (tab jumps to non-editable elements).
>
> BUG=678601, 679635, 699015
> TEST=In content_shell, select some text in an <input>-field,
> click another <input>-field (move focus).
> Notice: one selectionchange event is fired.
>
> Review-Url: https://codereview.chromium.org/2616623002
> Cr-Commit-Position: refs/heads/master@{#459984}
> Committed: https://chromium.googlesource.com/chromium/src/+/31d55d991baf03aa9bc3ff5d5e67f709eee77959
TBR=aelias@chromium.org,amaralp@chromium.org,bokan@chromium.org,kochi@chromium.org,yosin@chromium.org,hugoh@opera.com
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=678601, 679635, 699015
Review-Url: https://codereview.chromium.org/2784653002
Cr-Commit-Position: refs/heads/master@{#460205}
Committed: https://chromium.googlesource.com/chromium/src/+/914070a0e79c114aad81486aba7a3a15d94f590e
Patch Set 1 #
Created: 3 years, 8 months ago
Messages
Total messages: 6 (3 generated)
|