TouchList should be retargeted
authorrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Jan 2016 18:38:20 +0000 (18:38 +0000)
committerrniwa@webkit.org <rniwa@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 30 Jan 2016 18:38:20 +0000 (18:38 +0000)
commitf7bd60c138cb3712c64c30a278a1f626aa0154e7
tree7b042a93948fa7f45a902432c8ef04b06959abb7
parent0fd842c4679a2d917c7a0bd8a53dc5a2009c7f90
TouchList should be retargeted
https://bugs.webkit.org/show_bug.cgi?id=149592

Reviewed by Antti Koivisto.

Source/WebCore:

Retarget touch target's using the same algorithm as the one used for related targets instead of
EventRelatedNodeResolver which is removed in this patch.

Also enable the retargeting on iOS.

Test: fast/shadow-dom/touch-event-ios.html

* dom/EventContext.cpp:
(WebCore::TouchEventContext::TouchEventContext):
(WebCore::TouchEventContext::handleLocalEvents):
(WebCore::TouchEventContext::checkReachability):
* dom/EventContext.h:
(WebCore::toTouchEventContext):
(WebCore::EventContext::isUnreachableNode):
* dom/EventDispatcher.cpp:
(WebCore::EventRelatedNodeResolver): Deleted.
(WebCore::EventPath::EventPath):
(WebCore::EventDispatcher::dispatchEvent):
(WebCore::addRelatedNodeResolversForTouchList): Deleted.
(WebCore::EventPath::updateTouchLists): Deleted.
(WebCore::EventPath::setRelatedTarget): Removed superfluous UNUSED_PARAM since the argument is always used.
(WebCore::EventPath::retargetTouch): Extracted from updateTouchLists/setRelatedTarget. Clones Touch object
with the new target for each event context just like related targets.
(WebCore::EventPath::retargetTouchLists): Renamed from updateTouchLists. Calls retargetTouch on each Touch
object in each TouchList.
* dom/TouchEvent.h:

Tools:

Added touchDownAtPoint and liftUpAtPoint to UIScriptController so that we can test touch events with
multiple touch targets on iOS. fast/shadow-dom/touch-event-ios.html uses this new testing feature.

* WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl:
* WebKitTestRunner/UIScriptContext/UIScriptController.cpp:
(WTR::UIScriptController::touchDownAtPoint): Added.
(WTR::UIScriptController::liftUpAtPoint): Added.
* WebKitTestRunner/UIScriptContext/UIScriptController.h:
* WebKitTestRunner/ios/HIDEventGenerator.h:
* WebKitTestRunner/ios/HIDEventGenerator.mm:
(-[HIDEventGenerator touchDown:touchCount:completionBlock:]): Added. Sends touch down and waits.
(-[HIDEventGenerator liftUp:touchCount:completionBlock:]): Ditto for lift up.
* WebKitTestRunner/ios/UIScriptControllerIOS.mm:
(WTR::UIScriptController::touchDownAtPoint): Added.
(WTR::UIScriptController::liftUpAtPoint): Added.

LayoutTests:

Added a regression test for retargeting touch targets on iOS.

* fast/shadow-dom/touch-event-ios-expected.txt: Added.
* fast/shadow-dom/touch-event-ios.html: Added.
* platform/mac/TestExpectations: Added the failing expectation on Mac since touch support is not enabled.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@195899 268f45cc-cd09-0410-ab3c-d52691b4dbfc
16 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/shadow-dom/touch-event-ios-expected.txt [new file with mode: 0644]
LayoutTests/fast/shadow-dom/touch-event-ios.html [new file with mode: 0644]
LayoutTests/platform/mac/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/dom/EventContext.cpp
Source/WebCore/dom/EventContext.h
Source/WebCore/dom/EventDispatcher.cpp
Source/WebCore/dom/TouchEvent.h
Tools/ChangeLog
Tools/WebKitTestRunner/UIScriptContext/Bindings/UIScriptController.idl
Tools/WebKitTestRunner/UIScriptContext/UIScriptController.cpp
Tools/WebKitTestRunner/UIScriptContext/UIScriptController.h
Tools/WebKitTestRunner/ios/HIDEventGenerator.h
Tools/WebKitTestRunner/ios/HIDEventGenerator.mm
Tools/WebKitTestRunner/ios/UIScriptControllerIOS.mm