Chromium Code Reviews
DescriptionFire 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 #
Messages
Total messages: 2 (1 generated)
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||