AX: Upstream iOS Accessibility DumpRenderTree changes
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2013 20:07:05 +0000 (20:07 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2013 20:07:05 +0000 (20:07 +0000)
https://bugs.webkit.org/show_bug.cgi?id=111220

Reviewed by David Kilzer.

Upstream the iOS changes for accessibility in DumpRenderTree.

* DumpRenderTree/AccessibilityUIElement.cpp:
(headerElementAtIndexCallback):
(linkedElementCallback):
(elementsForRangeCallback):
(increaseTextSelectionCallback):
(decreaseTextSelectionCallback):
(assistiveTechnologySimulatedFocusCallback):
(stringForSelectionCallback):
(getIPhoneLabelCallback):
(getIPhoneHintCallback):
(getIPhoneValueCallback):
(getIPhoneIdentifierCallback):
(getIPhoneTraitsCallback):
(getIPhoneIsElementCallback):
(getIPhoneElementTextPositionCallback):
(getIPhoneElementTextLengthCallback):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
(AccessibilityUIElement):
* DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
* DumpRenderTree/ios: Added.
* DumpRenderTree/ios/AccessibilityControllerIOS.mm: Added.
(AccessibilityController::AccessibilityController):
(AccessibilityController::~AccessibilityController):
(AccessibilityController::elementAtPoint):
(AccessibilityController::focusedElement):
(AccessibilityController::rootElement):
(findAccessibleObjectById):
(AccessibilityController::accessibleElementById):
(AccessibilityController::setLogFocusEvents):
(AccessibilityController::setLogScrollingStartEvents):
(AccessibilityController::setLogValueChangeEvents):
(AccessibilityController::setLogAccessibilityEvents):
(AccessibilityController::addNotificationListener):
(AccessibilityController::removeNotificationListener):
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm: Added.
(AccessibilityUIElement::AccessibilityUIElement):
(AccessibilityUIElement::~AccessibilityUIElement):
(concatenateAttributeAndValue):
(AccessibilityUIElement::iphoneLabel):
(AccessibilityUIElement::iphoneHint):
(AccessibilityUIElement::iphoneValue):
(AccessibilityUIElement::iphoneIdentifier):
(AccessibilityUIElement::iphoneTraits):
(AccessibilityUIElement::iphoneIsElement):
(AccessibilityUIElement::iphoneElementTextPosition):
(AccessibilityUIElement::iphoneElementTextLength):
(AccessibilityUIElement::url):
(AccessibilityUIElement::x):
(AccessibilityUIElement::y):
(AccessibilityUIElement::width):
(AccessibilityUIElement::height):
(AccessibilityUIElement::clickPointX):
(AccessibilityUIElement::clickPointY):
(AccessibilityUIElement::getChildren):
(AccessibilityUIElement::getChildrenWithRange):
(AccessibilityUIElement::childrenCount):
(AccessibilityUIElement::elementAtPoint):
(AccessibilityUIElement::indexOfChild):
(AccessibilityUIElement::getChildAtIndex):
(AccessibilityUIElement::headerElementAtIndex):
(AccessibilityUIElement::linkedElement):
(AccessibilityUIElement::linkedUIElementAtIndex):
(AccessibilityUIElement::ariaOwnsElementAtIndex):
(AccessibilityUIElement::ariaFlowToElementAtIndex):
(AccessibilityUIElement::disclosedRowAtIndex):
(AccessibilityUIElement::selectedRowAtIndex):
(AccessibilityUIElement::rowAtIndex):
(AccessibilityUIElement::titleUIElement):
(AccessibilityUIElement::parentElement):
(AccessibilityUIElement::disclosedByRow):
(AccessibilityUIElement::increaseTextSelection):
(AccessibilityUIElement::decreaseTextSelection):
(AccessibilityUIElement::stringForSelection):
(AccessibilityUIElement::stringForRange):
(AccessibilityUIElement::attributedStringForRange):
(AccessibilityUIElement::attributedStringRangeIsMisspelled):
(AccessibilityUIElement::elementsForRange):
(AccessibilityUIElement::getLinkedUIElements):
(AccessibilityUIElement::getDocumentLinks):
(AccessibilityUIElement::attributesOfLinkedUIElements):
(AccessibilityUIElement::attributesOfDocumentLinks):
(AccessibilityUIElement::attributesOfChildren):
(AccessibilityUIElement::allAttributes):
(AccessibilityUIElement::stringAttributeValue):
(AccessibilityUIElement::isPressActionSupported):
(AccessibilityUIElement::isIncrementActionSupported):
(AccessibilityUIElement::isDecrementActionSupported):
(AccessibilityUIElement::boolAttributeValue):
(AccessibilityUIElement::isAttributeSettable):
(AccessibilityUIElement::isAttributeSupported):
(AccessibilityUIElement::parameterizedAttributeNames):
(AccessibilityUIElement::role):
(AccessibilityUIElement::subrole):
(AccessibilityUIElement::roleDescription):
(AccessibilityUIElement::title):
(AccessibilityUIElement::description):
(AccessibilityUIElement::orientation):
(AccessibilityUIElement::stringValue):
(AccessibilityUIElement::language):
(AccessibilityUIElement::helpText):
(AccessibilityUIElement::intValue):
(AccessibilityUIElement::minValue):
(AccessibilityUIElement::maxValue):
(AccessibilityUIElement::valueDescription):
(AccessibilityUIElement::insertionPointLineNumber):
(AccessibilityUIElement::isEnabled):
(AccessibilityUIElement::isRequired):
(AccessibilityUIElement::isFocused):
(AccessibilityUIElement::isSelected):
(AccessibilityUIElement::isExpanded):
(AccessibilityUIElement::isChecked):
(AccessibilityUIElement::hierarchicalLevel):
(AccessibilityUIElement::ariaIsGrabbed):
(AccessibilityUIElement::ariaDropEffects):
(AccessibilityUIElement::lineForIndex):
(AccessibilityUIElement::boundsForRange):
(AccessibilityUIElement::attributesOfColumnHeaders):
(AccessibilityUIElement::attributesOfRowHeaders):
(AccessibilityUIElement::attributesOfColumns):
(AccessibilityUIElement::attributesOfRows):
(AccessibilityUIElement::attributesOfVisibleCells):
(AccessibilityUIElement::attributesOfHeader):
(AccessibilityUIElement::rowCount):
(AccessibilityUIElement::columnCount):
(AccessibilityUIElement::indexInTable):
(AccessibilityUIElement::rowIndexRange):
(AccessibilityUIElement::columnIndexRange):
(AccessibilityUIElement::cellForColumnAndRow):
(AccessibilityUIElement::selectedTextRange):
(AccessibilityUIElement::assistiveTechnologySimulatedFocus):
(AccessibilityUIElement::setSelectedTextRange):
(AccessibilityUIElement::increment):
(AccessibilityUIElement::decrement):
(AccessibilityUIElement::showMenu):
(AccessibilityUIElement::press):
(AccessibilityUIElement::accessibilityValue):
(AccessibilityUIElement::documentEncoding):
(AccessibilityUIElement::documentURI):
(_accessibilityNotificationCallback):
(AccessibilityUIElement::addNotificationListener):
(AccessibilityUIElement::removeNotificationListener):
(AccessibilityUIElement::isFocusable):
(AccessibilityUIElement::isSelectable):
(AccessibilityUIElement::isMultiSelectable):
(AccessibilityUIElement::isSelectedOptionActive):
(AccessibilityUIElement::isVisible):
(AccessibilityUIElement::isOffScreen):
(AccessibilityUIElement::isCollapsed):
(AccessibilityUIElement::isIgnored):
(AccessibilityUIElement::hasPopup):
(AccessibilityUIElement::takeFocus):
(AccessibilityUIElement::takeSelection):
(AccessibilityUIElement::addSelection):
(AccessibilityUIElement::removeSelection):
(AccessibilityUIElement::uiElementForSearchPredicate):
(AccessibilityUIElement::numberAttributeValue):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@144657 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityUIElement.cpp
Tools/DumpRenderTree/AccessibilityUIElement.h
Tools/DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj
Tools/DumpRenderTree/ios/AccessibilityControllerIOS.mm [new file with mode: 0644]
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm [new file with mode: 0644]

index f168bf66ae23b3169b7365d3a51fec38b9ed2380..b0758d3bd715198a4702aadd040100c00c947d18 100644 (file)
@@ -1,3 +1,170 @@
+2013-03-04  Chris Fleizach  <cfleizach@apple.com>
+
+        AX: Upstream iOS Accessibility DumpRenderTree changes
+        https://bugs.webkit.org/show_bug.cgi?id=111220
+
+        Reviewed by David Kilzer.
+
+        Upstream the iOS changes for accessibility in DumpRenderTree.
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (headerElementAtIndexCallback):
+        (linkedElementCallback):
+        (elementsForRangeCallback):
+        (increaseTextSelectionCallback):
+        (decreaseTextSelectionCallback):
+        (assistiveTechnologySimulatedFocusCallback):
+        (stringForSelectionCallback):
+        (getIPhoneLabelCallback):
+        (getIPhoneHintCallback):
+        (getIPhoneValueCallback):
+        (getIPhoneIdentifierCallback):
+        (getIPhoneTraitsCallback):
+        (getIPhoneIsElementCallback):
+        (getIPhoneElementTextPositionCallback):
+        (getIPhoneElementTextLengthCallback):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        (AccessibilityUIElement):
+        * DumpRenderTree/DumpRenderTree.xcodeproj/project.pbxproj:
+        * DumpRenderTree/ios: Added.
+        * DumpRenderTree/ios/AccessibilityControllerIOS.mm: Added.
+        (AccessibilityController::AccessibilityController):
+        (AccessibilityController::~AccessibilityController):
+        (AccessibilityController::elementAtPoint):
+        (AccessibilityController::focusedElement):
+        (AccessibilityController::rootElement):
+        (findAccessibleObjectById):
+        (AccessibilityController::accessibleElementById):
+        (AccessibilityController::setLogFocusEvents):
+        (AccessibilityController::setLogScrollingStartEvents):
+        (AccessibilityController::setLogValueChangeEvents):
+        (AccessibilityController::setLogAccessibilityEvents):
+        (AccessibilityController::addNotificationListener):
+        (AccessibilityController::removeNotificationListener):
+        * DumpRenderTree/ios/AccessibilityUIElementIOS.mm: Added.
+        (AccessibilityUIElement::AccessibilityUIElement):
+        (AccessibilityUIElement::~AccessibilityUIElement):
+        (concatenateAttributeAndValue):
+        (AccessibilityUIElement::iphoneLabel):
+        (AccessibilityUIElement::iphoneHint):
+        (AccessibilityUIElement::iphoneValue):
+        (AccessibilityUIElement::iphoneIdentifier):
+        (AccessibilityUIElement::iphoneTraits):
+        (AccessibilityUIElement::iphoneIsElement):
+        (AccessibilityUIElement::iphoneElementTextPosition):
+        (AccessibilityUIElement::iphoneElementTextLength):
+        (AccessibilityUIElement::url):
+        (AccessibilityUIElement::x):
+        (AccessibilityUIElement::y):
+        (AccessibilityUIElement::width):
+        (AccessibilityUIElement::height):
+        (AccessibilityUIElement::clickPointX):
+        (AccessibilityUIElement::clickPointY):
+        (AccessibilityUIElement::getChildren):
+        (AccessibilityUIElement::getChildrenWithRange):
+        (AccessibilityUIElement::childrenCount):
+        (AccessibilityUIElement::elementAtPoint):
+        (AccessibilityUIElement::indexOfChild):
+        (AccessibilityUIElement::getChildAtIndex):
+        (AccessibilityUIElement::headerElementAtIndex):
+        (AccessibilityUIElement::linkedElement):
+        (AccessibilityUIElement::linkedUIElementAtIndex):
+        (AccessibilityUIElement::ariaOwnsElementAtIndex):
+        (AccessibilityUIElement::ariaFlowToElementAtIndex):
+        (AccessibilityUIElement::disclosedRowAtIndex):
+        (AccessibilityUIElement::selectedRowAtIndex):
+        (AccessibilityUIElement::rowAtIndex):
+        (AccessibilityUIElement::titleUIElement):
+        (AccessibilityUIElement::parentElement):
+        (AccessibilityUIElement::disclosedByRow):
+        (AccessibilityUIElement::increaseTextSelection):
+        (AccessibilityUIElement::decreaseTextSelection):
+        (AccessibilityUIElement::stringForSelection):
+        (AccessibilityUIElement::stringForRange):
+        (AccessibilityUIElement::attributedStringForRange):
+        (AccessibilityUIElement::attributedStringRangeIsMisspelled):
+        (AccessibilityUIElement::elementsForRange):
+        (AccessibilityUIElement::getLinkedUIElements):
+        (AccessibilityUIElement::getDocumentLinks):
+        (AccessibilityUIElement::attributesOfLinkedUIElements):
+        (AccessibilityUIElement::attributesOfDocumentLinks):
+        (AccessibilityUIElement::attributesOfChildren):
+        (AccessibilityUIElement::allAttributes):
+        (AccessibilityUIElement::stringAttributeValue):
+        (AccessibilityUIElement::isPressActionSupported):
+        (AccessibilityUIElement::isIncrementActionSupported):
+        (AccessibilityUIElement::isDecrementActionSupported):
+        (AccessibilityUIElement::boolAttributeValue):
+        (AccessibilityUIElement::isAttributeSettable):
+        (AccessibilityUIElement::isAttributeSupported):
+        (AccessibilityUIElement::parameterizedAttributeNames):
+        (AccessibilityUIElement::role):
+        (AccessibilityUIElement::subrole):
+        (AccessibilityUIElement::roleDescription):
+        (AccessibilityUIElement::title):
+        (AccessibilityUIElement::description):
+        (AccessibilityUIElement::orientation):
+        (AccessibilityUIElement::stringValue):
+        (AccessibilityUIElement::language):
+        (AccessibilityUIElement::helpText):
+        (AccessibilityUIElement::intValue):
+        (AccessibilityUIElement::minValue):
+        (AccessibilityUIElement::maxValue):
+        (AccessibilityUIElement::valueDescription):
+        (AccessibilityUIElement::insertionPointLineNumber):
+        (AccessibilityUIElement::isEnabled):
+        (AccessibilityUIElement::isRequired):
+        (AccessibilityUIElement::isFocused):
+        (AccessibilityUIElement::isSelected):
+        (AccessibilityUIElement::isExpanded):
+        (AccessibilityUIElement::isChecked):
+        (AccessibilityUIElement::hierarchicalLevel):
+        (AccessibilityUIElement::ariaIsGrabbed):
+        (AccessibilityUIElement::ariaDropEffects):
+        (AccessibilityUIElement::lineForIndex):
+        (AccessibilityUIElement::boundsForRange):
+        (AccessibilityUIElement::attributesOfColumnHeaders):
+        (AccessibilityUIElement::attributesOfRowHeaders):
+        (AccessibilityUIElement::attributesOfColumns):
+        (AccessibilityUIElement::attributesOfRows):
+        (AccessibilityUIElement::attributesOfVisibleCells):
+        (AccessibilityUIElement::attributesOfHeader):
+        (AccessibilityUIElement::rowCount):
+        (AccessibilityUIElement::columnCount):
+        (AccessibilityUIElement::indexInTable):
+        (AccessibilityUIElement::rowIndexRange):
+        (AccessibilityUIElement::columnIndexRange):
+        (AccessibilityUIElement::cellForColumnAndRow):
+        (AccessibilityUIElement::selectedTextRange):
+        (AccessibilityUIElement::assistiveTechnologySimulatedFocus):
+        (AccessibilityUIElement::setSelectedTextRange):
+        (AccessibilityUIElement::increment):
+        (AccessibilityUIElement::decrement):
+        (AccessibilityUIElement::showMenu):
+        (AccessibilityUIElement::press):
+        (AccessibilityUIElement::accessibilityValue):
+        (AccessibilityUIElement::documentEncoding):
+        (AccessibilityUIElement::documentURI):
+        (_accessibilityNotificationCallback):
+        (AccessibilityUIElement::addNotificationListener):
+        (AccessibilityUIElement::removeNotificationListener):
+        (AccessibilityUIElement::isFocusable):
+        (AccessibilityUIElement::isSelectable):
+        (AccessibilityUIElement::isMultiSelectable):
+        (AccessibilityUIElement::isSelectedOptionActive):
+        (AccessibilityUIElement::isVisible):
+        (AccessibilityUIElement::isOffScreen):
+        (AccessibilityUIElement::isCollapsed):
+        (AccessibilityUIElement::isIgnored):
+        (AccessibilityUIElement::hasPopup):
+        (AccessibilityUIElement::takeFocus):
+        (AccessibilityUIElement::takeSelection):
+        (AccessibilityUIElement::addSelection):
+        (AccessibilityUIElement::removeSelection):
+        (AccessibilityUIElement::uiElementForSearchPredicate):
+        (AccessibilityUIElement::numberAttributeValue):
+
 2013-03-04  Jochen Eisinger  <jochen@chromium.org>
 
         [chromium] pass all focus handling methods through the WebTestDelegate
index 818a1a872fe109f65847260a728f1c371f5def5e..4b84bdfcd51a38fd772043b6f3f57450527f79a5 100644 (file)
@@ -233,6 +233,61 @@ static JSValueRef indexOfChildCallback(JSContextRef context, JSObjectRef functio
     return JSValueMakeNumber(context, (double)toAXElement(thisObject)->indexOfChild(childElement));
 }
 
+#if PLATFORM(IOS)
+
+static JSValueRef headerElementAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount != 1)
+        return 0;
+    
+    unsigned index = JSValueToNumber(context, arguments[0], exception);
+    return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->headerElementAtIndex(index));
+}
+
+static JSValueRef linkedElementCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->linkedElement());
+}
+
+static JSValueRef elementsForRangeCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    if (argumentCount != 2)
+        return 0;
+    
+    unsigned location = JSValueToNumber(context, arguments[0], exception);
+    unsigned length = JSValueToNumber(context, arguments[1], exception);
+    
+    Vector<AccessibilityUIElement> elements;
+    toAXElement(thisObject)->elementsForRange(location, length, elements);
+    
+    unsigned elementsSize = elements.size();
+    JSValueRef valueElements[elementsSize];
+    for (unsigned k = 0; k < elementsSize; ++k)
+        valueElements[k] = AccessibilityUIElement::makeJSAccessibilityUIElement(context, elements[k]);
+    
+    return JSObjectMakeArray(context, elementsSize, valueElements, 0);
+}
+
+static JSValueRef increaseTextSelectionCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    toAXElement(thisObject)->increaseTextSelection();
+    return JSValueMakeUndefined(context);
+}
+
+static JSValueRef decreaseTextSelectionCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    toAXElement(thisObject)->decreaseTextSelection();
+    return JSValueMakeUndefined(context);
+}
+
+static JSValueRef assistiveTechnologySimulatedFocusCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
+{
+    toAXElement(thisObject)->assistiveTechnologySimulatedFocus();
+    return JSValueMakeUndefined(context);
+}
+
+#endif
+
 static JSValueRef childAtIndexCallback(JSContextRef context, JSObjectRef function, JSObjectRef thisObject, size_t argumentCount, const JSValueRef arguments[], JSValueRef* exception)
 {
     int indexNumber = -1;
@@ -949,10 +1004,66 @@ static JSValueRef removeNotificationListenerCallback(JSContextRef context, JSObj
     return JSValueMakeUndefined(context);
 }
 
+#if PLATFORM(IOS)
+
+static JSValueRef stringForSelectionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    JSRetainPtr<JSStringRef> labelString(Adopt, toAXElement(thisObject)->stringForSelection());
+    return JSValueMakeString(context, labelString.get());
+}
+
+static JSValueRef getIPhoneLabelCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    JSRetainPtr<JSStringRef> labelString(Adopt, toAXElement(thisObject)->iphoneLabel());
+    return JSValueMakeString(context, labelString.get());
+}
+
+static JSValueRef getIPhoneHintCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    JSRetainPtr<JSStringRef> hintString(Adopt, toAXElement(thisObject)->iphoneHint());
+    return JSValueMakeString(context, hintString.get());
+}
+
+static JSValueRef getIPhoneValueCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    JSRetainPtr<JSStringRef> valueString(Adopt, toAXElement(thisObject)->iphoneValue());
+    return JSValueMakeString(context, valueString.get());
+}
+
+static JSValueRef getIPhoneIdentifierCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    JSRetainPtr<JSStringRef> valueString(Adopt, toAXElement(thisObject)->iphoneIdentifier());
+    return JSValueMakeString(context, valueString.get());
+}
+
+
+static JSValueRef getIPhoneTraitsCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    JSRetainPtr<JSStringRef> valueString(Adopt, toAXElement(thisObject)->iphoneTraits());
+    return JSValueMakeString(context, valueString.get());
+}
+
+static JSValueRef getIPhoneIsElementCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    return JSValueMakeBoolean(context, toAXElement(thisObject)->iphoneIsElement());
+}
+
+static JSValueRef getIPhoneElementTextPositionCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    return JSValueMakeNumber(context, toAXElement(thisObject)->iphoneElementTextPosition());
+}
+
+static JSValueRef getIPhoneElementTextLengthCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    return JSValueMakeNumber(context, toAXElement(thisObject)->iphoneElementTextLength());
+}
+
+#endif // PLATFORM(IOS)
+
 // Implementation
 
 // Unsupported methods on various platforms.
