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

Issue 2807123002: Fix the wrong non-element node handling in EventHanlder and MouseEventManager (Closed)

Created:
3 years, 8 months ago by hayato
Modified:
3 years, 8 months ago
CC:
blink-reviews, chromium-reviews, dtapuska+blinkwatch_chromium.org, Navid Zolghadr
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Fix the wrong non-element node handling in EventHanlder and MouseEventManager {EventHandler,MouseEventManager} is storing a {clicked,tapped} node as Node*, instead of Element*, that would be a bad practice. Actually, that has been the cause of several wrong behaviors in Blink, such as: 1. Blink does NOT fire a click event when a clicked text node has been removed in mouseup. This is wrong because a click event should be fired on an element node. See [1] for details. This bug was just tentatively fixed at another CL [2]. 2. Blink DOES fire a touch event on a non-element node. This is wrong because TouchEvent specification says all kinds of touch events' event target types are limited to Document and Element [3]. To prevent these wrong behaviors, this CL does: - Have EventHandlingUtil::ParentElementIfNeeded and use it everywhere so that we surely adjust a node to the appropriate element, at which an event should be fired. - Replaces the usage of Node* to Element* as much as possible so that it rejects the wrong code at type level check. - [1]: topmost event target; https://www.w3.org/TR/uievents/#topmost-event-target - [2] https://codereview.chromium.org/2812613004 - [3]: Trusted proximal event target types are: Document and Element; https://w3c.github.io/touch-events/#list-of-touchevent-types BUG=708394, 710425 Review-Url: https://codereview.chromium.org/2807123002 Cr-Commit-Position: refs/heads/master@{#464344} Committed: https://chromium.googlesource.com/chromium/src/+/85e1871d673fb6c2e4bdb34dde02e5bb1ea896c6

Patch Set 1 #

Patch Set 2 : try #

Total comments: 4

Patch Set 3 : try #

Patch Set 4 : rebase tests, try #

Patch Set 5 : clean up #

Patch Set 6 : wip #

Patch Set 7 : try after merging https://codereview.chromium.org/2809333002 #

Patch Set 8 : Pass the original tapped node to ShadowUnhnadledTapUIIfNeeded #

Total comments: 2

Patch Set 9 : Addressed #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+66 lines, -61 lines) Patch
M third_party/WebKit/LayoutTests/fast/events/touch/gesture/gesture-tap-frame-scrollbar-expected.txt View 1 2 3 6 1 chunk +0 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/input/EventHandler.cpp View 1 2 3 4 5 6 7 8 3 chunks +7 lines, -8 lines 0 comments Download
M third_party/WebKit/Source/core/input/EventHandlingUtil.h View 1 2 3 4 6 1 chunk +1 line, -0 lines 2 comments Download
M third_party/WebKit/Source/core/input/EventHandlingUtil.cpp View 1 2 3 4 6 1 chunk +8 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/input/GestureManager.cpp View 1 2 3 4 5 6 7 8 3 chunks +8 lines, -10 lines 0 comments Download
M third_party/WebKit/Source/core/input/MouseEventManager.h View 1 2 3 4 5 6 7 8 3 chunks +3 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/input/MouseEventManager.cpp View 1 2 3 4 5 6 7 8 7 chunks +39 lines, -39 lines 0 comments Download

Messages

