Clicks inside button elements are sometimes discarded when the mouse moves
authoryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 12:51:28 +0000 (12:51 +0000)
committeryouenn.fablet@crf.canon.fr <youenn.fablet@crf.canon.fr@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 4 May 2016 12:51:28 +0000 (12:51 +0000)
commite1193a324fb4fecb50e931bde7eb3a8d94686c17
tree32606259816a97997aabbe87b9b44e4a6693d6f9
parent22ca0f424b57990a784ca1f2a62a02a39a65b529
Clicks inside button elements are sometimes discarded when the mouse moves
https://bugs.webkit.org/show_bug.cgi?id=39620

Reviewed by Darin Adler.

Source/WebCore:

Test: fast/events/click-over-descendant-elements.html

* dom/Node.cpp:
(WebCore::ancestor):
(WebCore::commonAncestor): Method inspired from
http://src.chromium.org/viewvc/blink?view=revision&revision=162081.
(WebCore::commonAncestorCrossingShadowBoundary): Helper routine
that handles the case of nodes into a shadow node.
* dom/Node.h:
* page/EventHandler.cpp:
(WebCore::EventHandler::handleMouseReleaseEvent): Selecting click event
target node according commonAncestorOverShadowBoundary method.
(WebCore::EventHandler::targetNodeForClickEvent): Deleted.

LayoutTests:

Test coming from http://src.chromium.org/viewvc/blink?view=revision&revision=162081.
Modified to ensure click events do not end up being considered as double click events.

* fast/events/click-over-descendant-elements-expected.txt: Added.
* fast/events/click-over-descendant-elements.html: Added.
* platform/ios-simulator/TestExpectations: Marked new test as failing.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@200414 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/click-over-descendant-elements-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/click-over-descendant-elements.html [new file with mode: 0644]
LayoutTests/platform/ios-simulator/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/Node.cpp
Source/WebCore/dom/Node.h
Source/WebCore/page/EventHandler.cpp