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}
Showing
Please register or sign in to comment