DescriptionRevert of Reland: Do not send redundant selectionchange-events (patchset #29 id:560001 of https://codereview.chromium.org/2616623002/ )
Reason for revert:
Caused http://crbug.com/707156, please reland after fixing it.
BUG=707156
Original issue's description:
> Reland: Do not send redundant selectionchange-events (decouple focus)
>
> Reason for reland:
> Update Win7/10 LayoutTests correctly: crbug.com/706119
>
> 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@{#460314}
> Committed: https://chromium.googlesource.com/chromium/src/+/92bf3c29fccac551acceff254e53d7ea73367158
TBR=amaralp@chromium.org,bokan@chromium.org,kochi@chromium.org,yosin@chromium.org,hugoh@opera.com
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=678601, 679635, 699015
Review-Url: https://codereview.chromium.org/2791753002
Cr-Commit-Position: refs/heads/master@{#461278}
Committed: https://chromium.googlesource.com/chromium/src/+/1fe7a105adbf7d7e58b3fcb38aefe2fd735c6065
Patch Set 1 #Patch Set 2 : Add a NeedsRebaseline to manage conflict with http://crrev.com/460732 #Messages
Total messages: 13 (8 generated)
|