Diff
Modified: trunk/LayoutTests/ChangeLog (203954 => 203955)
--- trunk/LayoutTests/ChangeLog 2016-07-31 08:31:14 UTC (rev 203954)
+++ trunk/LayoutTests/ChangeLog 2016-07-31 20:02:54 UTC (rev 203955)
@@ -1,3 +1,13 @@
+2016-07-31 Nan Wang <n_w...@apple.com>
+
+ AX: Add a check for touch event listener on iOS accessibility object
+ https://bugs.webkit.org/show_bug.cgi?id=160388
+
+ Reviewed by Chris Fleizach.
+
+ * accessibility/ios-simulator/has-touch-event-listener-expected.txt: Added.
+ * accessibility/ios-simulator/has-touch-event-listener.html: Added.
+
2016-07-30 Mark Lam <mark....@apple.com>
Assertion failure while setting the length of an ArrayClass array.
Added: trunk/LayoutTests/accessibility/ios-simulator/has-touch-event-listener-expected.txt (0 => 203955)
--- trunk/LayoutTests/accessibility/ios-simulator/has-touch-event-listener-expected.txt (rev 0)
+++ trunk/LayoutTests/accessibility/ios-simulator/has-touch-event-listener-expected.txt 2016-07-31 20:02:54 UTC (rev 203955)
@@ -0,0 +1,13 @@
+button
+link
+Makes sure that we can check if an AXObject has touch event listener.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS button.boolAttributeValue('AXHasTouchEventListener') is true
+PASS link.boolAttributeValue('AXHasTouchEventListener') is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Added: trunk/LayoutTests/accessibility/ios-simulator/has-touch-event-listener.html (0 => 203955)
--- trunk/LayoutTests/accessibility/ios-simulator/has-touch-event-listener.html (rev 0)
+++ trunk/LayoutTests/accessibility/ios-simulator/has-touch-event-listener.html 2016-07-31 20:02:54 UTC (rev 203955)
@@ -0,0 +1,40 @@
+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script src=""
+<script>
+var successfullyParsed = false;
+if (window.testRunner)
+ testRunner.dumpAsText();
+
+function click() {}
+
+</script>
+</head>
+<body>
+
+<div role="button" id="button" _ontouchstart_="chick();"">button</div>
+<div role="link" _ontouchend_="chick();"><div id="link">link</div></div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script>
+
+ description("Makes sure that we can check if an AXObject has touch event listener.");
+
+ if (window.accessibilityController) {
+ var button = accessibilityController.accessibleElementById("button");
+ var link = accessibilityController.accessibleElementById("link");
+ shouldBeTrue("button.boolAttributeValue('AXHasTouchEventListener')");
+ shouldBeTrue("link.boolAttributeValue('AXHasTouchEventListener')");
+ }
+
+ successfullyParsed = true;
+</script>
+
+<script src=""
+
+</body>
+</html>
+
Modified: trunk/Source/WebCore/ChangeLog (203954 => 203955)
--- trunk/Source/WebCore/ChangeLog 2016-07-31 08:31:14 UTC (rev 203954)
+++ trunk/Source/WebCore/ChangeLog 2016-07-31 20:02:54 UTC (rev 203955)
@@ -1,3 +1,25 @@
+2016-07-31 Nan Wang <n_w...@apple.com>
+
+ AX: Add a check for touch event listener on iOS accessibility object
+ https://bugs.webkit.org/show_bug.cgi?id=160388
+
+ Reviewed by Chris Fleizach.
+
+ dispatchTouchEvent() is not working correctly within AXPress() sometimes. Need to
+ investigate it more in the future. Now, adding a check for the touch event listener
+ on the object's node so that iOS can handle dispatching the touch event instead.
+
+ Test: accessibility/ios-simulator/has-touch-event-listener.html
+
+ * accessibility/AccessibilityObject.h:
+ * accessibility/ios/AccessibilityObjectIOS.mm:
+ (WebCore::AccessibilityObject::accessibilityPlatformIncludesObject):
+ (WebCore::AccessibilityObject::hasTouchEventListener):
+ * accessibility/ios/WebAccessibilityObjectWrapperIOS.mm:
+ (appendStringToResult):
+ (-[WebAccessibilityObjectWrapper _accessibilityHasTouchEventListener]):
+ (-[WebAccessibilityObjectWrapper _accessibilityValueIsAutofilled]):
+
2016-07-30 Chris Dumez <cdu...@apple.com>
Unreviewed, rebaseline bindings tests.
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.cpp (203954 => 203955)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2016-07-31 08:31:14 UTC (rev 203954)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.cpp 2016-07-31 20:02:54 UTC (rev 203955)
@@ -922,6 +922,7 @@
UserGestureIndicator gestureIndicator(ProcessingUserGesture, document);
+ // FIXME: dispatchTouchEvent() is not dispatching the touch event correctly.
bool dispatchedTouchEvent = dispatchTouchEvent();
if (!dispatchedTouchEvent)
pressElement->accessKeyAction(true);
Modified: trunk/Source/WebCore/accessibility/AccessibilityObject.h (203954 => 203955)
--- trunk/Source/WebCore/accessibility/AccessibilityObject.h 2016-07-31 08:31:14 UTC (rev 203954)
+++ trunk/Source/WebCore/accessibility/AccessibilityObject.h 2016-07-31 20:02:54 UTC (rev 203955)
@@ -1040,6 +1040,7 @@
#if PLATFORM(IOS)
int accessibilityPasswordFieldLength();
+ bool hasTouchEventListener() const;
#endif
// allows for an AccessibilityObject to update its render tree or perform
Modified: trunk/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm (203954 => 203955)
--- trunk/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm 2016-07-31 08:31:14 UTC (rev 203954)
+++ trunk/Source/WebCore/accessibility/ios/AccessibilityObjectIOS.mm 2016-07-31 20:02:54 UTC (rev 203955)
@@ -26,6 +26,7 @@
#import "config.h"
#import "AccessibilityObject.h"
#import "AccessibilityRenderObject.h"
+#import "EventNames.h"
#import "HTMLInputElement.h"
#import "RenderObject.h"
#import "WAKView.h"
@@ -80,7 +81,16 @@
{
return DefaultBehavior;
}
-
+
+bool AccessibilityObject::hasTouchEventListener() const
+{
+ for (Node* node = this->node(); node; node = node->parentNode()) {
+ if (node->hasEventListeners(eventNames().touchstartEvent) || node->hasEventListeners(eventNames().touchendEvent))
+ return true;
+ }
+ return false;
+}
+
} // WebCore
#endif // HAVE(ACCESSIBILITY) && PLATFORM(IOS)
Modified: trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm (203954 => 203955)
--- trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm 2016-07-31 08:31:14 UTC (rev 203954)
+++ trunk/Source/WebCore/accessibility/ios/WebAccessibilityObjectWrapperIOS.mm 2016-07-31 20:02:54 UTC (rev 203955)
@@ -949,6 +949,14 @@
[result appendString:string];
}
+- (BOOL)_accessibilityHasTouchEventListener
+{
+ if (![self _prepareAccessibilityCall])
+ return NO;
+
+ return m_object->hasTouchEventListener();
+}
+
- (BOOL)_accessibilityValueIsAutofilled
{
if (![self _prepareAccessibilityCall])
Modified: trunk/Tools/ChangeLog (203954 => 203955)
--- trunk/Tools/ChangeLog 2016-07-31 08:31:14 UTC (rev 203954)
+++ trunk/Tools/ChangeLog 2016-07-31 20:02:54 UTC (rev 203955)
@@ -1,3 +1,15 @@
+2016-07-31 Nan Wang <n_w...@apple.com>
+
+ AX: Add a check for touch event listener on iOS accessibility object
+ https://bugs.webkit.org/show_bug.cgi?id=160388
+
+ Reviewed by Chris Fleizach.
+
+ * DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
+ (AccessibilityUIElement::boolAttributeValue):
+ * WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
+ (WTR::AccessibilityUIElement::boolAttributeValue):
+
2016-07-30 Manuel Rego Casasnovas <r...@igalia.com>
Unreviewed: add myself to the reviewers list.
Modified: trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm (203954 => 203955)
--- trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm 2016-07-31 08:31:14 UTC (rev 203954)
+++ trunk/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm 2016-07-31 20:02:54 UTC (rev 203955)
@@ -95,6 +95,7 @@
- (NSUInteger)accessibilityARIAColumnIndex;
- (UIAccessibilityTraits)_axContainedByFieldsetTrait;
- (id)_accessibilityFieldsetAncestor;
+- (BOOL)_accessibilityHasTouchEventListener;
// TextMarker related
- (NSArray *)textMarkerRange;
@@ -667,6 +668,8 @@
bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute)
{
+ if (JSStringIsEqualToUTF8CString(attribute, "AXHasTouchEventListener"))
+ return [m_element _accessibilityHasTouchEventListener];
return false;
}
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm (203954 => 203955)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm 2016-07-31 08:31:14 UTC (rev 203954)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm 2016-07-31 20:02:54 UTC (rev 203955)
@@ -72,6 +72,7 @@
- (NSUInteger)accessibilityARIAColumnIndex;
- (UIAccessibilityTraits)_axContainedByFieldsetTrait;
- (id)_accessibilityFieldsetAncestor;
+- (BOOL)_accessibilityHasTouchEventListener;
// TextMarker related
- (NSArray *)textMarkerRange;
@@ -379,6 +380,8 @@
bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute)
{
+ if (JSStringIsEqualToUTF8CString(attribute, "AXHasTouchEventListener"))
+ return [m_element _accessibilityHasTouchEventListener];
return false;
}