-#if !PLATFORM(MAC)
+#if !PLATFORM(MAC) || PLATFORM(IOS)
 JSStringRef AccessibilityUIElement::speak() { return 0; }
 JSStringRef AccessibilityUIElement::rangeForLine(int line) { return 0; }
 JSStringRef AccessibilityUIElement::rangeForPosition(int, int) { return 0; }
@@ -1115,6 +1226,17 @@ JSClassRef AccessibilityUIElement::getJSClass()
         { "selectedChildrenCount", selectedChildrenCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "horizontalScrollbar", horizontalScrollbarCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "verticalScrollbar", verticalScrollbarCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+#if PLATFORM(IOS)
+        { "iphoneLabel", getIPhoneLabelCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "iphoneHint", getIPhoneHintCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "iphoneValue", getIPhoneValueCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "iphoneIdentifier", getIPhoneIdentifierCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "iphoneTraits", getIPhoneTraitsCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "iphoneIsElement", getIPhoneIsElementCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "iphoneElementTextPosition", getIPhoneElementTextPositionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "iphoneElementTextLength", getIPhoneElementTextLengthCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "stringForSelection", stringForSelectionCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+#endif // PLATFORM(IOS)
         { 0, 0, 0, 0 }
     };
 
@@ -1192,6 +1314,15 @@ JSClassRef AccessibilityUIElement::getJSClass()
         { "setSelectedChild", setSelectedChildCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "selectedChildAtIndex", selectedChildAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "scrollToMakeVisible", scrollToMakeVisibleCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+#if PLATFORM(IOS)
+        { "linkedElement", linkedElementCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "headerElementAtIndex", headerElementAtIndexCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "elementsForRange", elementsForRangeCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "increaseTextSelection", increaseTextSelectionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "decreaseTextSelection", decreaseTextSelectionCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "assistiveTechnologySimulatedFocus", assistiveTechnologySimulatedFocusCallback, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        
+#endif
         { 0, 0, 0 }
     };
 
index d41cef5aa79f24960b07d083b7b9a61092e12a6d..3174be23e79e1382d8fcdea90c04d5977f9b563e 100644 (file)
@@ -200,7 +200,14 @@ public:
     JSStringRef attributedStringForRange(unsigned location, unsigned length);
     bool attributedStringRangeIsMisspelled(unsigned location, unsigned length);
     AccessibilityUIElement uiElementForSearchPredicate(AccessibilityUIElement* startElement, bool isDirectionNext, JSStringRef searchKey, JSStringRef searchText);
-    
+#if PLATFORM(IOS)
+    void elementsForRange(unsigned location, unsigned length, Vector<AccessibilityUIElement>& elements);
+    JSStringRef stringForSelection();
+    void increaseTextSelection();
+    void decreaseTextSelection();
+    AccessibilityUIElement linkedElement();
+#endif
+
     // Table-specific
     AccessibilityUIElement cellForColumnAndRow(unsigned column, unsigned row);
 
@@ -234,6 +241,20 @@ public:
     // Make sure you call remove, because you can't rely on objects being deallocated in a timely fashion.
     void removeNotificationListener();
     
+#if PLATFORM(IOS)
+    JSStringRef iphoneLabel();
+    JSStringRef iphoneValue();
+    JSStringRef iphoneTraits();
+    JSStringRef iphoneHint();
+    JSStringRef iphoneIdentifier();
+    bool iphoneIsElement();
+    int iphoneElementTextPosition();
+    int iphoneElementTextLength();
+    AccessibilityUIElement headerElementAtIndex(unsigned);
+    // This will simulate the accessibilityDidBecomeFocused API in UIKit.
+    void assistiveTechnologySimulatedFocus();
+#endif // PLATFORM(IOS)
+
 private:
     static JSClassRef getJSClass();
     PlatformUIElement m_element;
index 64319997be257633cf4f3c2baf651d06f20f8f27..49a9978e07b90e92b7b5f25a1fb7791f0681ebda 100644 (file)
                A8B91BFF0CF522B4008F91FF /* CheckedMalloc.h in Headers */ = {isa = PBXBuildFile; fileRef = A8B91BF90CF522B4008F91FF /* CheckedMalloc.h */; };
                A8D79CEA0FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.h in Headers */ = {isa = PBXBuildFile; fileRef = A8D79CE80FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.h */; };
                A8D79CEB0FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m in Sources */ = {isa = PBXBuildFile; fileRef = A8D79CE90FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m */; };
+               AA5A15EF16E15CD000F7C561 /* AccessibilityControllerIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = AA5A15ED16E15CD000F7C561 /* AccessibilityControllerIOS.mm */; };
+               AA5A15F016E15CD000F7C561 /* AccessibilityUIElementIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = AA5A15EE16E15CD000F7C561 /* AccessibilityUIElementIOS.mm */; };
                AE8259F308D22463000507AB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; };
                AE8259F408D22463000507AB /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = AE8257EF08D22389000507AB /* Carbon.framework */; };
                B5A752A208AF5D1F00138E45 /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B5A752A108AF5D1F00138E45 /* QuartzCore.framework */; };
                A8B91BF90CF522B4008F91FF /* CheckedMalloc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = CheckedMalloc.h; path = mac/CheckedMalloc.h; sourceTree = "<group>"; };
                A8D79CE80FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DumpRenderTreeFileDraggingSource.h; sourceTree = "<group>"; };
                A8D79CE90FC28B2C004AC8FE /* DumpRenderTreeFileDraggingSource.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = DumpRenderTreeFileDraggingSource.m; sourceTree = "<group>"; };
+               AA5A15ED16E15CD000F7C561 /* AccessibilityControllerIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityControllerIOS.mm; path = ios/AccessibilityControllerIOS.mm; sourceTree = "<group>"; };
+               AA5A15EE16E15CD000F7C561 /* AccessibilityUIElementIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityUIElementIOS.mm; path = ios/AccessibilityUIElementIOS.mm; sourceTree = "<group>"; };
                AA7F10C20CB3C1030003BDC9 /* AHEM____.TTF */ = {isa = PBXFileReference; lastKnownFileType = file; name = "AHEM____.TTF"; path = "qt/fonts/AHEM____.TTF"; sourceTree = "<group>"; };
                AE8257EF08D22389000507AB /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
                B5A7526708AF4A4A00138E45 /* ImageDiff */ = {isa = PBXFileReference; explicitFileType = "compiled.mach-o.executable"; includeInIndex = 0; path = ImageDiff; sourceTree = BUILT_PRODUCTS_DIR; };
                                BC0E26140E2DA4C6001B6BC3 /* AccessibilityCommonMac.mm */,
                                BCD08B390E1057EF00A7D0C1 /* AccessibilityController.cpp */,
                                BCD08A580E10496B00A7D0C1 /* AccessibilityController.h */,
