Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(255)

Issue 2784653002: Revert of Do not send redundant selectionchange-events (Closed)

Created:
3 years, 8 months ago by imcheng
Modified:
3 years, 8 months ago
CC:
blink-reviews, chromium-reviews, yabinh
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Revert 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 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+82 lines, -131 lines) Patch
M content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java View 5 chunks +5 lines, -5 lines 0 comments Download
M content/test/data/android/input/input_forms.html View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/editing/input/keyboard_event_without_focus.html View 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/editing/selection/focus-and-display-none-and-redisplay.html View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/editing/selection/focus-and-display-none-and-redisplay-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/touch/gesture/focus-selectionchange-on-tap-expected.txt View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/forms/focus-selection-input-expected.txt View 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/forms/focus-selection-textarea-expected.txt View 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/android/fast/forms/textarea/textarea-scrolled-mask-expected.txt View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/fast/forms/focus-selection-textarea-expected.txt View 1 chunk +7 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/fast/forms/textarea/textarea-scrolled-mask-expected.txt View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/platform/linux/plugins/mouse-click-plugin-clears-selection-expected.txt View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac-mac10.10/fast/forms/textarea/textarea-scrolled-mask-expected.txt View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac-mac10.10/plugins/mouse-click-plugin-clears-selection-expected.txt View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac-mac10.9/fast/forms/textarea/textarea-scrolled-mask-expected.txt View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac-mac10.9/plugins/mouse-click-plugin-clears-selection-expected.txt View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/fast/forms/focus-selection-textarea-expected.txt View 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/fast/forms/textarea/textarea-scrolled-mask-expected.txt View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/platform/mac/plugins/mouse-click-plugin-clears-selection-expected.txt View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/fast/forms/textarea/textarea-scrolled-mask-expected.txt View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/platform/win/plugins/mouse-click-plugin-clears-selection-expected.txt View 1 chunk +0 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/editing/EditingUtilities.h View 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/EditingUtilities.cpp View 1 chunk +0 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/core/editing/PendingSelection.cpp View 3 chunks +7 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/page/FocusController.cpp View 4 chunks +33 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/web/tests/WebFrameTest.cpp View 3 chunks +0 lines, -58 lines 0 comments Download
D third_party/WebKit/Source/web/tests/data/editable_elements.html View 1 chunk +0 lines, -9 lines 0 comments Download

Messages

Total messages: 6 (3 generated)
imcheng
Created Revert of Do not send redundant selectionchange-events
3 years, 8 months ago (2017-03-28 20:26:50 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2784653002/1
3 years, 8 months ago (2017-03-28 20:27:24 UTC) #3
commit-bot: I haz the power
3 years, 8 months ago (2017-03-28 20:31:13 UTC) #6
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/914070a0e79c114aad81486aba7a...

Powered by Google App Engine
This is Rietveld 408576698