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

Issue 2814343002: Fire a click event even when a clicked text node is removed in mouseup (Closed)

Created:
3 years, 8 months ago by hayato
Modified:
3 years, 8 months ago
Reviewers:
CC:
chromium-reviews
Target Ref:
refs/branch-heads/3029
Project:
chromium
Visibility:
Public.

Description

Fire a click event even when a clicked text node is removed in mouseup This is a tentative fix for bug 708394. See also https://codereview.chromium.org/2807123002/ for details, which is trying to fix the root cause. Since fixing the root cause might change the other behaviors as well as fixing bug 708394, let me land the tentative fix to prevent a regression in M58. Blink does not fire a click event if a user removes a clicked text node in mouseup event listener because of the followings: 1. User presses a mouse button 2. UA did a hittest. The result's innerNode() is a text node. 3. MouseEventManager#click_node_ is set to the parent element of the clicked text node 4. Dispatch mouse press events (or anything) 5. User releases a mouse button 6. UA did another hittest because UA would dispatch a click event at the common ancestor of: - A location of mouse pressed; MouseEventManager#click_node_ is used in this case. - A location of mouse released; The 2nd hit test's result is used in this case. 7. Users removed a text node, which is the result of 2nd hit test. 8. Since there is no common ancestor of MouseEventManager#click_node_ and the 2nd hit test's result, a click event is not dispatched. This CL keeps the parent element, if necessary, of 2nd hit test's result before dispatching a mouseup event, and use it to decide whether to dispatch a click event or not. BUG=708394 Review-Url: https://codereview.chromium.org/2812613004 Cr-Commit-Position: refs/heads/master@{#463950} (cherry picked from commit a971919aa2691e65eaf9a085b949ed6effc143a3) Review-Url: https://codereview.chromium.org/2814343002 . Cr-Commit-Position: refs/branch-heads/3029@{#688} Cr-Branched-From: 939b32ee5ba05c396eef3fd992822fcca9a2e262-refs/heads/master@{#454471} Committed: https://chromium.googlesource.com/chromium/src/+/a71136c3bad4746d6d66a4628985640895659138

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+46 lines, -11 lines) Patch
A third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html View 1 chunk +27 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup-expected.txt View 1 chunk +4 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/input/EventHandler.cpp View 2 chunks +4 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/input/MouseEventManager.h View 1 chunk +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/input/MouseEventManager.cpp View 2 chunks +9 lines, -9 lines 0 comments Download

Messages

Total messages: 2 (1 generated)
hayato
3 years, 8 months ago (2017-04-13 04:15:21 UTC) #2
Message was sent while issue was closed.
Committed patchset #1 (id:1) manually as
a71136c3bad4746d6d66a4628985640895659138.

Powered by Google App Engine
This is Rietveld 408576698