Changeset 204062 in webkit


Ignore:
Timestamp:
Aug 2, 2016 7:38:35 PM (8 years ago)
Author:
n_wang@apple.com
Message:

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.
Location:
trunk
Files:
8 edited
2 moved

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r204058 r204062  
     12016-08-02  Nan Wang  <n_wang@apple.com>
     2
     3        AX: Simulated touch events are not working on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=160395
     5        <rdar://problem/27633597>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        * accessibility/ios-simulator/press-fires-touch-events-expected.txt: Added.
     10        * accessibility/ios-simulator/press-fires-touch-events.html: Added.
     11        * platform/ios-simulator-wk2/TestExpectations:
     12        * platform/ios-simulator/ios/accessibility/press-fires-touch-events-expected.txt: Removed.
     13        * platform/ios-simulator/ios/accessibility/press-fires-touch-events.html: Removed.
     14
    1152016-08-02  Saam Barati  <sbarati@apple.com>
    216
  • trunk/LayoutTests/accessibility/ios-simulator/press-fires-touch-events.html

    r204061 r204062  
    22<html>
    33<head>
    4 <script src="../../../../resources/js-test-pre.js"></script>
     4<script src="../../resources/js-test-pre.js"></script>
    55<script>
    66var successfullyParsed = false;
     
    4141</script>
    4242
    43 <script src="../../../../resources/js-test-post.js"></script>
     43<script src="../../resources/js-test-post.js"></script>
    4444
    4545</body>
  • trunk/LayoutTests/platform/ios-simulator-wk2/TestExpectations

    r204055 r204062  
    17951795fast/writing-mode/japanese-lr-selection.html [ Failure ]
    17961796fast/writing-mode/japanese-rl-selection.html [ Failure ]
    1797 platform/ios-simulator/ios/accessibility/press-fires-touch-events.html [ Failure ]
     1797accessibility/ios-simulator/press-fires-touch-events.html [ Skip ]
    17981798
    17991799fast/text/combining-character-sequence-vertical.html [ ImageOnlyFailure ]
  • trunk/Source/WebCore/ChangeLog

    r204061 r204062  
     12016-08-02  Nan Wang  <n_wang@apple.com>
     2
     3        AX: Simulated touch events are not working on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=160395
     5        <rdar://problem/27633597>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        We should mark the simulated touch as a potential tap otherwise it won't
     10        be handled on iOS. Also, we need to dispatch both touch start and touch end
     11        to mimic the real touch events. Last, added a has event listeners check,
     12        because iOS is dispatching mouse click events for elements without touch event
     13        listeners.
     14
     15        Test: accessibility/ios-simulator/press-fires-touch-events.html
     16
     17        * accessibility/AccessibilityObject.cpp:
     18        (WebCore::AccessibilityObject::press):
     19        (WebCore::AccessibilityObject::dispatchTouchEvent):
     20        * page/ios/EventHandlerIOS.mm:
     21        (WebCore::EventHandler::dispatchSimulatedTouchEvent):
     22        * platform/ios/PlatformEventFactoryIOS.mm:
     23        (WebCore::PlatformTouchEventBuilder::PlatformTouchEventBuilder):
     24
    1252016-08-02  Benjamin Poulain  <bpoulain@apple.com>
    226
  • trunk/Source/WebCore/accessibility/AccessibilityObject.cpp

    r203955 r204062  
    923923    UserGestureIndicator gestureIndicator(ProcessingUserGesture, document);
    924924   
    925     // FIXME: dispatchTouchEvent() is not dispatching the touch event correctly.
    926     bool dispatchedTouchEvent = dispatchTouchEvent();
     925    bool dispatchedTouchEvent = false;
     926#if PLATFORM(IOS)
     927    if (hasTouchEventListener())
     928        dispatchedTouchEvent = dispatchTouchEvent();
     929#endif
    927930    if (!dispatchedTouchEvent)
    928931        pressElement->accessKeyAction(true);
     
    939942        return false;
    940943
    941     frame->eventHandler().dispatchSimulatedTouchEvent(clickPoint());
     944    handled = frame->eventHandler().dispatchSimulatedTouchEvent(clickPoint());
    942945#endif
    943946    return handled;
  • trunk/Source/WebCore/page/ios/EventHandlerIOS.mm

    r201038 r204062  
    109109{
    110110    bool handled = handleTouchEvent(PlatformEventFactory::createPlatformSimulatedTouchEvent(PlatformEvent::TouchStart, location));
    111     if (handled)
    112         handleTouchEvent(PlatformEventFactory::createPlatformSimulatedTouchEvent(PlatformEvent::TouchEnd, location));
     111    handled |= handleTouchEvent(PlatformEventFactory::createPlatformSimulatedTouchEvent(PlatformEvent::TouchEnd, location));
    113112    return handled;
    114113}
  • trunk/Source/WebCore/platform/ios/PlatformEventFactoryIOS.mm

    r176904 r204062  
    273273        m_position = location;
    274274        m_globalPosition = location;
     275        m_isPotentialTap = true;
    275276       
    276277        unsigned touchCount = 1;
  • trunk/Tools/ChangeLog

    r204060 r204062  
     12016-08-02  Nan Wang  <n_wang@apple.com>
     2
     3        AX: Simulated touch events are not working on iOS
     4        https://bugs.webkit.org/show_bug.cgi?id=160395
     5        <rdar://problem/27633597>
     6
     7        Reviewed by Chris Fleizach.
     8
     9        * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
     10        (WTR::AccessibilityUIElement::press):
     11        (WTR::AccessibilityUIElement::setSelectedChild):
     12
    1132016-08-02  Filip Pizlo  <fpizlo@apple.com>
    214
  • trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm

    r203955 r204062  
    807807void AccessibilityUIElement::press()
    808808{
     809    [m_element _accessibilityActivate];
    809810}
    810811
Note: See TracChangeset for help on using the changeset viewer.