Total messages: 84 (55 generated)
hayato
try
3 years, 8 months ago (2017-04-10 12:08:36 UTC) #3
hayato
PTAL
3 years, 8 months ago (2017-04-11 03:53:32 UTC) #12
tkent
Does Patch Set 1 work if an inner Text node is removed on mousedown?
3 years, 8 months ago (2017-04-11 04:08:50 UTC) #13
tkent
https://codereview.chromium.org/2807123002/diff/20001/third_party/WebKit/Source/core/input/MouseEventManager.cpp File third_party/WebKit/Source/core/input/MouseEventManager.cpp (right): https://codereview.chromium.org/2807123002/diff/20001/third_party/WebKit/Source/core/input/MouseEventManager.cpp#newcode263 third_party/WebKit/Source/core/input/MouseEventManager.cpp:263: if ((mev.InnerNode()->IsTextNode() && click_node_->isConnected() && I think this code ...
3 years, 8 months ago (2017-04-11 04:16:14 UTC) #14
tkent
https://codereview.chromium.org/2807123002/diff/20001/third_party/WebKit/Source/core/input/MouseEventManager.cpp File third_party/WebKit/Source/core/input/MouseEventManager.cpp (right): https://codereview.chromium.org/2807123002/diff/20001/third_party/WebKit/Source/core/input/MouseEventManager.cpp#newcode263 third_party/WebKit/Source/core/input/MouseEventManager.cpp:263: if ((mev.InnerNode()->IsTextNode() && click_node_->isConnected() && On 2017/04/11 at 04:16:14, ...
3 years, 8 months ago (2017-04-11 04:24:16 UTC) #15
kochi
https://codereview.chromium.org/2807123002/diff/20001/third_party/WebKit/Source/core/input/MouseEventManager.cpp File third_party/WebKit/Source/core/input/MouseEventManager.cpp (right): https://codereview.chromium.org/2807123002/diff/20001/third_party/WebKit/Source/core/input/MouseEventManager.cpp#newcode264 third_party/WebKit/Source/core/input/MouseEventManager.cpp:264: !mev.InnerNode()->isConnected()) || (I am not sure and just checking) ...
3 years, 8 months ago (2017-04-11 04:25:00 UTC) #16
hayato
try
3 years, 8 months ago (2017-04-11 07:22:58 UTC) #17
hayato
rebase tests, try
3 years, 8 months ago (2017-04-11 09:30:45 UTC) #22
dtapuska
On 2017/04/11 09:30:45, hayato wrote: > rebase tests, try Navid should review this from a ...
3 years, 8 months ago (2017-04-11 10:58:21 UTC) #27
hayato
clean up
3 years, 8 months ago (2017-04-11 11:53:14 UTC) #30
hayato
I have completely rewritten the CL so that it could fix the root cause, as ...
3 years, 8 months ago (2017-04-11 12:02:20 UTC) #34
hayato
Adding donnd@ as a reviewer because the latest patch set has a regression on Android's ...
3 years, 8 months ago (2017-04-11 12:04:38 UTC) #36
Donn Denman
I took a quick look at a few test failures and my guess is that ...
3 years, 8 months ago (2017-04-11 18:29:23 UTC) #41
hayato
wip
3 years, 8 months ago (2017-04-12 02:25:07 UTC) #42
hayato
try after merging https://codereview.chromium.org/2809333002
3 years, 8 months ago (2017-04-12 03:33:55 UTC) #45
hayato
According to the comment in https://bugs.chromium.org/p/chromium/issues/detail?id=708394#c18, I am thinking that we should have a tentative ...
3 years, 8 months ago (2017-04-12 04:06:42 UTC) #50
hayato
Pass the original tapped node to ShadowUnhnadledTapUIIfNeeded
3 years, 8 months ago (2017-04-12 05:04:26 UTC) #51
hayato
The result looks all green. Let me clean up the CL and the description tomorrow. ...
3 years, 8 months ago (2017-04-12 09:08:36 UTC) #57
Donn Denman
LGTM % nit below. https://codereview.chromium.org/2807123002/diff/140001/third_party/WebKit/Source/core/input/GestureManager.cpp File third_party/WebKit/Source/core/input/GestureManager.cpp (right): https://codereview.chromium.org/2807123002/diff/140001/third_party/WebKit/Source/core/input/GestureManager.cpp#newcode293 third_party/WebKit/Source/core/input/GestureManager.cpp:293: if (event_result == WebInputEventResult::kNotHandled && ...
3 years, 8 months ago (2017-04-12 17:12:19 UTC) #58
hayato
Addressed
3 years, 8 months ago (2017-04-13 05:01:03 UTC) #64
hayato
https://codereview.chromium.org/2807123002/diff/140001/third_party/WebKit/Source/core/input/GestureManager.cpp File third_party/WebKit/Source/core/input/GestureManager.cpp (right): https://codereview.chromium.org/2807123002/diff/140001/third_party/WebKit/Source/core/input/GestureManager.cpp#newcode293 third_party/WebKit/Source/core/input/GestureManager.cpp:293: if (event_result == WebInputEventResult::kNotHandled && tapped_element && Nice catch. ...
3 years, 8 months ago (2017-04-13 05:01:40 UTC) #67
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/2807123002/160001
3 years, 8 months ago (2017-04-13 05:03:58 UTC) #70
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/361546)
3 years, 8 months ago (2017-04-13 06:51:17 UTC) #72
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/2807123002/160001
3 years, 8 months ago (2017-04-13 07:09:14 UTC) #74
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_ozone_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_ozone_rel_ng/builds/361658)
3 years, 8 months ago (2017-04-13 08:26:27 UTC) #76
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/2807123002/160001
3 years, 8 months ago (2017-04-13 08:29:50 UTC) #78
commit-bot: I haz the power
Committed patchset #9 (id:160001) as https://chromium.googlesource.com/chromium/src/+/85e1871d673fb6c2e4bdb34dde02e5bb1ea896c6
3 years, 8 months ago (2017-04-13 08:54:13 UTC) #81
dtapuska
https://codereview.chromium.org/2807123002/diff/160001/third_party/WebKit/Source/core/input/EventHandlingUtil.h File third_party/WebKit/Source/core/input/EventHandlingUtil.h (right): https://codereview.chromium.org/2807123002/diff/160001/third_party/WebKit/Source/core/input/EventHandlingUtil.h#newcode34 third_party/WebKit/Source/core/input/EventHandlingUtil.h:34: Element* ParentElementIfNeeded(Node*); Ia this method really needed? Could HitTestResult::innerElement ...
3 years, 8 months ago (2017-04-19 01:56:07 UTC) #83
hayato
3 years, 8 months ago (2017-04-19 02:26:35 UTC) #84
Message was sent while issue was closed.
https://codereview.chromium.org/2807123002/diff/160001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/input/EventHandlingUtil.h (right):

https://codereview.chromium.org/2807123002/diff/160001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/input/EventHandlingUtil.h:34: Element*
ParentElementIfNeeded(Node*);
Ah, I didn't notice innerElement() at all because the old code around here
didn't use it. :(

HitTestResult::innerElement() (after some refinements) would be better.

Powered by Google App Engine
This is Rietveld 408576698