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

Issue 2812613004: 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:
tkent, kochi, Navid Zolghadr
CC:
blink-reviews, chromium-reviews, dtapuska+blinkwatch_chromium.org, Navid Zolghadr
Target Ref:
refs/heads/master
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} Committed: https://chromium.googlesource.com/chromium/src/+/a971919aa2691e65eaf9a085b949ed6effc143a3

Patch Set 1 #

Total comments: 10
Unified diffs Side-by-side diffs Delta from patch set Stats (+48 lines, -13 lines) Patch
A third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html View 1 chunk +27 lines, -0 lines 4 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 6 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 3 chunks +11 lines, -11 lines 0 comments Download

Messages

Total messages: 25 (15 generated)
hayato
PTAL
3 years, 8 months ago (2017-04-12 04:08:05 UTC) #10
hayato
kochi@, could you take a look? tkent@ looks OOO today.
3 years, 8 months ago (2017-04-12 04:57:46 UTC) #14
yosin_UTC9
https://codereview.chromium.org/2812613004/diff/1/third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html File third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html (right): https://codereview.chromium.org/2812613004/diff/1/third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html#newcode4 third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html:4: <div id="test"></div> It is better to use w3c test ...
3 years, 8 months ago (2017-04-12 06:10:44 UTC) #15
hayato
https://codereview.chromium.org/2812613004/diff/1/third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html File third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html (right): https://codereview.chromium.org/2812613004/diff/1/third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html#newcode4 third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html:4: <div id="test"></div> We can't because the test needs eventSender. ...
3 years, 8 months ago (2017-04-12 06:16:07 UTC) #16
kochi
lgtm https://codereview.chromium.org/2812613004/diff/1/third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html File third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html (right): https://codereview.chromium.org/2812613004/diff/1/third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html#newcode4 third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html:4: <div id="test"></div> On 2017/04/12 06:16:06, hayato wrote: > ...
3 years, 8 months ago (2017-04-12 06:44:39 UTC) #17
hayato
https://codereview.chromium.org/2812613004/diff/1/third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html File third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html (right): https://codereview.chromium.org/2812613004/diff/1/third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html#newcode4 third_party/WebKit/LayoutTests/fast/events/remove-text-node-in-mouseup.html:4: <div id="test"></div> It would be, but I would prefer ...
3 years, 8 months ago (2017-04-12 06:52:22 UTC) #19
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/2812613004/1
3 years, 8 months ago (2017-04-12 06:52:32 UTC) #20
kochi
still lgtm https://codereview.chromium.org/2812613004/diff/1/third_party/WebKit/Source/core/input/EventHandler.cpp File third_party/WebKit/Source/core/input/EventHandler.cpp (right): https://codereview.chromium.org/2812613004/diff/1/third_party/WebKit/Source/core/input/EventHandler.cpp#newcode963 third_party/WebKit/Source/core/input/EventHandler.cpp:963: Node* release_node = (mev.InnerNode() && mev.InnerNode()->IsTextNode()) On ...
3 years, 8 months ago (2017-04-12 07:03:19 UTC) #21
hayato
https://codereview.chromium.org/2812613004/diff/1/third_party/WebKit/Source/core/input/EventHandler.cpp File third_party/WebKit/Source/core/input/EventHandler.cpp (right): https://codereview.chromium.org/2812613004/diff/1/third_party/WebKit/Source/core/input/EventHandler.cpp#newcode963 third_party/WebKit/Source/core/input/EventHandler.cpp:963: Node* release_node = (mev.InnerNode() && mev.InnerNode()->IsTextNode()) On 2017/04/12 at ...
3 years, 8 months ago (2017-04-12 07:12:07 UTC) #22
commit-bot: I haz the power
3 years, 8 months ago (2017-04-12 07:54:00 UTC) #25
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/a971919aa2691e65eaf9a085b949...

Powered by Google App Engine
This is Rietveld 408576698