click event does not dispatch to parent when child target stops hit testing after...
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Jul 2017 19:14:12 +0000 (19:14 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 17 Jul 2017 19:14:12 +0000 (19:14 +0000)
commitb7969bdd6902f444995b09bd79d351ea82f34ac5
tree9ed85ce553f7a1bd830fb8ee6d221e82ae86bd63
parentb74cd72967ca22763823d9559cba031d5a70d9e8
click event does not dispatch to parent when child target stops hit testing after mousedown
https://bugs.webkit.org/show_bug.cgi?id=174564
<rdar://problem/33340234>

Reviewed by Simon Fraser.

Source/WebCore:

As per [1], if the mouse down node and the mouse release node differ, then we are supposed to
fire the click event at their common ancestor, if such node exists. This patch implements this
logic. This also aligns our behavior with Blink.

[1] https://w3c.github.io/uievents/#events-mouseevent-event-order

Test: fast/events/mouse-click-different-mouseDown-mouseUp-nodes.html

* page/EventHandler.cpp:
(WebCore::targetNodeForClickEvent):

LayoutTests:

Add layout test coverage.

* fast/events/mouse-click-different-mouseDown-mouseUp-nodes-expected.txt: Added.
* fast/events/mouse-click-different-mouseDown-mouseUp-nodes.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@219568 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/mouse-click-different-mouseDown-mouseUp-nodes-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/mouse-click-different-mouseDown-mouseUp-nodes.html [new file with mode: 0644]
LayoutTests/platform/ios/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/page/EventHandler.cpp