[Pointer Events] The pointerenter and pointerleave events target the wrong element...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 May 2019 16:50:37 +0000 (16:50 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 14 May 2019 16:50:37 +0000 (16:50 +0000)
commita7a7698ce1b1497458cbbeaf2f35fc07165570f5
tree5a7be3064b40e7c4268dc55b0335ef948c26244d
parentb192a7f05cdffdd00e2f73575661dd6529f1b9ca
[Pointer Events] The pointerenter and pointerleave events target the wrong element on iOS
https://bugs.webkit.org/show_bug.cgi?id=197881
<rdar://problem/50187657>

Patch by Antoine Quint <graouts@apple.com> on 2019-05-14
Reviewed by Dean Jackson.

Source/WebCore:

Test: pointerevents/ios/enter-leave-target.html

The "pointerenter" and "pointerleave" should target the element on which the event listener was added and not
the element that would otherwise hit test. This matches the behavior of "mouseenter" and "mouseleave" on macOS.

* page/PointerCaptureController.cpp:
(WebCore::PointerCaptureController::dispatchEventForTouchAtIndex):

LayoutTests:

Add a test where we tap an element that is the child of another element where the parent is the element with the "pointerenter"
and "pointerleave" events registered. The test shows that we correctly set the target to the parent element and not the child.

* pointerevents/ios/enter-leave-target-expected.txt: Added.
* pointerevents/ios/enter-leave-target.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@245286 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/pointerevents/ios/enter-leave-target-expected.txt [new file with mode: 0644]
LayoutTests/pointerevents/ios/enter-leave-target.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/page/PointerCaptureController.cpp