+                               AA5A15ED16E15CD000F7C561 /* AccessibilityControllerIOS.mm */,
                                BCD08B700E1059D200A7D0C1 /* AccessibilityControllerMac.mm */,
                                80045AEB147718E7008290A8 /* AccessibilityNotificationHandler.h */,
                                80045AEC147718E7008290A8 /* AccessibilityNotificationHandler.mm */,
                                29CFBA2D12273A1000BC30C0 /* AccessibilityTextMarkerMac.mm */,
                                BC0E24DF0E2D9451001B6BC2 /* AccessibilityUIElement.cpp */,
                                BC0E24DE0E2D9451001B6BC2 /* AccessibilityUIElement.h */,
+                               AA5A15EE16E15CD000F7C561 /* AccessibilityUIElementIOS.mm */,
                                BC0E26140E2DA4C6001B6BC2 /* AccessibilityUIElementMac.mm */,
                                BCA18B360C9B021900114369 /* AppleScriptController.h */,
                                BCA18B370C9B021900114369 /* AppleScriptController.m */,
 /* Begin PBXProject section */
                08FB7793FE84155DC02AAC07 /* Project object */ = {
                        isa = PBXProject;
+                       attributes = {
+                       };
                        buildConfigurationList = 149C29C308902C6D008A9EFC /* Build configuration list for PBXProject "DumpRenderTree" */;
                        compatibilityVersion = "Xcode 2.4";
                        developmentRegion = English;
                                BCA18B640C9B08C200114369 /* FrameLoadDelegate.mm in Sources */,
                                BCF6C6500C98E9C000AC063E /* GCController.cpp in Sources */,
                                BCA18B230C9B014B00114369 /* GCControllerMac.mm in Sources */,
+                               AA5A15EF16E15CD000F7C561 /* AccessibilityControllerIOS.mm in Sources */,
                                5185F6B210714E07007AA393 /* HistoryDelegate.mm in Sources */,
                                BC4741410D038A570072B006 /* JavaScriptThreadingPthreads.cpp in Sources */,
                                E1B7816511AF31B7007E1BC2 /* MockGeolocationProvider.mm in Sources */,
                                BCB284CD0CFA83C8007E533E /* PixelDumpSupportCG.cpp in Sources */,
                                BCB284D60CFA83D1007E533E /* PixelDumpSupportMac.mm in Sources */,
                                BCA18B660C9B08C200114369 /* PolicyDelegate.mm in Sources */,
+                               AA5A15F016E15CD000F7C561 /* AccessibilityUIElementIOS.mm in Sources */,
                                BCA18B680C9B08C200114369 /* ResourceLoadDelegate.mm in Sources */,
                                3A5626CB131CA02A002BE6D9 /* StorageTrackerDelegate.mm in Sources */,
                                BC0131DA0C9772010087317D /* TestRunner.cpp in Sources */,
diff --git a/Tools/DumpRenderTree/ios/AccessibilityControllerIOS.mm b/Tools/DumpRenderTree/ios/AccessibilityControllerIOS.mm
new file mode 100644 (file)
index 0000000..202dcf6
--- /dev/null
@@ -0,0 +1,128 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import "config.h"
+#import "DumpRenderTree.h"
+#import "AccessibilityController.h"
+
+#if PLATFORM(IOS)
+
+#import "AccessibilityUIElement.h"
+#import <Foundation/Foundation.h>
+#import <WebKit/WebFramePrivate.h>
+#import <WebKit/WebHTMLViewPrivate.h>
+
+@interface WebHTMLView (Private)
+- (id)accessibilityFocusedUIElement;
+@end
+
+AccessibilityController::AccessibilityController()
+{
+}
+
+AccessibilityController::~AccessibilityController()
+{
+}
+
+AccessibilityUIElement AccessibilityController::elementAtPoint(int x, int y)
+{
+    // FIXME: implement
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityController::focusedElement()
+{
+    id webDocumentView = [[mainFrame frameView] documentView];
+    if ([webDocumentView isKindOfClass:[WebHTMLView class]])
+        return AccessibilityUIElement([(WebHTMLView *)webDocumentView accessibilityFocusedUIElement]);
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityController::rootElement()
+{
+    // FIXME: we could do some caching here.
+    id webDocumentView = [[mainFrame frameView] documentView];
+    if ([webDocumentView isKindOfClass:[WebHTMLView class]])
+        return AccessibilityUIElement([(WebHTMLView *)webDocumentView accessibilityRootElement]);
+    return 0;
+}
+
+static id findAccessibleObjectById(id obj, NSString *idAttribute)
+{
+    id objIdAttribute = [obj accessibilityIdentifier];
+    if ([objIdAttribute isKindOfClass:[NSString class]] && [objIdAttribute isEqualToString:idAttribute])
+        return obj;
+    
+    NSUInteger childrenCount = [obj accessibilityElementCount];
+    for (NSUInteger i = 0; i < childrenCount; ++i) {
+        id result = findAccessibleObjectById([obj accessibilityElementAtIndex:i], idAttribute);
+        if (result)
+            return result;
+    }
+    
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityController::accessibleElementById(JSStringRef idAttributeRef)
+{
+    id webDocumentView = [[mainFrame frameView] documentView];
+    if (![webDocumentView isKindOfClass:[WebHTMLView class]])
+        return 0;
+    
+    id root = [(WebHTMLView *)webDocumentView accessibilityRootElement];
+    NSString *idAttribute = [NSString stringWithJSStringRef:idAttributeRef];
+    id result = findAccessibleObjectById(root, idAttribute);
+    if (result)
+        return AccessibilityUIElement(result);
+    
+    return 0;
+}
+
+void AccessibilityController::setLogFocusEvents(bool)
+{
+}
+
+void AccessibilityController::setLogScrollingStartEvents(bool)
+{
+}
+
+void AccessibilityController::setLogValueChangeEvents(bool)
+{
+}
+
+void AccessibilityController::setLogAccessibilityEvents(bool)
+{
+}
+
+bool AccessibilityController::addNotificationListener(JSObjectRef functionCallback)
+{
+    return false;
+}
+
+void AccessibilityController::removeNotificationListener()
+{
+}
+
+#endif // PLATFORM(IOS)
diff --git a/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm b/Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
new file mode 100644 (file)
index 0000000..0f0fa49
--- /dev/null
@@ -0,0 +1,768 @@
+/*
+ * Copyright (C) 2009 Apple Inc. All Rights Reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import "config.h"
+#import "DumpRenderTree.h"
+#import "AccessibilityUIElement.h"
+
+#import "AccessibilityCommonMac.h"
+#import <Foundation/Foundation.h>
+#import <JavaScriptCore/JSRetainPtr.h>
+#import <JavaScriptCore/JSStringRef.h>
+#import <JavaScriptCore/JSStringRefCF.h>
+#import <WebCore/TextGranularity.h>
+#import <WebKit/WebFrame.h>
+#import <WebKit/WebHTMLView.h>
+#import <WebKit/WebTypesInternal.h>
+#import <wtf/RetainPtr.h>
+#import <wtf/Vector.h>
+
+#if PLATFORM(IOS)
+
+#import <UIKit/UIKit.h>
+
+typedef void (*AXPostedNotificationCallback)(id element, NSString* notification, void* context);
+
+AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
+    : m_element(element)
+{
+    [m_element retain];
+}
+
+AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other)
+    : m_element(other.m_element)
+{
+    [m_element retain];
+}
+
+AccessibilityUIElement::~AccessibilityUIElement()
+{
+    [m_element release];
+}
+
+@interface NSObject (UIAccessibilityHidden)
+- (id)accessibilityHitTest:(CGPoint)point;
+- (id)accessibilityLinkedElement;
+- (NSRange)accessibilityColumnRange;
+- (NSRange)accessibilityRowRange;
+- (id)accessibilityElementForRow:(NSInteger)row andColumn:(NSInteger)column;
+- (NSURL *)accessibilityURL;
+- (NSArray *)accessibilityHeaderElements;
+- (NSString *)accessibilityPlaceholderValue;
+- (NSString *)stringForRange:(NSRange)range;
+- (NSArray *)elementsForRange:(NSRange)range;
+- (NSString *)selectionRangeString;
+- (void)accessibilityModifySelection:(WebCore::TextGranularity)granularity increase:(BOOL)increase;
+- (void)accessibilitySetPostedNotificationCallback:(AXPostedNotificationCallback)function withContext:(void*)context;
+@end
+
+static JSStringRef concatenateAttributeAndValue(NSString* attribute, NSString* value)
+{
+    Vector<UniChar> buffer([attribute length]);
+    [attribute getCharacters:buffer.data()];
+    buffer.append(':');
+    buffer.append(' ');
+    
+    Vector<UniChar> valueBuffer([value length]);
+    [value getCharacters:valueBuffer.data()];
+    buffer.append(valueBuffer);
+    
+    return JSStringCreateWithCharacters(buffer.data(), buffer.size());
+}
+
+#pragma mark iPhone Attributes
+
+JSStringRef AccessibilityUIElement::iphoneLabel()
+{
+    return concatenateAttributeAndValue(@"AXLabel", [m_element accessibilityLabel]);
+}
+
+JSStringRef AccessibilityUIElement::iphoneHint()
+{
+    return concatenateAttributeAndValue(@"AXHint", [m_element accessibilityHint]);
+}
+
+JSStringRef AccessibilityUIElement::iphoneValue()
+{
+    return concatenateAttributeAndValue(@"AXValue", [m_element accessibilityValue]);
+}
+
+JSStringRef AccessibilityUIElement::iphoneIdentifier()
+{
+    return concatenateAttributeAndValue(@"AXIdentifier", [m_element accessibilityIdentifier]);
+}
+
+JSStringRef AccessibilityUIElement::iphoneTraits()
+{
+    return concatenateAttributeAndValue(@"AXTraits", [NSString stringWithFormat:@"%qu", [m_element accessibilityTraits]]);
+}
+
+bool AccessibilityUIElement::iphoneIsElement()
+{
+    return [m_element isAccessibilityElement];
+}
+
+int AccessibilityUIElement::iphoneElementTextPosition()
+{
+    NSRange range = [[m_element valueForKey:@"elementTextRange"] rangeValue];
+    return range.location;
+}
+
+int AccessibilityUIElement::iphoneElementTextLength()
+{
+    NSRange range = [[m_element valueForKey:@"elementTextRange"] rangeValue];
+    return range.length;    
+}
+
+JSStringRef AccessibilityUIElement::url()
+{
+    NSURL *url = [m_element accessibilityURL];
+    return [[url absoluteString] createJSStringRef];    
+}
+
+double AccessibilityUIElement::x()
+{
+    CGRect frame = [m_element accessibilityFrame];
+    return frame.origin.x;
+}
+
+double AccessibilityUIElement::y()
+{
+    CGRect frame = [m_element accessibilityFrame];
+    return frame.origin.y;
+}
+
+double AccessibilityUIElement::width()
+{
+    CGRect frame = [m_element accessibilityFrame];
+    return frame.size.width;
+}
+
+double AccessibilityUIElement::height()
+{
+    CGRect frame = [m_element accessibilityFrame];
+    return frame.size.height;
+}
+
+double AccessibilityUIElement::clickPointX()
+{
+    CGPoint centerPoint = [m_element accessibilityActivationPoint];
+    return centerPoint.x;
+}
+
+double AccessibilityUIElement::clickPointY()
+{
+    CGPoint centerPoint = [m_element accessibilityActivationPoint];
+    return centerPoint.y;
+}
+
+void AccessibilityUIElement::getChildren(Vector<AccessibilityUIElement>& elementVector)
+{
+    NSInteger childCount = [m_element accessibilityElementCount];
+    for (NSInteger k = 0; k < childCount; ++k)
+        elementVector.append(AccessibilityUIElement([m_element accessibilityElementAtIndex:k]));
+}
+
+void AccessibilityUIElement::getChildrenWithRange(Vector<AccessibilityUIElement>& elementVector, unsigned location, unsigned length)
+{
+    NSUInteger childCount = [m_element accessibilityElementCount];
+    for (NSUInteger k = location; k < childCount && k < (location+length); ++k)
+        elementVector.append(AccessibilityUIElement([m_element accessibilityElementAtIndex:k]));    
+}
+
+int AccessibilityUIElement::childrenCount()
+{
+    Vector<AccessibilityUIElement> children;
+    getChildren(children);
+    
+    return children.size();
+}
+
+AccessibilityUIElement AccessibilityUIElement::elementAtPoint(int x, int y)
+{
+    id element = [m_element accessibilityHitTest:NSMakePoint(x, y)];
+    if (!element)
+        return nil;
+    
+    return AccessibilityUIElement(element); 
+}
+
+unsigned AccessibilityUIElement::indexOfChild(AccessibilityUIElement* element)
+{
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::getChildAtIndex(unsigned index)
+{
+    Vector<AccessibilityUIElement> children;
+    getChildrenWithRange(children, index, 1);
+    
+    if (children.size() == 1)
+        return children[0];
+    return nil;
+}
+
+AccessibilityUIElement AccessibilityUIElement::headerElementAtIndex(unsigned index)
+{
+    NSArray *headers = [m_element accessibilityHeaderElements];
+    if (index < [headers count])
+        return [headers objectAtIndex:index];
+    
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::linkedElement()
+{
+    id linkedElement = [m_element accessibilityLinkedElement];
+    if (linkedElement)
+        return AccessibilityUIElement(linkedElement);
+    
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::linkedUIElementAtIndex(unsigned index)
+{
+    // FIXME: implement
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned index)
+{
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
+{
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
+{
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::selectedRowAtIndex(unsigned index)
+{
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::rowAtIndex(unsigned index)
+{
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::titleUIElement()
+{
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::parentElement()
+{
+    id accessibilityObject = [m_element accessibilityContainer];
+    if (accessibilityObject)
+        return AccessibilityUIElement(accessibilityObject);
+    
+    return nil;
+}
+
+AccessibilityUIElement AccessibilityUIElement::disclosedByRow()
+{
+    return 0;
+}
+
+void AccessibilityUIElement::increaseTextSelection()
+{
+    [m_element accessibilityModifySelection:WebCore::CharacterGranularity increase:YES];
+}
+
+void AccessibilityUIElement::decreaseTextSelection()
+{
+    [m_element accessibilityModifySelection:WebCore::CharacterGranularity increase:NO];    
+}
+
+JSStringRef AccessibilityUIElement::stringForSelection() 
+{ 
+    NSString *stringForRange = [m_element selectionRangeString];
+    if (!stringForRange)
+        return 0;
+    
+    return [stringForRange createJSStringRef];
+}
+
+JSStringRef AccessibilityUIElement::stringForRange(unsigned location, unsigned length) 
+{ 
+    NSString *stringForRange = [m_element stringForRange:NSMakeRange(location, length)];
+    if (!stringForRange)
+        return 0;
+    
+    return [stringForRange createJSStringRef];
+}
+
+JSStringRef AccessibilityUIElement::attributedStringForRange(unsigned, unsigned)
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned)
+{
+    return false;
+}
+
+
+void AccessibilityUIElement::elementsForRange(unsigned location, unsigned length, Vector<AccessibilityUIElement>& elements)
+{ 
+    NSArray *elementsForRange = [m_element elementsForRange:NSMakeRange(location, length)];
+    for (id object in elementsForRange) {
+        AccessibilityUIElement element = AccessibilityUIElement(object);
+        elements.append(element);
+    }
+}
+
+#pragma mark Unused
+
+void AccessibilityUIElement::getLinkedUIElements(Vector<AccessibilityUIElement>& elementVector)
+{
+}
+
+void AccessibilityUIElement::getDocumentLinks(Vector<AccessibilityUIElement>& elementVector)
+{
+}
+
+JSStringRef AccessibilityUIElement::attributesOfLinkedUIElements()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::attributesOfDocumentLinks()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::attributesOfChildren()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::allAttributes()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
+{
+    if (JSStringIsEqualToUTF8CString(attribute, "AXPlaceholderValue"))
+        return [[m_element accessibilityPlaceholderValue] createJSStringRef];
+    
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+bool AccessibilityUIElement::isPressActionSupported()
+{
+    return false;
+}
+
+bool AccessibilityUIElement::isIncrementActionSupported()
+{
+    return false;
+}
+
+bool AccessibilityUIElement::isDecrementActionSupported()
+{
+    return false;
+}
+
+bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute)
+{
+    return false;
+}
+
+bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute)
+{
+    return false;
+}
+
+bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute)
+{
+    return false;
+}
+
+JSStringRef AccessibilityUIElement::parameterizedAttributeNames()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::role()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::subrole()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::roleDescription()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::title()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::description()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}    
+
+JSStringRef AccessibilityUIElement::orientation() const
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::stringValue()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::language()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::helpText() const
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+double AccessibilityUIElement::intValue() const
+{
+    return 0.0f;
+}
+
+double AccessibilityUIElement::minValue()
+{
+    return 0.0f;
+}
+
+double AccessibilityUIElement::maxValue()
+{
+    return 0.0;
+}
+
+JSStringRef AccessibilityUIElement::valueDescription()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+int AccessibilityUIElement::insertionPointLineNumber()
+{
+    return -1;
+}
+
+bool AccessibilityUIElement::isEnabled()
+{
+    return false;
+}
+
+bool AccessibilityUIElement::isRequired() const
+{
+    return false;
+}
+
+bool AccessibilityUIElement::isFocused() const
+{
+    // FIXME: implement
+    return false;
+}
+
+bool AccessibilityUIElement::isSelected() const
+{
+    UIAccessibilityTraits traits = [m_element accessibilityTraits];
+    return (traits & UIAccessibilityTraitSelected);
+}
+
+bool AccessibilityUIElement::isExpanded() const
+{
+    return false;
+}
+
+bool AccessibilityUIElement::isChecked() const
+{
+    return false;
+}
+
+int AccessibilityUIElement::hierarchicalLevel() const
+{
+    return 0;
+}
+
+bool AccessibilityUIElement::ariaIsGrabbed() const
+{
+    return false;
+}
+
+JSStringRef AccessibilityUIElement::ariaDropEffects() const
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+int AccessibilityUIElement::lineForIndex(int index)
+{
+    return -1;
+}
+
+JSStringRef AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::attributesOfColumnHeaders()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::attributesOfRowHeaders()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::attributesOfColumns()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::attributesOfRows()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::attributesOfVisibleCells()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::attributesOfHeader()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+int AccessibilityUIElement::rowCount()
+{
+    return -1;
+}
+
+int AccessibilityUIElement::columnCount()
+{
+    return -1;
+}
+
+int AccessibilityUIElement::indexInTable()
+{
+    return -1;
+}
+
+JSStringRef AccessibilityUIElement::rowIndexRange()
+{
+    NSRange range = [m_element accessibilityRowRange];
+    NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%lu, %lu}", (unsigned long)range.location, (unsigned long)range.length];
+    return [rangeDescription createJSStringRef];
+}
+
+JSStringRef AccessibilityUIElement::columnIndexRange()
+{
+    NSRange range = [m_element accessibilityColumnRange];
+    NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%lu, %lu}", (unsigned long)range.location, (unsigned long)range.length];
+    return [rangeDescription createJSStringRef];    
+}
+
+AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned col, unsigned row)
+{
+    return AccessibilityUIElement([m_element accessibilityElementForRow:row andColumn:col]);
+}
+
+JSStringRef AccessibilityUIElement::selectedTextRange()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+void AccessibilityUIElement::assistiveTechnologySimulatedFocus()
+{
+    [m_element accessibilityElementDidBecomeFocused];
+}
+
+void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
+{
+}
+
+void AccessibilityUIElement::increment()
+{
+    [m_element accessibilityIncrement];
+}
+
+void AccessibilityUIElement::decrement()
+{
+    [m_element accessibilityDecrement];
+}
+
+void AccessibilityUIElement::showMenu()
+{
+}
+
+void AccessibilityUIElement::press()
+{
+}
+
+JSStringRef AccessibilityUIElement::accessibilityValue() const
+{
+    // FIXME: implement
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::documentEncoding()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSStringRef AccessibilityUIElement::documentURI()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+static void _accessibilityNotificationCallback(id element, NSString* notification, void* context)
+{
+    if (!context)
+        return;
+    
+    JSObjectRef functionCallback = static_cast<JSObjectRef>(context);
+    
+    JSRetainPtr<JSStringRef> jsNotification(Adopt, [notification createJSStringRef]);
+    JSValueRef argument = JSValueMakeString([mainFrame globalContext], jsNotification.get());
+    JSObjectCallAsFunction([mainFrame globalContext], functionCallback, NULL, 1, &argument, NULL);
+}
+
+bool AccessibilityUIElement::addNotificationListener(JSObjectRef functionCallback)
+{
+    if (!functionCallback)
+        return false;
+    
+    m_notificationFunctionCallback = functionCallback;
+    [platformUIElement() accessibilitySetPostedNotificationCallback:_accessibilityNotificationCallback withContext:reinterpret_cast<void*>(m_notificationFunctionCallback)];
+    return true;    
+}
+
+void AccessibilityUIElement::removeNotificationListener()
+{
+    m_notificationFunctionCallback = 0;
+    [platformUIElement() accessibilitySetPostedNotificationCallback:nil withContext:nil];
+}
+
+bool AccessibilityUIElement::isFocusable() const
+{
+    // FIXME: implement
+    return false;
+}
+
+bool AccessibilityUIElement::isSelectable() const
+{
+    // FIXME: implement
+    return false;
+}
+
+bool AccessibilityUIElement::isMultiSelectable() const
+{
+    // FIXME: implement
+    return false;
+}
+
+bool AccessibilityUIElement::isSelectedOptionActive() const
+{
+    // FIXME: implement
+    return false;
+}
+
+bool AccessibilityUIElement::isVisible() const
+{
+    // FIXME: implement
+    return false;
+}
+
+bool AccessibilityUIElement::isOffScreen() const
+{
+    // FIXME: implement
+    return false;
+}
+
+bool AccessibilityUIElement::isCollapsed() const
+{
+    // FIXME: implement
+    return false;
+}
+
+bool AccessibilityUIElement::isIgnored() const
+{
+    // FIXME: implement
+    return false;
+}
+
+bool AccessibilityUIElement::hasPopup() const
+{
+    // FIXME: implement
+    return false;
+}
+
+void AccessibilityUIElement::takeFocus()
+{
+    // FIXME: implement
+}
+
+void AccessibilityUIElement::takeSelection()
+{
+    // FIXME: implement
+}
+
+void AccessibilityUIElement::addSelection()
+{
+    // FIXME: implement
+}
+
+void AccessibilityUIElement::removeSelection()
+{
+    // FIXME: implement
+}
+
+AccessibilityUIElement AccessibilityUIElement::uiElementForSearchPredicate(AccessibilityUIElement* startElement, bool isDirectionNext, JSStringRef searchKey, JSStringRef searchText)
+{
+    // FIXME: implement
+    return 0;
+}
+
+double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute)
+{
+    // FIXME: implement
+    return 0;
+}
+#endif // PLATFORM(IOS)