AX: Simulated touch events are not working on iOS
authorn_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Aug 2016 02:38:35 +0000 (02:38 +0000)
committern_wang@apple.com <n_wang@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Aug 2016 02:38:35 +0000 (02:38 +0000)
commit023baf5b32b375d35c62d5085986580e19b294f9
tree2548a17141cefc398092b537ff41245273454dd2
parent9c753bd75290b581b5b0f41d9f7a13fcfbb8989e
AX: Simulated touch events are not working on iOS
https://bugs.webkit.org/show_bug.cgi?id=160395
<rdar://problem/27633597>

Reviewed by Chris Fleizach.

Source/WebCore:

We should mark the simulated touch as a potential tap otherwise it won't
be handled on iOS. Also, we need to dispatch both touch start and touch end
to mimic the real touch events. Last, added a has event listeners check,
because iOS is dispatching mouse click events for elements without touch event
listeners.

Test: accessibility/ios-simulator/press-fires-touch-events.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::press):
(WebCore::AccessibilityObject::dispatchTouchEvent):
* page/ios/EventHandlerIOS.mm:
(WebCore::EventHandler::dispatchSimulatedTouchEvent):
* platform/ios/PlatformEventFactoryIOS.mm:
(WebCore::PlatformTouchEventBuilder::PlatformTouchEventBuilder):

Tools:

* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::press):
(WTR::AccessibilityUIElement::setSelectedChild):

LayoutTests:

* accessibility/ios-simulator/press-fires-touch-events-expected.txt: Added.
* accessibility/ios-simulator/press-fires-touch-events.html: Added.
* platform/ios-simulator-wk2/TestExpectations:
* platform/ios-simulator/ios/accessibility/press-fires-touch-events-expected.txt: Removed.
* platform/ios-simulator/ios/accessibility/press-fires-touch-events.html: Removed.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@204062 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/accessibility/ios-simulator/press-fires-touch-events-expected.txt [moved from LayoutTests/platform/ios-simulator/ios/accessibility/press-fires-touch-events-expected.txt with 100% similarity]
LayoutTests/accessibility/ios-simulator/press-fires-touch-events.html [moved from LayoutTests/platform/ios-simulator/ios/accessibility/press-fires-touch-events.html with 88% similarity]
LayoutTests/platform/ios-simulator-wk2/TestExpectations
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/page/ios/EventHandlerIOS.mm
Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm
Tools/ChangeLog
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm