WebKitTestRunner needs to support accessibility-related DRT APIs
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Nov 2011 20:17:22 +0000 (20:17 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 16 Nov 2011 20:17:22 +0000 (20:17 +0000)
https://bugs.webkit.org/show_bug.cgi?id=42131

Tools:

Reviewed by Beth Dakin.

Port the AX code in DRT to WKTestRunner by using IDL.

* DumpRenderTree/AccessibilityUIElement.cpp:
(horizontalScrollbarCallback):
(verticalScrollbarCallback):
(AccessibilityUIElement::horizontalScrollbar):
(AccessibilityUIElement::verticalScrollbar):
(AccessibilityUIElement::getJSClass):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(AccessibilityUIElement::horizontalScrollbar):
(AccessibilityUIElement::verticalScrollbar):
* WebKitTestRunner/DerivedSources.make:
* WebKitTestRunner/GNUmakefile.am:
* WebKitTestRunner/InjectedBundle/AccessibilityController.cpp: Added.
(WTR::AccessibilityController::create):
(WTR::AccessibilityController::AccessibilityController):
(WTR::AccessibilityController::~AccessibilityController):
(WTR::AccessibilityController::makeWindowObject):
(WTR::AccessibilityController::wrapperClass):
(WTR::AccessibilityController::rootElement):
(WTR::AccessibilityController::focusedElement):
(WTR::AccessibilityController::elementAtPoint):
* WebKitTestRunner/InjectedBundle/AccessibilityController.h: Added.
(WTR::AccessibilityController::logFocusEvents):
(WTR::AccessibilityController::logValueChangeEvents):
(WTR::AccessibilityController::logScrollingStartEvents):
(WTR::AccessibilityController::logAccessibilityEvents):
(WTR::AccessibilityController::addNotificationListener):
(WTR::AccessibilityController::notificationReceived):
(WTR::AccessibilityController::resetToConsistentState):
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp: Added.
(WTR::AccessibilityTextMarker::create):
(WTR::AccessibilityTextMarker::AccessibilityTextMarker):
(WTR::AccessibilityTextMarker::~AccessibilityTextMarker):
(WTR::AccessibilityTextMarker::platformTextMarker):
(WTR::AccessibilityTextMarker::wrapperClass):
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.h: Added.
(WTR::AccessibilityTextMarker::isEqual):
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp: Added.
(WTR::AccessibilityTextMarkerRange::create):
(WTR::AccessibilityTextMarkerRange::AccessibilityTextMarkerRange):
(WTR::AccessibilityTextMarkerRange::~AccessibilityTextMarkerRange):
(WTR::AccessibilityTextMarkerRange::platformTextMarkerRange):
(WTR::AccessibilityTextMarkerRange::wrapperClass):
* WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.h: Added.
(WTR::AccessibilityTextMarkerRange::isEqual):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: Added.
(WTR::AccessibilityUIElement::create):
(WTR::AccessibilityUIElement::wrapperClass):
(WTR::AccessibilityUIElement::isValid):
(WTR::AccessibilityUIElement::AccessibilityUIElement):
(WTR::AccessibilityUIElement::~AccessibilityUIElement):
(WTR::AccessibilityUIElement::isEqual):
(WTR::AccessibilityUIElement::elementAtPoint):
(WTR::AccessibilityUIElement::childAtIndex):
(WTR::AccessibilityUIElement::indexOfChild):
(WTR::AccessibilityUIElement::childrenCount):
(WTR::AccessibilityUIElement::titleUIElement):
(WTR::AccessibilityUIElement::parentElement):
(WTR::AccessibilityUIElement::takeFocus):
(WTR::AccessibilityUIElement::takeSelection):
(WTR::AccessibilityUIElement::addSelection):
(WTR::AccessibilityUIElement::removeSelection):
(WTR::AccessibilityUIElement::allAttributes):
(WTR::AccessibilityUIElement::attributesOfLinkedUIElements):
(WTR::AccessibilityUIElement::linkedUIElementAtIndex):
(WTR::AccessibilityUIElement::attributesOfDocumentLinks):
(WTR::AccessibilityUIElement::attributesOfChildren):
(WTR::AccessibilityUIElement::parameterizedAttributeNames):
(WTR::AccessibilityUIElement::increment):
(WTR::AccessibilityUIElement::decrement):
(WTR::AccessibilityUIElement::showMenu):
(WTR::AccessibilityUIElement::press):
(WTR::AccessibilityUIElement::stringAttributeValue):
(WTR::AccessibilityUIElement::uiElementAttributeValue):
(WTR::AccessibilityUIElement::numberAttributeValue):
(WTR::AccessibilityUIElement::boolAttributeValue):
(WTR::AccessibilityUIElement::isAttributeSupported):
(WTR::AccessibilityUIElement::isAttributeSettable):
(WTR::AccessibilityUIElement::isActionSupported):
(WTR::AccessibilityUIElement::role):
(WTR::AccessibilityUIElement::subrole):
(WTR::AccessibilityUIElement::roleDescription):
(WTR::AccessibilityUIElement::title):
(WTR::AccessibilityUIElement::description):
(WTR::AccessibilityUIElement::language):
(WTR::AccessibilityUIElement::stringValue):
(WTR::AccessibilityUIElement::accessibilityValue):
(WTR::AccessibilityUIElement::helpText):
(WTR::AccessibilityUIElement::orientation):
(WTR::AccessibilityUIElement::x):
(WTR::AccessibilityUIElement::y):
(WTR::AccessibilityUIElement::width):
(WTR::AccessibilityUIElement::height):
(WTR::AccessibilityUIElement::intValue):
(WTR::AccessibilityUIElement::minValue):
(WTR::AccessibilityUIElement::maxValue):
(WTR::AccessibilityUIElement::valueDescription):
(WTR::AccessibilityUIElement::insertionPointLineNumber):
(WTR::AccessibilityUIElement::selectedTextRange):
(WTR::AccessibilityUIElement::isEnabled):
(WTR::AccessibilityUIElement::isRequired):
(WTR::AccessibilityUIElement::isFocused):
(WTR::AccessibilityUIElement::isFocusable):
(WTR::AccessibilityUIElement::isSelected):
(WTR::AccessibilityUIElement::isSelectable):
(WTR::AccessibilityUIElement::isMultiSelectable):
(WTR::AccessibilityUIElement::setSelectedChild):
(WTR::AccessibilityUIElement::selectedChildrenCount):
(WTR::AccessibilityUIElement::selectedChildAtIndex):
(WTR::AccessibilityUIElement::isExpanded):
(WTR::AccessibilityUIElement::isChecked):
(WTR::AccessibilityUIElement::isVisible):
(WTR::AccessibilityUIElement::isOffScreen):
(WTR::AccessibilityUIElement::isCollapsed):
(WTR::AccessibilityUIElement::isIgnored):
(WTR::AccessibilityUIElement::hasPopup):
(WTR::AccessibilityUIElement::hierarchicalLevel):
(WTR::AccessibilityUIElement::clickPointX):
(WTR::AccessibilityUIElement::clickPointY):
(WTR::AccessibilityUIElement::documentEncoding):
(WTR::AccessibilityUIElement::documentURI):
(WTR::AccessibilityUIElement::url):
(WTR::AccessibilityUIElement::speak):
(WTR::AccessibilityUIElement::attributesOfColumnHeaders):
(WTR::AccessibilityUIElement::attributesOfRowHeaders):
(WTR::AccessibilityUIElement::attributesOfColumns):
(WTR::AccessibilityUIElement::attributesOfRows):
(WTR::AccessibilityUIElement::attributesOfVisibleCells):
(WTR::AccessibilityUIElement::attributesOfHeader):
(WTR::AccessibilityUIElement::indexInTable):
(WTR::AccessibilityUIElement::rowIndexRange):
(WTR::AccessibilityUIElement::columnIndexRange):
(WTR::AccessibilityUIElement::rowCount):
(WTR::AccessibilityUIElement::columnCount):
(WTR::AccessibilityUIElement::selectedRowAtIndex):
(WTR::AccessibilityUIElement::disclosedByRow):
(WTR::AccessibilityUIElement::disclosedRowAtIndex):
(WTR::AccessibilityUIElement::ariaOwnsElementAtIndex):
(WTR::AccessibilityUIElement::ariaFlowToElementAtIndex):
(WTR::AccessibilityUIElement::ariaIsGrabbed):
(WTR::AccessibilityUIElement::ariaDropEffects):
(WTR::AccessibilityUIElement::lineForIndex):
(WTR::AccessibilityUIElement::rangeForLine):
(WTR::AccessibilityUIElement::boundsForRange):
(WTR::AccessibilityUIElement::setSelectedTextRange):
(WTR::AccessibilityUIElement::stringForRange):
(WTR::AccessibilityUIElement::attributedStringForRange):
(WTR::AccessibilityUIElement::attributedStringRangeIsMisspelled):
(WTR::AccessibilityUIElement::uiElementForSearchPredicate):
(WTR::AccessibilityUIElement::cellForColumnAndRow):
(WTR::AccessibilityUIElement::horizontalScrollbar):
(WTR::AccessibilityUIElement::verticalScrollbar):
(WTR::AccessibilityUIElement::addNotificationListener):
(WTR::AccessibilityUIElement::removeNotificationListener):
(WTR::AccessibilityUIElement::textMarkerRangeForElement):
(WTR::AccessibilityUIElement::textMarkerRangeLength):
(WTR::AccessibilityUIElement::textMarkerRangeForMarkers):
(WTR::AccessibilityUIElement::startTextMarkerForTextMarkerRange):
(WTR::AccessibilityUIElement::endTextMarkerForTextMarkerRange):
(WTR::AccessibilityUIElement::accessibilityElementForTextMarker):
(WTR::AccessibilityUIElement::textMarkerForPoint):
(WTR::AccessibilityUIElement::previousTextMarker):
(WTR::AccessibilityUIElement::nextTextMarker):
(WTR::AccessibilityUIElement::stringForTextMarkerRange):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: Added.
(WTR::AccessibilityUIElement::platformUIElement):
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl: Added.
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarker.idl: Added.
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarkerRange.idl: Added.
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: Added.
* WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
* WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
(WTR::InjectedBundle::beginTesting):
* WebKitTestRunner/InjectedBundle/InjectedBundle.h:
(WTR::InjectedBundle::accessibilityController):
* WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
(WTR::InjectedBundlePage::didClearWindowForFrame):
* WebKitTestRunner/InjectedBundle/LayoutTestController.h:
* WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp:
(WTR::LayoutTestController::platformName):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm: Added.
(WTR::AccessibilityTextMarker::isEqual):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm: Added.
(WTR::AccessibilityTextMarkerRange::isEqual):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: Added.
(+[NSString stringWithJSStringRef:]):
(-[NSString createJSStringRef]):
(-[AccessibilityNotificationHandler initWithPlatformElement:]):
(-[AccessibilityNotificationHandler dealloc]):
(-[AccessibilityNotificationHandler _notificationReceived:]):
(-[AccessibilityNotificationHandler setCallback:]):
(WTR::AccessibilityUIElement::AccessibilityUIElement):
(WTR::AccessibilityUIElement::~AccessibilityUIElement):
(WTR::AccessibilityUIElement::isEqual):
(WTR::descriptionOfValue):
(WTR::attributesOfElement):
(WTR::concatenateAttributeAndValue):
(WTR::convertNSArrayToVector):
(WTR::descriptionOfElements):
(WTR::AccessibilityUIElement::getLinkedUIElements):
(WTR::AccessibilityUIElement::getDocumentLinks):
(WTR::AccessibilityUIElement::getChildren):
(WTR::AccessibilityUIElement::getChildrenWithRange):
(WTR::AccessibilityUIElement::childrenCount):
(WTR::AccessibilityUIElement::elementAtPoint):
(WTR::AccessibilityUIElement::indexOfChild):
(WTR::AccessibilityUIElement::childAtIndex):
(WTR::AccessibilityUIElement::linkedUIElementAtIndex):
(WTR::AccessibilityUIElement::ariaOwnsElementAtIndex):
(WTR::AccessibilityUIElement::ariaFlowToElementAtIndex):
(WTR::AccessibilityUIElement::disclosedRowAtIndex):
(WTR::AccessibilityUIElement::selectedChildAtIndex):
(WTR::AccessibilityUIElement::selectedChildrenCount):
(WTR::AccessibilityUIElement::selectedRowAtIndex):
(WTR::AccessibilityUIElement::titleUIElement):
(WTR::AccessibilityUIElement::parentElement):
(WTR::AccessibilityUIElement::disclosedByRow):
(WTR::AccessibilityUIElement::attributesOfLinkedUIElements):
(WTR::AccessibilityUIElement::attributesOfDocumentLinks):
(WTR::AccessibilityUIElement::attributesOfChildren):
(WTR::AccessibilityUIElement::allAttributes):
(WTR::AccessibilityUIElement::stringAttributeValue):
(WTR::AccessibilityUIElement::numberAttributeValue):
(WTR::AccessibilityUIElement::uiElementAttributeValue):
(WTR::AccessibilityUIElement::boolAttributeValue):
(WTR::AccessibilityUIElement::isAttributeSettable):
(WTR::AccessibilityUIElement::isAttributeSupported):
(WTR::AccessibilityUIElement::parameterizedAttributeNames):
(WTR::AccessibilityUIElement::role):
(WTR::AccessibilityUIElement::subrole):
(WTR::AccessibilityUIElement::roleDescription):
(WTR::AccessibilityUIElement::title):
(WTR::AccessibilityUIElement::description):
(WTR::AccessibilityUIElement::orientation):
(WTR::AccessibilityUIElement::stringValue):
(WTR::AccessibilityUIElement::language):
(WTR::AccessibilityUIElement::helpText):
(WTR::AccessibilityUIElement::x):
(WTR::AccessibilityUIElement::y):
(WTR::AccessibilityUIElement::width):
(WTR::AccessibilityUIElement::height):
(WTR::AccessibilityUIElement::clickPointX):
(WTR::AccessibilityUIElement::clickPointY):
(WTR::AccessibilityUIElement::intValue):
(WTR::AccessibilityUIElement::minValue):
(WTR::AccessibilityUIElement::maxValue):
(WTR::AccessibilityUIElement::valueDescription):
(WTR::AccessibilityUIElement::insertionPointLineNumber):
(WTR::AccessibilityUIElement::isActionSupported):
(WTR::AccessibilityUIElement::isEnabled):
(WTR::AccessibilityUIElement::isRequired):
(WTR::AccessibilityUIElement::isFocused):
(WTR::AccessibilityUIElement::isSelected):
(WTR::AccessibilityUIElement::isExpanded):
(WTR::AccessibilityUIElement::isChecked):
(WTR::AccessibilityUIElement::hierarchicalLevel):
(WTR::AccessibilityUIElement::speak):
(WTR::AccessibilityUIElement::ariaIsGrabbed):
(WTR::AccessibilityUIElement::ariaDropEffects):
(WTR::AccessibilityUIElement::lineForIndex):
(WTR::AccessibilityUIElement::rangeForLine):
(WTR::AccessibilityUIElement::boundsForRange):
(WTR::AccessibilityUIElement::stringForRange):
(WTR::AccessibilityUIElement::attributedStringForRange):
(WTR::AccessibilityUIElement::attributedStringRangeIsMisspelled):
(WTR::AccessibilityUIElement::uiElementForSearchPredicate):
(WTR::AccessibilityUIElement::attributesOfColumnHeaders):
(WTR::AccessibilityUIElement::attributesOfRowHeaders):
(WTR::AccessibilityUIElement::attributesOfColumns):
(WTR::AccessibilityUIElement::attributesOfRows):
(WTR::AccessibilityUIElement::attributesOfVisibleCells):
(WTR::AccessibilityUIElement::attributesOfHeader):
(WTR::AccessibilityUIElement::rowCount):
(WTR::AccessibilityUIElement::columnCount):
(WTR::AccessibilityUIElement::indexInTable):
(WTR::AccessibilityUIElement::rowIndexRange):
(WTR::AccessibilityUIElement::columnIndexRange):
(WTR::AccessibilityUIElement::cellForColumnAndRow):
(WTR::AccessibilityUIElement::horizontalScrollbar):
(WTR::AccessibilityUIElement::verticalScrollbar):
(WTR::AccessibilityUIElement::selectedTextRange):
(WTR::AccessibilityUIElement::setSelectedTextRange):
(WTR::AccessibilityUIElement::increment):
(WTR::AccessibilityUIElement::decrement):
(WTR::AccessibilityUIElement::showMenu):
(WTR::AccessibilityUIElement::press):
(WTR::AccessibilityUIElement::setSelectedChild):
(WTR::AccessibilityUIElement::accessibilityValue):
(WTR::AccessibilityUIElement::documentEncoding):
(WTR::AccessibilityUIElement::documentURI):
(WTR::AccessibilityUIElement::url):
(WTR::AccessibilityUIElement::addNotificationListener):
(WTR::AccessibilityUIElement::removeNotificationListener):
(WTR::AccessibilityUIElement::isFocusable):
(WTR::AccessibilityUIElement::isSelectable):
(WTR::AccessibilityUIElement::isMultiSelectable):
(WTR::AccessibilityUIElement::isVisible):
(WTR::AccessibilityUIElement::isOffScreen):
(WTR::AccessibilityUIElement::isCollapsed):
(WTR::AccessibilityUIElement::isIgnored):
(WTR::AccessibilityUIElement::hasPopup):
(WTR::AccessibilityUIElement::takeFocus):
(WTR::AccessibilityUIElement::takeSelection):
(WTR::AccessibilityUIElement::addSelection):
(WTR::AccessibilityUIElement::removeSelection):
(WTR::AccessibilityUIElement::textMarkerRangeForElement):
(WTR::AccessibilityUIElement::textMarkerRangeLength):
(WTR::AccessibilityUIElement::previousTextMarker):
(WTR::AccessibilityUIElement::nextTextMarker):
(WTR::AccessibilityUIElement::stringForTextMarkerRange):
(WTR::AccessibilityUIElement::textMarkerRangeForMarkers):
(WTR::AccessibilityUIElement::startTextMarkerForTextMarkerRange):
(WTR::AccessibilityUIElement::endTextMarkerForTextMarkerRange):
(WTR::AccessibilityUIElement::textMarkerForPoint):
(WTR::AccessibilityUIElement::accessibilityElementForTextMarker):
* WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm:
(WTR::LayoutTestController::platformName):
* WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp:
(WTR::LayoutTestController::platformName):
* WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp:
(WTR::LayoutTestController::platformName):
* WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
* WebKitTestRunner/win/InjectedBundle.vcproj:

LayoutTests:

Cleanup tests and skip lists so that accessibility tests can run
in WK2. This mostly involved handling returned elements that might be nil,
something that did not happen in DRT.

Reviewed by Beth Dakin.

* accessibility/aria-labelledby-overrides-label-expected.txt:
* accessibility/aria-labelledby-overrides-label.html:
* accessibility/non-data-table-cell-title-ui-element.html:
* accessibility/th-as-title-ui.html:
    Make sure a nil titleUIElement is accounted for in these tests.
* platform/gtk-wk2/Skipped:
* platform/mac/accessibility/aria-expanded-notifications-expected.txt:
* platform/mac/accessibility/aria-expanded-notifications.html:
* platform/mac/accessibility/aria-invalid-expected.txt:
* platform/mac/accessibility/aria-invalid.html:
* platform/mac/accessibility/aria-liveregions-addedelement-expected.txt:
* platform/mac/accessibility/aria-liveregions-addedelement.html:
* platform/mac/accessibility/aria-liveregions-changedalt-expected.txt:
* platform/mac/accessibility/aria-liveregions-changedalt.html:
* platform/mac/accessibility/aria-liveregions-changedtext-expected.txt:
* platform/mac/accessibility/aria-liveregions-changedtext.html:
* platform/mac/accessibility/aria-liveregions-removedelement-expected.txt:
* platform/mac/accessibility/aria-liveregions-removedelement.html:
     All the preceeding layout tests use alert() to output the results of notifications. This
     is causing re-ordering issues on WK2, so I've moved them all to output that notification
     data to a separate element from "console".
* platform/mac/accessibility/html-section-elements-expected.txt:
* platform/mac/accessibility/html-section-elements.html:
     Remove nil element access that is unnecessary.
* platform/mac/accessibility/html-slider-indicator-expected.txt:
* platform/mac/accessibility/html-slider-indicator.html:
* platform/mac/accessibility/search-predicate.html:
     Add an alt tag to <img> so that it always shows up in the AX tree.
* platform/mac/accessibility/selection-value-changes-for-aria-textbox.html:
* platform/mac/accessibility/textbox-role-reports-notifications-expected.txt:
     Remove the notification listener properly (was causing flakiness).
* platform/mac/accessibility/textbox-role-reports-notifications.html:
* platform/mac/accessibility/update-children-when-aria-role-changes-expected.txt:
* platform/mac/accessibility/update-children-when-aria-role-changes.html:
     Account for when element's returned are nil.
* platform/win-wk2/Skipped:
     Skip all accessibility tests on win.
* platform/wk2/Skipped:
     Skip all accessibility tests on gtk.

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

63 files changed:
LayoutTests/ChangeLog
LayoutTests/accessibility/aria-labelledby-overrides-label-expected.txt
LayoutTests/accessibility/aria-labelledby-overrides-label.html
LayoutTests/accessibility/non-data-table-cell-title-ui-element.html
LayoutTests/accessibility/th-as-title-ui.html
LayoutTests/platform/gtk-wk2/Skipped
LayoutTests/platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/aria-expanded-notifications-expected.txt
LayoutTests/platform/mac/accessibility/aria-expanded-notifications.html
LayoutTests/platform/mac/accessibility/aria-invalid-expected.txt
LayoutTests/platform/mac/accessibility/aria-invalid.html
LayoutTests/platform/mac/accessibility/aria-liveregions-addedelement-expected.txt
LayoutTests/platform/mac/accessibility/aria-liveregions-addedelement.html
LayoutTests/platform/mac/accessibility/aria-liveregions-changedalt-expected.txt
LayoutTests/platform/mac/accessibility/aria-liveregions-changedalt.html
LayoutTests/platform/mac/accessibility/aria-liveregions-changedtext-expected.txt
LayoutTests/platform/mac/accessibility/aria-liveregions-changedtext.html
LayoutTests/platform/mac/accessibility/aria-liveregions-removedelement-expected.txt
LayoutTests/platform/mac/accessibility/aria-liveregions-removedelement.html
LayoutTests/platform/mac/accessibility/html-section-elements-expected.txt
LayoutTests/platform/mac/accessibility/html-section-elements.html
LayoutTests/platform/mac/accessibility/html-slider-indicator-expected.txt
LayoutTests/platform/mac/accessibility/html-slider-indicator.html
LayoutTests/platform/mac/accessibility/search-predicate.html
LayoutTests/platform/mac/accessibility/selection-value-changes-for-aria-textbox.html
LayoutTests/platform/mac/accessibility/textbox-role-reports-notifications-expected.txt
LayoutTests/platform/mac/accessibility/textbox-role-reports-notifications.html
LayoutTests/platform/mac/accessibility/update-children-when-aria-role-changes-expected.txt
LayoutTests/platform/mac/accessibility/update-children-when-aria-role-changes.html
LayoutTests/platform/win-wk2/Skipped
LayoutTests/platform/wk2/Skipped
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityUIElement.cpp
Tools/DumpRenderTree/AccessibilityUIElement.h
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
Tools/WebKitTestRunner/DerivedSources.make
Tools/WebKitTestRunner/GNUmakefile.am
Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.h [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.h [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarker.idl [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarkerRange.idl [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.cpp
Tools/WebKitTestRunner/InjectedBundle/InjectedBundle.h
Tools/WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp
Tools/WebKitTestRunner/InjectedBundle/LayoutTestController.h
Tools/WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm [new file with mode: 0644]
Tools/WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm
Tools/WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp
Tools/WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp
Tools/WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj
Tools/WebKitTestRunner/win/InjectedBundle.vcproj

index c244828..3259778 100644 (file)
@@ -1,3 +1,54 @@
+2011-11-16  Chris Fleizach  <cfleizach@apple.com>
+
+        WebKitTestRunner needs to support accessibility-related DRT APIs
+        https://bugs.webkit.org/show_bug.cgi?id=42131
+
+        Cleanup tests and skip lists so that accessibility tests can run
+        in WK2. This mostly involved handling returned elements that might be nil,
+        something that did not happen in DRT.
+
+        Reviewed by Beth Dakin.
+
+        * accessibility/aria-labelledby-overrides-label-expected.txt:
+        * accessibility/aria-labelledby-overrides-label.html:
+        * accessibility/non-data-table-cell-title-ui-element.html:
+        * accessibility/th-as-title-ui.html:
+            Make sure a nil titleUIElement is accounted for in these tests.
+        * platform/gtk-wk2/Skipped:
+        * platform/mac/accessibility/aria-expanded-notifications-expected.txt:
+        * platform/mac/accessibility/aria-expanded-notifications.html:
+        * platform/mac/accessibility/aria-invalid-expected.txt:
+        * platform/mac/accessibility/aria-invalid.html:
+        * platform/mac/accessibility/aria-liveregions-addedelement-expected.txt:
+        * platform/mac/accessibility/aria-liveregions-addedelement.html:
+        * platform/mac/accessibility/aria-liveregions-changedalt-expected.txt:
+        * platform/mac/accessibility/aria-liveregions-changedalt.html:
+        * platform/mac/accessibility/aria-liveregions-changedtext-expected.txt:
+        * platform/mac/accessibility/aria-liveregions-changedtext.html:
+        * platform/mac/accessibility/aria-liveregions-removedelement-expected.txt:
+        * platform/mac/accessibility/aria-liveregions-removedelement.html:
+             All the preceeding layout tests use alert() to output the results of notifications. This
+             is causing re-ordering issues on WK2, so I've moved them all to output that notification
+             data to a separate element from "console".
+        * platform/mac/accessibility/html-section-elements-expected.txt:
+        * platform/mac/accessibility/html-section-elements.html:
+             Remove nil element access that is unnecessary.
+        * platform/mac/accessibility/html-slider-indicator-expected.txt:
+        * platform/mac/accessibility/html-slider-indicator.html:
+        * platform/mac/accessibility/search-predicate.html:
+             Add an alt tag to <img> so that it always shows up in the AX tree.
+        * platform/mac/accessibility/selection-value-changes-for-aria-textbox.html:
+        * platform/mac/accessibility/textbox-role-reports-notifications-expected.txt:
+             Remove the notification listener properly (was causing flakiness).
+        * platform/mac/accessibility/textbox-role-reports-notifications.html:
+        * platform/mac/accessibility/update-children-when-aria-role-changes-expected.txt:
+        * platform/mac/accessibility/update-children-when-aria-role-changes.html:
+             Account for when element's returned are nil.
+        * platform/win-wk2/Skipped:
+             Skip all accessibility tests on win.
+        * platform/wk2/Skipped:
+             Skip all accessibility tests on gtk.
+
 2011-11-16  Sergio Villar Senin  <svillar@igalia.com>
 
         [Soup] Somet tests fail with FAIL Unexpected response data received: Wrong method: GET
index e31fb31..4f795f2 100644 (file)
@@ -5,7 +5,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS text.description is 'AXDescription: Shut down computer after 10 minutes'
-PASS text.titleUIElement().isValid is false
+PASS text.titleUIElement() != null && text.titleUIElement().isValid is false
 PASS labelElement.role is 'AXRole: AXStaticText'
 PASS successfullyParsed is true
 
index 89cca62..d1a5bb5 100644 (file)
@@ -25,7 +25,7 @@
           shouldBe("text.description", "'AXDescription: Shut down computer after 10 minutes'");
 
           // There should be no title UI element.
-          shouldBe("text.titleUIElement().isValid", "false");
+          shouldBe("text.titleUIElement() != null && text.titleUIElement().isValid", "false");
           
           // The label element is in a group, in a group, in the web area.
           var labelElement = accessibilityController.rootElement.childAtIndex(0).childAtIndex(0).childAtIndex(0).childAtIndex(0);
index 747d660..af24270 100644 (file)
@@ -32,7 +32,9 @@
             // get the <th>skip</th> element
             var group = accessibilityController.focusedElement.childAtIndex(5);
             var titleUI = group.titleUIElement();
-            var allAttributes = titleUI.allAttributes();
+            var allAttributes = "";
+            if (titleUI)
+                allAttributes = titleUI.allAttributes();
 
             // verify it has no title ui element           
             if (!allAttributes) {
index ccf4682..3fe1df1 100644 (file)
@@ -32,8 +32,7 @@
             body.focus();
             var group = accessibilityController.focusedElement.childAtIndex(1);
             var group2 = accessibilityController.focusedElement.childAtIndex(3);
-
-            if (group.titleUIElement().allAttributes() != "" && group2.titleUIElement().allAttributes() == "")
+            if (group.titleUIElement().allAttributes() != "" && (group2.titleUIElement() == null || group2.titleUIElement().allAttributes() == "")) 
                 result.innerText += "Pass";
             else
                 result.innerText += "Fail";
index 493c1d2..9fec24b 100644 (file)
@@ -303,15 +303,9 @@ editing/selection/click-in-margins-inside-editable-div.html
 editing/selection/click-in-padding-with-multiple-line-boxes.html
 editing/selection/shift-click.html
 
-# Implement accesitility support to WebKit2
-platform/gtk/accessibility/aria-roles-unignored.html
-platform/gtk/accessibility/aria-slider-required-attributes.html
-platform/gtk/accessibility/aria-table-hierarchy.html
-platform/gtk/accessibility/caret-browsing-text-focus.html
-platform/gtk/accessibility/input-slider.html
-platform/gtk/accessibility/list-items-always-exposed.html
-platform/gtk/accessibility/object-with-title.html
-platform/gtk/accessibility/table-hierarchy.html
+# Implement accessibility support for WebKit2
+accessibility
+platform/gtk/accessibility
 
 # Implement textInputController.firstRectForCharacterRange interface
 fast/forms/cursor-at-editable-content-boundary.html
diff --git a/LayoutTests/platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt b/LayoutTests/platform/mac-wk2/accessibility/deleting-iframe-destroys-axcache-expected.txt
new file mode 100644 (file)
index 0000000..8249ebe
--- /dev/null
@@ -0,0 +1,47 @@
+Before
+
+After
+
+End of test
+
+This tests that deleting an iframe doesn't cause the accessibility cache to be destroyed and recreated.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+
+Before:
+AXRole: AXScrollArea AXValue: 
+    AXRole: AXWebArea AXValue: 
+        AXRole: AXGroup AXValue: 
+            AXRole: AXStaticText AXValue: Before
+        AXRole: AXGroup AXValue: 
+            AXRole: AXScrollArea AXValue: 
+                AXRole: AXWebArea AXValue: 
+                    AXRole: AXGroup AXValue: 
+                        AXRole: AXButton AXValue: 
+        AXRole: AXGroup AXValue: 
+            AXRole: AXStaticText AXValue: After
+        AXRole: AXGroup AXValue: 
+            AXRole: AXStaticText AXValue: End of test
+
+After:
+AXRole: AXScrollArea AXValue: 
+    AXRole: AXWebArea AXValue: 
+        AXRole: AXGroup AXValue: 
+            AXRole: AXStaticText AXValue: Before
+        AXRole: AXGroup AXValue: 
+            AXRole: AXStaticText AXValue: After
+        AXRole: AXGroup AXValue: 
+            AXRole: AXStaticText AXValue: End of test
+
+PASS frameBodyRole == frameBody.role is false
+PASS frameGroupRole == frameGroup.role is false
+PASS frameButtonRole == frameButton.role is false
+PASS root.isEqual(newRoot) is true
+PASS body.isEqual(newBody) is true
+PASS before.isEqual(newBefore) is true
+PASS after.isEqual(newAfter) is true
+
+TEST COMPLETE
+
index 564fef6..a258aaa 100644 (file)
@@ -9,8 +9,8 @@ PASS addedNotification is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
-PASS notifyName is 'AXRowCountChanged'
-PASS notifyName is 'AXRowCollapsed'
-PASS notifyName is 'AXRowCountChanged'
-PASS notifyName is 'AXRowExpanded'
+Notification: AXRowCountChanged
+Notification: AXRowCollapsed
+Notification: AXRowCountChanged
+Notification: AXRowExpanded
 
index df9105a..48bce04 100644 (file)
@@ -19,6 +19,7 @@
 
 <p id="description"></p>
 <div id="console"></div>
+<div id="notifications"></div>
 
 <script>
 
     // The order of notifications should be Row Count, Row Collapsed, Row Count, Row Expanded
     function notifyCallback(notification) {  
         notifyName = notification;
-        if (notifyCount == 0) {
-            shouldBe("notifyName", "'AXRowCountChanged'");
-        } 
-        else if (notifyCount == 1) {
-            shouldBe("notifyName", "'AXRowCollapsed'");
-        }
-        else if (notifyCount == 2) {
-            shouldBe("notifyName", "'AXRowCountChanged'");
-        }
-        else if (notifyCount == 3) {
-            shouldBe("notifyName", "'AXRowExpanded'");
+        document.getElementById("notifications").innerHTML += "Notification: " + notifyName + "<br>";
+        if (notifyCount == 3) {
             axTree.removeNotificationListener();
             window.layoutTestController.notifyDone();
         }
index fdd8039..b91d525 100644 (file)
@@ -1,4 +1,3 @@
-ALERT: Notification received successfully.
    
 This tests that aria-invalid causes the right attribute to be returned and it ensures a notification is sent when it changes.
 
@@ -13,4 +12,4 @@ PASS addedNotification is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
-
+Notification received successfully.
index 333a95e..f142edc 100644 (file)
@@ -13,6 +13,7 @@
 
 <p id="description"></p>
 <div id="console"></div>
+<div id="notifications"></div>
 
 <script>
 
@@ -21,7 +22,7 @@
     var notificationElement = 0;
     function notificationCallback(notification) {
         if (notification == "AXInvalidStatusChanged") {
-            alert("Notification received successfully.");
+            document.getElementById("notifications").innerHTML += "Notification received successfully.";
             notificationElement.removeNotificationListener();
             window.layoutTestController.notifyDone();
         }
index 51ab032..f834dd8 100644 (file)
@@ -1,4 +1,3 @@
-ALERT: Successfully received AXLiveRegionChanged
 text
 
 hellonew text element
@@ -11,4 +10,4 @@ PASS addedNotification is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
-
+Successfully received AXLiveRegionChanged
index 077d36b..2edbf60 100644 (file)
@@ -12,6 +12,7 @@
 
 <p id="description"></p>
 <div id="console"></div>
+<div id="notifications"></div>
 
 <script>
 
@@ -20,7 +21,7 @@
     var liveRegion = 0;
     function ariaCallback(notification) {
         if (notification == "AXLiveRegionChanged") {
-           alert("Successfully received " + notification);
+           document.getElementById("notifications").innerHTML += "Successfully received " + notification;
            liveRegion.removeNotificationListener();
            window.layoutTestController.notifyDone();
         }
index 9dcbeaf..b4f2f4e 100644 (file)
@@ -1,4 +1,3 @@
-ALERT: Successfully received AXLiveRegionChanged
 
 This tests that changing the alt tag of an image in a live region triggers a live region notification.
 
@@ -9,4 +8,4 @@ PASS addedNotification is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
-
+Successfully received AXLiveRegionChanged
index a17fe6d..d302e0d 100644 (file)
@@ -11,6 +11,7 @@
 
 <p id="description"></p>
 <div id="console"></div>
+<div id="notifications"></div>
 
 <script>
 
@@ -19,7 +20,7 @@
     var liveRegionAlt = 0;
     function ariaCallbackAlt(notification) {
         if (notification == "AXLiveRegionChanged") {
-           alert("Successfully received " + notification);
+           document.getElementById("notifications").innerHTML += "Successfully received " + notification;
            liveRegionAlt.removeNotificationListener();
            window.layoutTestController.notifyDone();
         }
index 799f71e..f758c8d 100644 (file)
@@ -1,4 +1,3 @@
-ALERT: Successfully received AXLiveRegionChanged
 changed text
 
 This tests that when you change text in a live region, the proper notification is sent.
@@ -10,4 +9,4 @@ PASS addedNotification is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
-
+Successfully received AXLiveRegionChanged
index 650104f..1602a49 100644 (file)
@@ -11,6 +11,7 @@
 
 <p id="description"></p>
 <div id="console"></div>
+<div id="notifications"></div>
 
 <script>
 
@@ -19,7 +20,7 @@
     var liveRegionText = 0;
     function ariaCallbackText(notification) {
         if (notification == "AXLiveRegionChanged") {
-           alert("Successfully received " + notification);
+           document.getElementById("notifications").innerHTML += "Successfully received " + notification;
            liveRegionText.removeNotificationListener();
            window.layoutTestController.notifyDone();
         }
index c5d7387..5d3f844 100644 (file)
@@ -1,4 +1,3 @@
-ALERT: Successfully received AXLiveRegionChanged
 
 This tests that ARIA removing an element from a live region sends the correct notification.
 
@@ -9,4 +8,4 @@ PASS addedNotification is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
-
+Successfully received AXLiveRegionChanged
index 9e2f825..c2ba993 100644 (file)
@@ -12,6 +12,7 @@
 
 <p id="description"></p>
 <div id="console"></div>
+<div id="notifications"></div>
 
 <script>
 
@@ -20,7 +21,7 @@
     var liveRegion = 0;
     function ariaCallback(notification) {
         if (notification == "AXLiveRegionChanged") {
-           alert("Successfully received " + notification);
+           document.getElementById("notifications").innerHTML += "Successfully received " + notification;
            liveRegion.removeNotificationListener();
            window.layoutTestController.notifyDone();
         }
index 51f6a59..ac5d201 100644 (file)
@@ -20,9 +20,7 @@ PASS body.childAtIndex(3).subrole is 'AXSubrole: AXDocumentArticle'
 PASS body.childAtIndex(4).subrole is 'AXSubrole: AXLandmarkNavigation'
 PASS body.childAtIndex(5).subrole is 'AXSubrole: AXLandmarkComplementary'
 PASS body.childAtIndex(6).childAtIndex(0).subrole is 'AXSubrole: '
-PASS body.childAtIndex(6).childAtIndex(1).subrole is 'AXSubrole: '
 PASS body.childAtIndex(7).childAtIndex(0).subrole is 'AXSubrole: '
-PASS body.childAtIndex(7).childAtIndex(1).subrole is 'AXSubrole: '
 PASS successfullyParsed is true
 
 TEST COMPLETE
index 93ffdeb..f047777 100644 (file)
 
           // When a header and footer are inside an article, they should not be landmarks.
           shouldBe("body.childAtIndex(6).childAtIndex(0).subrole", "'AXSubrole: '");
-          shouldBe("body.childAtIndex(6).childAtIndex(1).subrole", "'AXSubrole: '");
 
           // When a header and footer are inside a section, they should not be landmarks.
           shouldBe("body.childAtIndex(7).childAtIndex(0).subrole", "'AXSubrole: '");
-          shouldBe("body.childAtIndex(7).childAtIndex(1).subrole", "'AXSubrole: '");
     }
 
 </script>
index 7d78073..8a7ca2a 100644 (file)
@@ -1,5 +1,3 @@
-ALERT: Successfully received AXValueChanged
-ALERT: Successfully received AXValueChanged
 
 This tests that a basic range returns all the correct information for the mac platform.
 
@@ -19,4 +17,6 @@ PASS range.isEqual(hitTestRange) is true
 PASS successfullyParsed is true
 
 TEST COMPLETE
+Successfully received AXValueChanged
+Successfully received AXValueChanged
 
index 6fae1d4..37158cb 100644 (file)
@@ -8,6 +8,7 @@
 
 <p id="description"></p>
 <div id="console"></div>
+<div id="notifications"></div>
 
 <script>
 
@@ -17,7 +18,7 @@
     var valueChangeCount = 0;
     function notificationCallback(notification) {
         if (notification == "AXValueChanged") {
-           alert("Successfully received " + notification);
+           document.getElementById("notifications").innerHTML += "Successfully received " + notification + "<br>";
            valueChangeCount++;
         }
 
index 777f569..8138a9e 100644 (file)
@@ -14,7 +14,7 @@
 <input type="checkbox" value="Checkbox" /> checkbox<br />
 <input type="submit" value="Submit" />
 </form>
-<img id="image" src="resources/cake.png" />
+<img id="image" src="resources/cake.png" alt="Test">
 <h1>first heading level 1</h1>
 <h1>second heading level 1</h1>
 <h2>heading level 2</h2>
         var startElement;
         var isDirectionNext;
         var searchKey;
-        var searchText;
+        var searchText = "";
         var resultElement;
         
         // Any element.
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXAnyTypeSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXStaticText'");
         shouldBe("resultElement.stringValue", "'AXValue: first blockquote level 1'");
@@ -64,7 +63,6 @@
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXBlockquoteSameLevelSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXGroup'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: second blockquote level 1'");
@@ -73,7 +71,6 @@
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXBlockquoteSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXGroup'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: second blockquote level 1'");
@@ -82,7 +79,6 @@
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXBoldFontSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXGroup'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: sans-serif black bold text with underline'");
@@ -91,7 +87,6 @@
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXButtonSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXButton'");
         
@@ -99,7 +94,6 @@
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXCheckBoxSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXCheckBox'");
         
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXCheckBoxSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXCheckBox'");
         
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXDifferentTypeSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXStaticText'");
         shouldBe("resultElement.stringValue", "'AXValue: first blockquote level 1'");
         startElement = accessibilityController.focusedElement.childAtIndex(2);
         isDirectionNext = true;
         searchKey = "AXFontChangeSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXGroup'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: serif blue italic text'");
         startElement = accessibilityController.focusedElement.childAtIndex(2);
         isDirectionNext = true;
         searchKey = "AXFontColorChangeSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXGroup'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: serif blue italic text'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXGraphicSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXImage'");
         
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXHeadingLevel1SearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXHeading'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: first heading level 1'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXHeadingLevel2SearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXHeading'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: heading level 2'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXHeadingLevel3SearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXHeading'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: heading level 3'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXHeadingLevel4SearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXHeading'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: heading level 4'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXHeadingLevel5SearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXHeading'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: heading level 5'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXHeadingLevel6SearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXHeading'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: heading level 6'");
         startElement = accessibilityController.focusedElement.childAtIndex(6);
         isDirectionNext = true;
         searchKey = "AXHeadingSameLevelSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXHeading'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: second heading level 1'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXHeadingSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXHeading'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: first heading level 1'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXItalicFontSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXGroup'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: serif blue italic text'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXLandmarkSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXGroup'");
         shouldBe("resultElement.subrole", "'AXSubrole: AXLandmarkBanner'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXLinkSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXLink'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: link'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXListSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXList'");
         
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXLiveRegionSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXGroup'");
         shouldBe("resultElement.stringAttributeValue('AXARIALive')", "'polite'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXPlainTextSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXStaticText'");
         shouldBe("resultElement.stringValue", "'AXValue: first blockquote level 1'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXRadioGroupSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXRadioGroup'");
         
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXSameTypeSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXGroup'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: second blockquote level 1'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXStaticTextSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXStaticText'");
         shouldBe("resultElement.stringValue", "'AXValue: first blockquote level 1'");
         startElement = accessibilityController.focusedElement.childAtIndex(2);
         isDirectionNext = true;
         searchKey = "AXStyleChangeSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXGroup'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: serif blue italic text'");
         startElement = accessibilityController.focusedElement.childAtIndex(18);
         isDirectionNext = true;
         searchKey = "AXTableSameLevelSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXTable'");
         shouldBe("resultElement.childAtIndex(0).childAtIndex(0).childAtIndex(0).stringValue", "'AXValue: second table heading level 1'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXTableSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXTable'");
         shouldBe("resultElement.childAtIndex(0).childAtIndex(0).childAtIndex(0).stringValue", "'AXValue: first table heading level 1'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXTextFieldSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXTextField'");
         
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXUnderlineSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXGroup'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: sans-serif black bold text with underline'");
         startElement = accessibilityController.focusedElement.childAtIndex(0);
         isDirectionNext = true;
         searchKey = "AXUnvisitedLinkSearchKey";
-        searchText = null;
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXLink'");
         shouldBe("resultElement.childAtIndex(0).stringValue", "'AXValue: link'");
         // Previous text search.
         startElement = accessibilityController.focusedElement.childAtIndex(10);
         isDirectionNext = false;
-        searchKey = null;
+        searchKey = "";
         searchText = "sans-serif black bold text with underline";
         resultElement = containerElement.uiElementForSearchPredicate(startElement, isDirectionNext, searchKey, searchText);
         shouldBe("resultElement.role", "'AXRole: AXStaticText'");
index bdccd71..7a4ee05 100644 (file)
@@ -11,6 +11,7 @@ content inside
 
 <p id="description"></p>
 <div id="console"></div>
+<div id="notifications"></div>
 
 <script>
 
@@ -19,12 +20,12 @@ content inside
     var axTextbox = 0;
     function notificationCallback(notification) {
         if (notification == "AXValueChanged") {
-           alert("Successfully received " + notification);
+           document.getElementById("notifications").innerHTML += "Successfully received " + notification + "<br>";
            axTextbox.removeNotificationListener();
            window.layoutTestController.notifyDone();
         }
         else if (notification == "AXSelectedTextChanged") {
-           alert("Successfully received " + notification);
+           document.getElementById("notifications").innerHTML += "Successfully received " + notification + "<br>";
         }
     }
 
index dab790c..3d96fec 100644 (file)
@@ -1,6 +1,6 @@
-ALERT: Successfully received AXValueChanged.
-ALERT: Successfully received AXValueChanged.
-ALERT: Successfully received AXValueChanged.
 This tests that the AXValueChanged notification is correctly reported for non-native text boxes when content is changed.
 changed innerText
+Successfully received AXValueChanged.
+Successfully received AXValueChanged.
+Successfully received AXValueChanged.
 
index ff3960d..ccbf44d 100644 (file)
@@ -7,7 +7,9 @@
 This tests that the AXValueChanged notification is correctly reported for non-native text boxes when content is changed.<br>
 <div role="textbox" id="ariaTextBox" aria-multiline="false" tabindex="0">Some text in a textbox.</div>
 <div id="console"></div>
+<div id="notifications"></div>
 <script>
+    var textboxAxElement;
     if (window.layoutTestController && window.accessibilityController) {
         window.layoutTestController.waitUntilDone();
 
@@ -16,7 +18,7 @@ This tests that the AXValueChanged notification is correctly reported for non-na
 
         var ariaTextBox = document.getElementById("ariaTextBox");
         ariaTextBox.focus();
-        var textboxAxElement = accessibilityController.focusedElement;
+        textboxAxElement = accessibilityController.focusedElement;
         textboxAxElement.addNotificationListener(logNotification);
         pendingNotifications = 3;
         ariaTextBox.firstChild.deleteData(0, 5);
@@ -26,7 +28,7 @@ This tests that the AXValueChanged notification is correctly reported for non-na
 
     function logNotification(notification) {
         if (notification == "AXValueChanged") {
-            alert("Successfully received AXValueChanged.");
+            document.getElementById("notifications").innerHTML += "Successfully received AXValueChanged.<br>";
             pendingNotifications--;
             if (pendingNotifications == 0) {
                 textboxAxElement.removeNotificationListener();
index 530094f..8d904f2 100644 (file)
@@ -5,7 +5,7 @@ On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE
 
 
 PASS parent.childAtIndex(0).role is 'AXRole: AXButton'
-PASS parent.childAtIndex(1).role is 'AXRole: '
+PASS parent.childAtIndex(1) == null || parent.childAtIndex(1).isValid == false is true
 PASS parent.childAtIndex(0).role is 'AXRole: AXStaticText'
 PASS parent.childAtIndex(1).role is 'AXRole: AXButton'
 PASS successfullyParsed is true
index 392d6dd..86e5aa3 100644 (file)
@@ -25,7 +25,7 @@ if (window.layoutTestController)
         document.getElementById("parent").focus();
         var parent = accessibilityController.focusedElement;
         shouldBe("parent.childAtIndex(0).role", "'AXRole: AXButton'");
-        shouldBe("parent.childAtIndex(1).role", "'AXRole: '");
+        shouldBeTrue("parent.childAtIndex(1) == null || parent.childAtIndex(1).isValid == false");
   
         document.getElementById("button1").removeAttribute("role");
         document.getElementById("button2").setAttribute("role", "button");
index 4bd9169..b3d4bd6 100644 (file)
 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 #
 
-# WebKit2 needs to support accessibility
-# <https://bugs.webkit.org/show_bug.cgi?id=42130>
-# WebKitTestRunner needs to support accessibility-related DRT APIs
-# <https://bugs.webkit.org/show_bug.cgi?id=42131>
+# Windows does not support WebKit2 accessibility.
+# <https://bugs.webkit.org/show_bug.cgi?id=71296>
+accessibility
 platform/win/accessibility
 
 # WebKitTestRunner needs an implementation of layoutTestController.dumpIconChanges
index 58a9bbc..0e11f63 100644 (file)
 ########################################
 ### START OF (1) Classified failures with bug reports
 
-# WebKit2 needs to support accessibility
-# <https://bugs.webkit.org/show_bug.cgi?id=42130>
-# WebKitTestRunner needs to support accessibility-related DRT APIs
-# <https://bugs.webkit.org/show_bug.cgi?id=42131>
-accessibility
-platform/mac/accessibility
+# AX tests that require hit testing do not work in WK2.
+# <https://bugs.webkit.org/show_bug.cgi?id=71298>
+accessibility/loading-iframe-updates-axtree.html
+platform/mac/accessibility/html-slider-indicator.html
+platform/mac/accessibility/listbox-hit-test.html
+platform/mac/accessibility/iframe-with-title-correct-hierarchy.html
 
 # Some compositing tests flakey
 # <https://bugs.webkit.org/show_bug.cgi?id=48354>
index 40782fc..87a87ff 100644 (file)
@@ -1,3 +1,336 @@
+2011-11-16  Chris Fleizach  <cfleizach@apple.com>
+
+        WebKitTestRunner needs to support accessibility-related DRT APIs
+        https://bugs.webkit.org/show_bug.cgi?id=42131
+
+        Reviewed by Beth Dakin.
+
+        Port the AX code in DRT to WKTestRunner by using IDL.
+
+        * DumpRenderTree/AccessibilityUIElement.cpp:
+        (horizontalScrollbarCallback):
+        (verticalScrollbarCallback):
+        (AccessibilityUIElement::horizontalScrollbar):
+        (AccessibilityUIElement::verticalScrollbar):
+        (AccessibilityUIElement::getJSClass):
+        * DumpRenderTree/AccessibilityUIElement.h:
+        * DumpRenderTree/mac/AccessibilityUIElementMac.mm:
+        (AccessibilityUIElement::horizontalScrollbar):
+        (AccessibilityUIElement::verticalScrollbar):
+        * WebKitTestRunner/DerivedSources.make:
+        * WebKitTestRunner/GNUmakefile.am:
+        * WebKitTestRunner/InjectedBundle/AccessibilityController.cpp: Added.
+        (WTR::AccessibilityController::create):
+        (WTR::AccessibilityController::AccessibilityController):
+        (WTR::AccessibilityController::~AccessibilityController):
+        (WTR::AccessibilityController::makeWindowObject):
+        (WTR::AccessibilityController::wrapperClass):
+        (WTR::AccessibilityController::rootElement):
+        (WTR::AccessibilityController::focusedElement):
+        (WTR::AccessibilityController::elementAtPoint):
+        * WebKitTestRunner/InjectedBundle/AccessibilityController.h: Added.
+        (WTR::AccessibilityController::logFocusEvents):
+        (WTR::AccessibilityController::logValueChangeEvents):
+        (WTR::AccessibilityController::logScrollingStartEvents):
+        (WTR::AccessibilityController::logAccessibilityEvents):
+        (WTR::AccessibilityController::addNotificationListener):
+        (WTR::AccessibilityController::notificationReceived):
+        (WTR::AccessibilityController::resetToConsistentState):
+        * WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp: Added.
+        (WTR::AccessibilityTextMarker::create):
+        (WTR::AccessibilityTextMarker::AccessibilityTextMarker):
+        (WTR::AccessibilityTextMarker::~AccessibilityTextMarker):
+        (WTR::AccessibilityTextMarker::platformTextMarker):
+        (WTR::AccessibilityTextMarker::wrapperClass):
+        * WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.h: Added.
+        (WTR::AccessibilityTextMarker::isEqual):
+        * WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp: Added.
+        (WTR::AccessibilityTextMarkerRange::create):
+        (WTR::AccessibilityTextMarkerRange::AccessibilityTextMarkerRange):
+        (WTR::AccessibilityTextMarkerRange::~AccessibilityTextMarkerRange):
+        (WTR::AccessibilityTextMarkerRange::platformTextMarkerRange):
+        (WTR::AccessibilityTextMarkerRange::wrapperClass):
+        * WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.h: Added.
+        (WTR::AccessibilityTextMarkerRange::isEqual):
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp: Added.
+        (WTR::AccessibilityUIElement::create):
+        (WTR::AccessibilityUIElement::wrapperClass):
+        (WTR::AccessibilityUIElement::isValid):
+        (WTR::AccessibilityUIElement::AccessibilityUIElement):
+        (WTR::AccessibilityUIElement::~AccessibilityUIElement):
+        (WTR::AccessibilityUIElement::isEqual):
+        (WTR::AccessibilityUIElement::elementAtPoint):
+        (WTR::AccessibilityUIElement::childAtIndex):
+        (WTR::AccessibilityUIElement::indexOfChild):
+        (WTR::AccessibilityUIElement::childrenCount):
+        (WTR::AccessibilityUIElement::titleUIElement):
+        (WTR::AccessibilityUIElement::parentElement):
+        (WTR::AccessibilityUIElement::takeFocus):
+        (WTR::AccessibilityUIElement::takeSelection):
+        (WTR::AccessibilityUIElement::addSelection):
+        (WTR::AccessibilityUIElement::removeSelection):
+        (WTR::AccessibilityUIElement::allAttributes):
+        (WTR::AccessibilityUIElement::attributesOfLinkedUIElements):
+        (WTR::AccessibilityUIElement::linkedUIElementAtIndex):
+        (WTR::AccessibilityUIElement::attributesOfDocumentLinks):
+        (WTR::AccessibilityUIElement::attributesOfChildren):
+        (WTR::AccessibilityUIElement::parameterizedAttributeNames):
+        (WTR::AccessibilityUIElement::increment):
+        (WTR::AccessibilityUIElement::decrement):
+        (WTR::AccessibilityUIElement::showMenu):
+        (WTR::AccessibilityUIElement::press):
+        (WTR::AccessibilityUIElement::stringAttributeValue):
+        (WTR::AccessibilityUIElement::uiElementAttributeValue):
+        (WTR::AccessibilityUIElement::numberAttributeValue):
+        (WTR::AccessibilityUIElement::boolAttributeValue):
+        (WTR::AccessibilityUIElement::isAttributeSupported):
+        (WTR::AccessibilityUIElement::isAttributeSettable):
+        (WTR::AccessibilityUIElement::isActionSupported):
+        (WTR::AccessibilityUIElement::role):
+        (WTR::AccessibilityUIElement::subrole):
+        (WTR::AccessibilityUIElement::roleDescription):
+        (WTR::AccessibilityUIElement::title):
+        (WTR::AccessibilityUIElement::description):
+        (WTR::AccessibilityUIElement::language):
+        (WTR::AccessibilityUIElement::stringValue):
+        (WTR::AccessibilityUIElement::accessibilityValue):
+        (WTR::AccessibilityUIElement::helpText):
+        (WTR::AccessibilityUIElement::orientation):
+        (WTR::AccessibilityUIElement::x):
+        (WTR::AccessibilityUIElement::y):
+        (WTR::AccessibilityUIElement::width):
+        (WTR::AccessibilityUIElement::height):
+        (WTR::AccessibilityUIElement::intValue):
+        (WTR::AccessibilityUIElement::minValue):
+        (WTR::AccessibilityUIElement::maxValue):
+        (WTR::AccessibilityUIElement::valueDescription):
+        (WTR::AccessibilityUIElement::insertionPointLineNumber):
+        (WTR::AccessibilityUIElement::selectedTextRange):
+        (WTR::AccessibilityUIElement::isEnabled):
+        (WTR::AccessibilityUIElement::isRequired):
+        (WTR::AccessibilityUIElement::isFocused):
+        (WTR::AccessibilityUIElement::isFocusable):
+        (WTR::AccessibilityUIElement::isSelected):
+        (WTR::AccessibilityUIElement::isSelectable):
+        (WTR::AccessibilityUIElement::isMultiSelectable):
+        (WTR::AccessibilityUIElement::setSelectedChild):
+        (WTR::AccessibilityUIElement::selectedChildrenCount):
+        (WTR::AccessibilityUIElement::selectedChildAtIndex):
+        (WTR::AccessibilityUIElement::isExpanded):
+        (WTR::AccessibilityUIElement::isChecked):
+        (WTR::AccessibilityUIElement::isVisible):
+        (WTR::AccessibilityUIElement::isOffScreen):
+        (WTR::AccessibilityUIElement::isCollapsed):
+        (WTR::AccessibilityUIElement::isIgnored):
+        (WTR::AccessibilityUIElement::hasPopup):
+        (WTR::AccessibilityUIElement::hierarchicalLevel):
+        (WTR::AccessibilityUIElement::clickPointX):
+        (WTR::AccessibilityUIElement::clickPointY):
+        (WTR::AccessibilityUIElement::documentEncoding):
+        (WTR::AccessibilityUIElement::documentURI):
+        (WTR::AccessibilityUIElement::url):
+        (WTR::AccessibilityUIElement::speak):
+        (WTR::AccessibilityUIElement::attributesOfColumnHeaders):
+        (WTR::AccessibilityUIElement::attributesOfRowHeaders):
+        (WTR::AccessibilityUIElement::attributesOfColumns):
+        (WTR::AccessibilityUIElement::attributesOfRows):
+        (WTR::AccessibilityUIElement::attributesOfVisibleCells):
+        (WTR::AccessibilityUIElement::attributesOfHeader):
+        (WTR::AccessibilityUIElement::indexInTable):
+        (WTR::AccessibilityUIElement::rowIndexRange):
+        (WTR::AccessibilityUIElement::columnIndexRange):
+        (WTR::AccessibilityUIElement::rowCount):
+        (WTR::AccessibilityUIElement::columnCount):
+        (WTR::AccessibilityUIElement::selectedRowAtIndex):
+        (WTR::AccessibilityUIElement::disclosedByRow):
+        (WTR::AccessibilityUIElement::disclosedRowAtIndex):
+        (WTR::AccessibilityUIElement::ariaOwnsElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaFlowToElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaIsGrabbed):
+        (WTR::AccessibilityUIElement::ariaDropEffects):
+        (WTR::AccessibilityUIElement::lineForIndex):
+        (WTR::AccessibilityUIElement::rangeForLine):
+        (WTR::AccessibilityUIElement::boundsForRange):
+        (WTR::AccessibilityUIElement::setSelectedTextRange):
+        (WTR::AccessibilityUIElement::stringForRange):
+        (WTR::AccessibilityUIElement::attributedStringForRange):
+        (WTR::AccessibilityUIElement::attributedStringRangeIsMisspelled):
+        (WTR::AccessibilityUIElement::uiElementForSearchPredicate):
+        (WTR::AccessibilityUIElement::cellForColumnAndRow):
+        (WTR::AccessibilityUIElement::horizontalScrollbar):
+        (WTR::AccessibilityUIElement::verticalScrollbar):
+        (WTR::AccessibilityUIElement::addNotificationListener):
+        (WTR::AccessibilityUIElement::removeNotificationListener):
+        (WTR::AccessibilityUIElement::textMarkerRangeForElement):
+        (WTR::AccessibilityUIElement::textMarkerRangeLength):
+        (WTR::AccessibilityUIElement::textMarkerRangeForMarkers):
+        (WTR::AccessibilityUIElement::startTextMarkerForTextMarkerRange):
+        (WTR::AccessibilityUIElement::endTextMarkerForTextMarkerRange):
+        (WTR::AccessibilityUIElement::accessibilityElementForTextMarker):
+        (WTR::AccessibilityUIElement::textMarkerForPoint):
+        (WTR::AccessibilityUIElement::previousTextMarker):
+        (WTR::AccessibilityUIElement::nextTextMarker):
+        (WTR::AccessibilityUIElement::stringForTextMarkerRange):
+        * WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h: Added.
+        (WTR::AccessibilityUIElement::platformUIElement):
+        * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl: Added.
+        * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarker.idl: Added.
+        * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarkerRange.idl: Added.
+        * WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl: Added.
+        * WebKitTestRunner/InjectedBundle/Bindings/LayoutTestController.idl:
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.cpp:
+        (WTR::InjectedBundle::beginTesting):
+        * WebKitTestRunner/InjectedBundle/InjectedBundle.h:
+        (WTR::InjectedBundle::accessibilityController):
+        * WebKitTestRunner/InjectedBundle/InjectedBundlePage.cpp:
+        (WTR::InjectedBundlePage::didClearWindowForFrame):
+        * WebKitTestRunner/InjectedBundle/LayoutTestController.h:
+        * WebKitTestRunner/InjectedBundle/gtk/LayoutTestControllerGtk.cpp:
+        (WTR::LayoutTestController::platformName):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm: Added.
+        (WTR::AccessibilityTextMarker::isEqual):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm: Added.
+        (WTR::AccessibilityTextMarkerRange::isEqual):
+        * WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm: Added.
+        (+[NSString stringWithJSStringRef:]):
+        (-[NSString createJSStringRef]):
+        (-[AccessibilityNotificationHandler initWithPlatformElement:]):
+        (-[AccessibilityNotificationHandler dealloc]):
+        (-[AccessibilityNotificationHandler _notificationReceived:]):
+        (-[AccessibilityNotificationHandler setCallback:]):
+        (WTR::AccessibilityUIElement::AccessibilityUIElement):
+        (WTR::AccessibilityUIElement::~AccessibilityUIElement):
+        (WTR::AccessibilityUIElement::isEqual):
+        (WTR::descriptionOfValue):
+        (WTR::attributesOfElement):
+        (WTR::concatenateAttributeAndValue):
+        (WTR::convertNSArrayToVector):
+        (WTR::descriptionOfElements):
+        (WTR::AccessibilityUIElement::getLinkedUIElements):
+        (WTR::AccessibilityUIElement::getDocumentLinks):
+        (WTR::AccessibilityUIElement::getChildren):
+        (WTR::AccessibilityUIElement::getChildrenWithRange):
+        (WTR::AccessibilityUIElement::childrenCount):
+        (WTR::AccessibilityUIElement::elementAtPoint):
+        (WTR::AccessibilityUIElement::indexOfChild):
+        (WTR::AccessibilityUIElement::childAtIndex):
+        (WTR::AccessibilityUIElement::linkedUIElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaOwnsElementAtIndex):
+        (WTR::AccessibilityUIElement::ariaFlowToElementAtIndex):
+        (WTR::AccessibilityUIElement::disclosedRowAtIndex):
+        (WTR::AccessibilityUIElement::selectedChildAtIndex):
+        (WTR::AccessibilityUIElement::selectedChildrenCount):
+        (WTR::AccessibilityUIElement::selectedRowAtIndex):
+        (WTR::AccessibilityUIElement::titleUIElement):
+        (WTR::AccessibilityUIElement::parentElement):
+        (WTR::AccessibilityUIElement::disclosedByRow):
+        (WTR::AccessibilityUIElement::attributesOfLinkedUIElements):
+        (WTR::AccessibilityUIElement::attributesOfDocumentLinks):
+        (WTR::AccessibilityUIElement::attributesOfChildren):
+        (WTR::AccessibilityUIElement::allAttributes):
+        (WTR::AccessibilityUIElement::stringAttributeValue):
+        (WTR::AccessibilityUIElement::numberAttributeValue):
+        (WTR::AccessibilityUIElement::uiElementAttributeValue):
+        (WTR::AccessibilityUIElement::boolAttributeValue):
+        (WTR::AccessibilityUIElement::isAttributeSettable):
+        (WTR::AccessibilityUIElement::isAttributeSupported):
+        (WTR::AccessibilityUIElement::parameterizedAttributeNames):
+        (WTR::AccessibilityUIElement::role):
+        (WTR::AccessibilityUIElement::subrole):
+        (WTR::AccessibilityUIElement::roleDescription):
+        (WTR::AccessibilityUIElement::title):
+        (WTR::AccessibilityUIElement::description):
+        (WTR::AccessibilityUIElement::orientation):
+        (WTR::AccessibilityUIElement::stringValue):
+        (WTR::AccessibilityUIElement::language):
+        (WTR::AccessibilityUIElement::helpText):
+        (WTR::AccessibilityUIElement::x):
+        (WTR::AccessibilityUIElement::y):
+        (WTR::AccessibilityUIElement::width):
+        (WTR::AccessibilityUIElement::height):
+        (WTR::AccessibilityUIElement::clickPointX):
+        (WTR::AccessibilityUIElement::clickPointY):
+        (WTR::AccessibilityUIElement::intValue):
+        (WTR::AccessibilityUIElement::minValue):
+        (WTR::AccessibilityUIElement::maxValue):
+        (WTR::AccessibilityUIElement::valueDescription):
+        (WTR::AccessibilityUIElement::insertionPointLineNumber):
+        (WTR::AccessibilityUIElement::isActionSupported):
+        (WTR::AccessibilityUIElement::isEnabled):
+        (WTR::AccessibilityUIElement::isRequired):
+        (WTR::AccessibilityUIElement::isFocused):
+        (WTR::AccessibilityUIElement::isSelected):
+        (WTR::AccessibilityUIElement::isExpanded):
+        (WTR::AccessibilityUIElement::isChecked):
+        (WTR::AccessibilityUIElement::hierarchicalLevel):
+        (WTR::AccessibilityUIElement::speak):
+        (WTR::AccessibilityUIElement::ariaIsGrabbed):
+        (WTR::AccessibilityUIElement::ariaDropEffects):
+        (WTR::AccessibilityUIElement::lineForIndex):
+        (WTR::AccessibilityUIElement::rangeForLine):
+        (WTR::AccessibilityUIElement::boundsForRange):
+        (WTR::AccessibilityUIElement::stringForRange):
+        (WTR::AccessibilityUIElement::attributedStringForRange):
+        (WTR::AccessibilityUIElement::attributedStringRangeIsMisspelled):
+        (WTR::AccessibilityUIElement::uiElementForSearchPredicate):
+        (WTR::AccessibilityUIElement::attributesOfColumnHeaders):
+        (WTR::AccessibilityUIElement::attributesOfRowHeaders):
+        (WTR::AccessibilityUIElement::attributesOfColumns):
+        (WTR::AccessibilityUIElement::attributesOfRows):
+        (WTR::AccessibilityUIElement::attributesOfVisibleCells):
+        (WTR::AccessibilityUIElement::attributesOfHeader):
+        (WTR::AccessibilityUIElement::rowCount):
+        (WTR::AccessibilityUIElement::columnCount):
+        (WTR::AccessibilityUIElement::indexInTable):
+        (WTR::AccessibilityUIElement::rowIndexRange):
+        (WTR::AccessibilityUIElement::columnIndexRange):
+        (WTR::AccessibilityUIElement::cellForColumnAndRow):
+        (WTR::AccessibilityUIElement::horizontalScrollbar):
+        (WTR::AccessibilityUIElement::verticalScrollbar):
+        (WTR::AccessibilityUIElement::selectedTextRange):
+        (WTR::AccessibilityUIElement::setSelectedTextRange):
+        (WTR::AccessibilityUIElement::increment):
+        (WTR::AccessibilityUIElement::decrement):
+        (WTR::AccessibilityUIElement::showMenu):
+        (WTR::AccessibilityUIElement::press):
+        (WTR::AccessibilityUIElement::setSelectedChild):
+        (WTR::AccessibilityUIElement::accessibilityValue):
+        (WTR::AccessibilityUIElement::documentEncoding):
+        (WTR::AccessibilityUIElement::documentURI):
+        (WTR::AccessibilityUIElement::url):
+        (WTR::AccessibilityUIElement::addNotificationListener):
+        (WTR::AccessibilityUIElement::removeNotificationListener):
+        (WTR::AccessibilityUIElement::isFocusable):
+        (WTR::AccessibilityUIElement::isSelectable):
+        (WTR::AccessibilityUIElement::isMultiSelectable):
+        (WTR::AccessibilityUIElement::isVisible):
+        (WTR::AccessibilityUIElement::isOffScreen):
+        (WTR::AccessibilityUIElement::isCollapsed):
+        (WTR::AccessibilityUIElement::isIgnored):
+        (WTR::AccessibilityUIElement::hasPopup):
+        (WTR::AccessibilityUIElement::takeFocus):
+        (WTR::AccessibilityUIElement::takeSelection):
+        (WTR::AccessibilityUIElement::addSelection):
+        (WTR::AccessibilityUIElement::removeSelection):
+        (WTR::AccessibilityUIElement::textMarkerRangeForElement):
+        (WTR::AccessibilityUIElement::textMarkerRangeLength):
+        (WTR::AccessibilityUIElement::previousTextMarker):
+        (WTR::AccessibilityUIElement::nextTextMarker):
+        (WTR::AccessibilityUIElement::stringForTextMarkerRange):
+        (WTR::AccessibilityUIElement::textMarkerRangeForMarkers):
+        (WTR::AccessibilityUIElement::startTextMarkerForTextMarkerRange):
+        (WTR::AccessibilityUIElement::endTextMarkerForTextMarkerRange):
+        (WTR::AccessibilityUIElement::textMarkerForPoint):
+        (WTR::AccessibilityUIElement::accessibilityElementForTextMarker):
+        * WebKitTestRunner/InjectedBundle/mac/LayoutTestControllerMac.mm:
+        (WTR::LayoutTestController::platformName):
+        * WebKitTestRunner/InjectedBundle/qt/LayoutTestControllerQt.cpp:
+        (WTR::LayoutTestController::platformName):
+        * WebKitTestRunner/InjectedBundle/win/LayoutTestControllerWin.cpp:
+        (WTR::LayoutTestController::platformName):
+        * WebKitTestRunner/WebKitTestRunner.xcodeproj/project.pbxproj:
+        * WebKitTestRunner/win/InjectedBundle.vcproj:
+
 2011-11-16  Tor Arne Vestbø  <tor.arne.vestbo@nokia.com>
 
         [Qt] Fix use of config.tests
index ebe1d48..8673857 100644 (file)
@@ -803,6 +803,16 @@ static JSValueRef selectedChildrenCountCallback(JSContextRef context, JSObjectRe
     return JSValueMakeNumber(context, toAXElement(thisObject)->selectedChildrenCount());
 }
 
+static JSValueRef horizontalScrollbarCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->horizontalScrollbar());
+}
+
+static JSValueRef verticalScrollbarCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef propertyName, JSValueRef* exception)
+{
+    return AccessibilityUIElement::makeJSAccessibilityUIElement(context, toAXElement(thisObject)->verticalScrollbar());
+}
+
 static JSValueRef getHasPopupCallback(JSContextRef context, JSObjectRef thisObject, JSStringRef, JSValueRef*)
 {
     return JSValueMakeBoolean(context, toAXElement(thisObject)->hasPopup());
@@ -868,6 +878,8 @@ JSStringRef AccessibilityUIElement::rangeForLine(int line) { return 0; }
 void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement*) const { }
 unsigned AccessibilityUIElement::selectedChildrenCount() const { return 0; }
 AccessibilityUIElement AccessibilityUIElement::selectedChildAtIndex(unsigned) const { return 0; }
+AccessibilityUIElement AccessibilityUIElement::horizontalScrollbar() const { return 0; }
+AccessibilityUIElement AccessibilityUIElement::verticalScrollbar() const { return 0; }
 AccessibilityUIElement AccessibilityUIElement::uiElementAttributeValue(JSStringRef) const { return 0; }
 #endif
 
@@ -997,6 +1009,8 @@ JSClassRef AccessibilityUIElement::getJSClass()
         { "isIgnored", isIgnoredCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "speak", speakCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { "selectedChildrenCount", selectedChildrenCountCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "horizontalScrollbar", horizontalScrollbarCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
+        { "verticalScrollbar", verticalScrollbarCallback, 0, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete },
         { 0, 0, 0, 0 }
     };
 
index 8f1e38a..036f521 100644 (file)
@@ -199,6 +199,10 @@ public:
     // Table-specific
     AccessibilityUIElement cellForColumnAndRow(unsigned column, unsigned row);
 
+    // Scrollarea-specific
+    AccessibilityUIElement horizontalScrollbar() const;
+    AccessibilityUIElement verticalScrollbar() const;
+
     // Text markers.
     AccessibilityTextMarkerRange textMarkerRangeForElement(AccessibilityUIElement*);    
     AccessibilityTextMarkerRange textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker);
index 1ac2710..02c605e 100644 (file)
@@ -1117,6 +1117,22 @@ AccessibilityUIElement AccessibilityUIElement::cellForColumnAndRow(unsigned col,
     return 0;
 }
 
+AccessibilityUIElement AccessibilityUIElement::horizontalScrollbar() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    return AccessibilityUIElement([m_element accessibilityAttributeValue:NSAccessibilityHorizontalScrollBarAttribute]);
+    END_AX_OBJC_EXCEPTIONS    
+    
+    return 0;
+}
+
+AccessibilityUIElement AccessibilityUIElement::verticalScrollbar() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    return AccessibilityUIElement([m_element accessibilityAttributeValue:NSAccessibilityVerticalScrollBarAttribute]);
+    END_AX_OBJC_EXCEPTIONS        
+}
+
 JSStringRef AccessibilityUIElement::selectedTextRange()
 {
     NSRange range = NSMakeRange(NSNotFound, 0);
index ed1531b..187d41c 100644 (file)
@@ -26,6 +26,10 @@ VPATH = \
 #
 
 INTERFACES = \
+    AccessibilityController \
+    AccessibilityTextMarker \
+    AccessibilityTextMarkerRange \
+    AccessibilityUIElement \
     EventSendingController \
     GCController \
     LayoutTestController \
index b840537..8ddce12 100644 (file)
@@ -62,6 +62,10 @@ Programs_WebKitTestRunner_LDFLAGS = \
 noinst_LTLIBRARIES += Libraries/libTestRunnerInjectedBundle.la
 
 webkittestrunner_built_sources += \
+       DerivedSources/InjectedBundle/JSAccessibilityController.cpp \
+       DerivedSources/InjectedBundle/JSAccessibilityTextMarker.cpp \
+       DerivedSources/InjectedBundle/JSAccessibilityTextMarkerRange.cpp \
+       DerivedSources/InjectedBundle/JSAccessibilityUIElement.cpp \
        DerivedSources/InjectedBundle/JSEventSendingController.cpp \
        DerivedSources/InjectedBundle/JSGCController.cpp \
        DerivedSources/InjectedBundle/JSLayoutTestController.cpp \
@@ -70,6 +74,14 @@ nodist_Libraries_libTestRunnerInjectedBundle_la_SOURCES = $(webkittestrunner_bui
 BUILT_SOURCES += $(webkittestrunner_built_sources)
 
 Libraries_libTestRunnerInjectedBundle_la_SOURCES = \
+       Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp \
+       Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h \
+       Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp \
+       Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.h \
+       Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp \
+       Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.h \
+       Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp \
+       Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h \
        Tools/WebKitTestRunner/InjectedBundle/ActivateFonts.h \
        Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrappable.h \
        Tools/WebKitTestRunner/InjectedBundle/Bindings/JSWrapper.cpp \
diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.cpp
new file mode 100644 (file)
index 0000000..42585b4
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2011 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. 
+ */
+
+#include "config.h"
+#include "AccessibilityController.h"
+
+#include "AccessibilityUIElement.h"
+#include "InjectedBundle.h"
+#include "InjectedBundlePage.h"
+#include "JSAccessibilityController.h"
+
+#include <JavaScriptCore/JSRetainPtr.h>
+#include <WebKit2/WKBundle.h>
+#include <WebKit2/WKBundlePage.h>
+#include <WebKit2/WKBundlePagePrivate.h>
+
+namespace WTR {
+
+PassRefPtr<AccessibilityController> AccessibilityController::create()
+{
+    return adoptRef(new AccessibilityController);
+}
+
+AccessibilityController::AccessibilityController()
+{
+}
+
+AccessibilityController::~AccessibilityController()
+{
+}
+
+void AccessibilityController::makeWindowObject(JSContextRef context, JSObjectRef windowObject, JSValueRef* exception)
+{
+    setProperty(context, windowObject, "accessibilityController", this, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontDelete, exception);
+}
+
+JSClassRef AccessibilityController::wrapperClass()
+{
+    return JSAccessibilityController::accessibilityControllerClass();
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityController::rootElement()
+{
+    // FIXME: Make this work on Windows.
+#if PLATFORM(WIN)
+    return 0;
+#else
+    WKBundlePageRef page = InjectedBundle::shared().page()->page();
+    void* root = WKAccessibilityRootObject(page);
+    
+    return AccessibilityUIElement::create(static_cast<PlatformUIElement>(root));    
+#endif
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityController::focusedElement()
+{
+    // FIXME: Make this work on Windows.
+#if PLATFORM(WIN)
+    return 0;
+#else    
+    WKBundlePageRef page = InjectedBundle::shared().page()->page();
+    void* root = WKAccessibilityFocusedObject(page);
+    
+    return AccessibilityUIElement::create(static_cast<PlatformUIElement>(root));    
+#endif
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityController::elementAtPoint(int x, int y)
+{
+    RefPtr<AccessibilityUIElement> uiElement = rootElement();
+    return uiElement->elementAtPoint(x, y);
+}
+    
+} // namespace WTR
+
diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityController.h
new file mode 100644 (file)
index 0000000..ae73a75
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2011 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. 
+ */
+
+#ifndef AccessibilityController_h
+#define AccessibilityController_h
+
+#include "AccessibilityUIElement.h"
+#include "JSWrappable.h"
+#include <JavaScriptCore/JSObjectRef.h>
+#include <wtf/Platform.h>
+#if PLATFORM(WIN)
+#include <windows.h>
+#endif
+
+namespace WTR {
+    
+class AccessibilityController : public JSWrappable {
+public:
+    static PassRefPtr<AccessibilityController> create();
+    ~AccessibilityController();
+
+    void makeWindowObject(JSContextRef, JSObjectRef windowObject, JSValueRef* exception);
+    virtual JSClassRef wrapperClass();
+    
+    // Controller Methods - platform-independent implementations.
+    PassRefPtr<AccessibilityUIElement> rootElement();
+    PassRefPtr<AccessibilityUIElement> focusedElement();
+    PassRefPtr<AccessibilityUIElement> elementAtPoint(int x, int y);
+
+    // Here for consistency with DRT. Not implemented because they don't do anything on the Mac.
+    void logFocusEvents() { }
+    void logValueChangeEvents() { }
+    void logScrollingStartEvents() { }
+    void logAccessibilityEvents() { }
+    void addNotificationListener(AccessibilityUIElement*, JSValueRef functionCallback) { }
+    void notificationReceived(AccessibilityUIElement*, JSStringRef eventName) { }
+    
+    void resetToConsistentState() { }
+
+private:
+    AccessibilityController();
+};
+
+} // namespace WTR
+
+#endif // AccessibilityController_h
diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.cpp
new file mode 100644 (file)
index 0000000..092333e
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2011 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. 
+ */
+
+#include "config.h"
+#include "AccessibilityTextMarker.h"
+
+#include "AccessibilityUIElement.h"
+#include "JSAccessibilityTextMarker.h"
+
+#include <JavaScriptCore/JSRetainPtr.h>
+
+namespace WTR {
+    
+PassRefPtr<AccessibilityTextMarker> AccessibilityTextMarker::create(PlatformTextMarker marker)
+{
+    return adoptRef(new AccessibilityTextMarker(marker));
+}
+
+PassRefPtr<AccessibilityTextMarker> AccessibilityTextMarker::create(const AccessibilityTextMarker& marker)
+{
+    return adoptRef(new AccessibilityTextMarker(marker));
+}
+
+AccessibilityTextMarker::AccessibilityTextMarker(PlatformTextMarker marker)
+    : m_textMarker(marker)
+{
+}
+
+AccessibilityTextMarker::AccessibilityTextMarker(const AccessibilityTextMarker& marker)
+    : m_textMarker(marker.platformTextMarker())
+{
+}
+
+AccessibilityTextMarker::~AccessibilityTextMarker()
+{
+}
+
+PlatformTextMarker AccessibilityTextMarker::platformTextMarker() const
+{
+#if PLATFORM(MAC)
+    return m_textMarker.get();
+#else
+    return m_textMarker;
+#endif
+}
+    
+JSClassRef AccessibilityTextMarker::wrapperClass()
+{
+    return JSAccessibilityTextMarker::accessibilityTextMarkerClass();
+}
+
+} // namespace WTR
+
diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.h b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarker.h
new file mode 100644 (file)
index 0000000..c4d4d04
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2011 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. 
+ */
+
+#ifndef AccessibilityTextMarker_h
+#define AccessibilityTextMarker_h
+
+#include "JSWrappable.h"
+#include <JavaScriptCore/JSObjectRef.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/Platform.h>
+
+#if PLATFORM(MAC)
+#include <wtf/RetainPtr.h>
+typedef CFTypeRef PlatformTextMarker;
+#else
+typedef void* PlatformTextMarker;
+#endif
+
+namespace WTR {
+
+class AccessibilityUIElement;
+
+class AccessibilityTextMarker : public JSWrappable {
+public:
+    static PassRefPtr<AccessibilityTextMarker> create(PlatformTextMarker);
+    static PassRefPtr<AccessibilityTextMarker> create(const AccessibilityTextMarker&);
+
+    ~AccessibilityTextMarker();
+    
+    PlatformTextMarker platformTextMarker() const;
+    virtual JSClassRef wrapperClass();
+
+    static JSObjectRef makeJSAccessibilityTextMarker(JSContextRef, const AccessibilityTextMarker&);
+    bool isEqual(AccessibilityTextMarker*);
+    
+private:
+    AccessibilityTextMarker(PlatformTextMarker);
+    AccessibilityTextMarker(const AccessibilityTextMarker&);
+
+#if PLATFORM(MAC)
+    RetainPtr<PlatformTextMarker> m_textMarker;
+#else
+    PlatformTextMarker m_textMarker;
+#endif
+};
+
+#if !PLATFORM(MAC)
+inline bool AccessibilityTextMarker::isEqual(AccessibilityTextMarker*) { return false; }
+#endif
+
+} // namespace WTR
+    
+#endif // AccessibilityTextMarker_h
diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.cpp
new file mode 100644 (file)
index 0000000..d05f69c
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2011 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. 
+ */
+
+#include "config.h"
+#include "AccessibilityTextMarker.h"
+
+#include "AccessibilityUIElement.h"
+#include "JSAccessibilityTextMarkerRange.h"
+
+#include <JavaScriptCore/JSRetainPtr.h>
+
+namespace WTR {
+    
+PassRefPtr<AccessibilityTextMarkerRange> AccessibilityTextMarkerRange::create(PlatformTextMarkerRange markerRange)
+{
+    return adoptRef(new AccessibilityTextMarkerRange(markerRange));
+}
+
+PassRefPtr<AccessibilityTextMarkerRange> AccessibilityTextMarkerRange::create(const AccessibilityTextMarkerRange& markerRange)
+{
+    return adoptRef(new AccessibilityTextMarkerRange(markerRange));
+}
+
+AccessibilityTextMarkerRange::AccessibilityTextMarkerRange(PlatformTextMarkerRange markerRange)
+    : m_textMarkerRange(markerRange)
+{
+}
+
+AccessibilityTextMarkerRange::AccessibilityTextMarkerRange(const AccessibilityTextMarkerRange& markerRange)
+    : m_textMarkerRange(markerRange.platformTextMarkerRange())
+{
+}
+
+AccessibilityTextMarkerRange::~AccessibilityTextMarkerRange()
+{
+}
+
+PlatformTextMarkerRange AccessibilityTextMarkerRange::platformTextMarkerRange() const
+{
+#if PLATFORM(MAC)
+    return m_textMarkerRange.get();
+#else
+    return m_textMarkerRange;
+#endif
+}
+    
+JSClassRef AccessibilityTextMarkerRange::wrapperClass()
+{
+    return JSAccessibilityTextMarkerRange::accessibilityTextMarkerRangeClass();
+}
+    
+} // namespace WTR
+
diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.h b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityTextMarkerRange.h
new file mode 100644 (file)
index 0000000..e57a29c
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Copyright (C) 2011 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. 
+ */
+
+#ifndef AccessibilityTextMarkerRange_h
+#define AccessibilityTextMarkerRange_h
+
+#include "JSWrappable.h"
+#include <JavaScriptCore/JSObjectRef.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/Platform.h>
+
+#if PLATFORM(MAC)
+#include <wtf/RetainPtr.h>
+typedef CFTypeRef PlatformTextMarkerRange;
+#else
+typedef void* PlatformTextMarkerRange;
+#endif
+
+namespace WTR {
+    
+class AccessibilityTextMarkerRange : public JSWrappable {
+public:
+    static PassRefPtr<AccessibilityTextMarkerRange> create(PlatformTextMarkerRange);
+    static PassRefPtr<AccessibilityTextMarkerRange> create(const AccessibilityTextMarkerRange&);
+    
+    ~AccessibilityTextMarkerRange();
+    
+    PlatformTextMarkerRange platformTextMarkerRange() const;
+    virtual JSClassRef wrapperClass();
+    
+    static JSObjectRef makeJSAccessibilityTextMarkerRange(JSContextRef, const AccessibilityTextMarkerRange&);
+    bool isEqual(AccessibilityTextMarkerRange*);
+    
+private:
+    AccessibilityTextMarkerRange(PlatformTextMarkerRange);
+    AccessibilityTextMarkerRange(const AccessibilityTextMarkerRange&);
+    
+#if PLATFORM(MAC)
+    RetainPtr<PlatformTextMarkerRange> m_textMarkerRange;
+#else
+    PlatformTextMarkerRange m_textMarkerRange;
+#endif
+};
+    
+#if !PLATFORM(MAC)
+inline bool AccessibilityTextMarkerRange::isEqual(AccessibilityTextMarkerRange*) { return false; }
+#endif
+    
+} // namespace WTR
+
+#endif // AccessibilityTextMarkerRange_h
diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp
new file mode 100644 (file)
index 0000000..4f41c88
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * Copyright (C) 2011 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. 
+ */
+
+#include "config.h"
+#include "AccessibilityUIElement.h"
+
+#include "JSAccessibilityUIElement.h"
+#include <JavaScriptCore/JSRetainPtr.h>
+
+namespace WTR {
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::create(PlatformUIElement uiElement)
+{
+    return adoptRef(new AccessibilityUIElement(uiElement));
+}
+    
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::create(const AccessibilityUIElement& uiElement)
+{
+    return adoptRef(new AccessibilityUIElement(uiElement));
+}
+
+JSClassRef AccessibilityUIElement::wrapperClass()
+{
+    return JSAccessibilityUIElement::accessibilityUIElementClass();
+}
+    
+// Implementation
+
+bool AccessibilityUIElement::isValid() const
+{
+    return m_element;            
+}
+    
+// Unsupported methods on various platforms. As they're implemented on other platforms this list should be modified.
+#if !PLATFORM(MAC)
+AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement) { }
+AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement&) { }
+AccessibilityUIElement::~AccessibilityUIElement() { }
+bool AccessibilityUIElement::isEqual(AccessibilityUIElement*) { return false; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::elementAtPoint(int, int) { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::childAtIndex(unsigned) { return 0; }
+unsigned AccessibilityUIElement::indexOfChild(AccessibilityUIElement*) { return 0; }
+int AccessibilityUIElement::childrenCount() { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::titleUIElement() { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::parentElement() { return 0; }
+void AccessibilityUIElement::takeFocus() { }
+void AccessibilityUIElement::takeSelection() { }
+void AccessibilityUIElement::addSelection() { }
+void AccessibilityUIElement::removeSelection() { }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfLinkedUIElements() { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::linkedUIElementAtIndex(unsigned) { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfDocumentLinks() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfChildren() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::parameterizedAttributeNames() { return 0; }
+void AccessibilityUIElement::increment() { }
+void AccessibilityUIElement::decrement() { }
+void AccessibilityUIElement::showMenu() { }
+void AccessibilityUIElement::press() { }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef) { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementAttributeValue(JSStringRef) const { return 0; }
+double AccessibilityUIElement::numberAttributeValue(JSStringRef) { return 0; }
+bool AccessibilityUIElement::boolAttributeValue(JSStringRef) { return false; }
+bool AccessibilityUIElement::isAttributeSupported(JSStringRef) { return false; }
+bool AccessibilityUIElement::isAttributeSettable(JSStringRef) { return false; }
+bool AccessibilityUIElement::isActionSupported(JSStringRef) { return false; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::role() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::subrole() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::roleDescription() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::title() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::description() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::language() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringValue() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::accessibilityValue() const { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::helpText() const { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::orientation() const { return 0; }
+double AccessibilityUIElement::x() { return 0; }
+double AccessibilityUIElement::y() { return 0; }
+double AccessibilityUIElement::width() { return 0; }
+double AccessibilityUIElement::height() { return 0; }
+double AccessibilityUIElement::intValue() const { return 0; }
+double AccessibilityUIElement::minValue() { return 0; }
+double AccessibilityUIElement::maxValue() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::valueDescription() { return 0; }
+int AccessibilityUIElement::insertionPointLineNumber() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::selectedTextRange() { return 0; }
+bool AccessibilityUIElement::isEnabled() { return false; }
+bool AccessibilityUIElement::isRequired() const { return false; }
+bool AccessibilityUIElement::isFocused() const { return false; }
+bool AccessibilityUIElement::isFocusable() const { return false; }
+bool AccessibilityUIElement::isSelected() const { return false; }
+bool AccessibilityUIElement::isSelectable() const { return false; }
+bool AccessibilityUIElement::isMultiSelectable() const { return false; }
+void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement*) const { }
+unsigned AccessibilityUIElement::selectedChildrenCount() const { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedChildAtIndex(unsigned) const { return 0; }
+bool AccessibilityUIElement::isExpanded() const { return false; }
+bool AccessibilityUIElement::isChecked() const { return false; }
+bool AccessibilityUIElement::isVisible() const { return false; }
+bool AccessibilityUIElement::isOffScreen() const { return false; }
+bool AccessibilityUIElement::isCollapsed() const { return false; }
+bool AccessibilityUIElement::isIgnored() const { return false; }
+bool AccessibilityUIElement::hasPopup() const { return false; }
+int AccessibilityUIElement::hierarchicalLevel() const { return 0; }
+double AccessibilityUIElement::clickPointX() { return 0; }
+double AccessibilityUIElement::clickPointY() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::documentEncoding() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::documentURI() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::url() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::speak() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumnHeaders() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRowHeaders() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumns() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRows() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfVisibleCells() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfHeader() { return 0; }
+int AccessibilityUIElement::indexInTable() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::rowIndexRange() { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::columnIndexRange() { return 0; }
+int AccessibilityUIElement::rowCount() { return 0; }
+int AccessibilityUIElement::columnCount() { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedRowAtIndex(unsigned) { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedByRow() { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedRowAtIndex(unsigned) { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned) { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned) { return 0; }
+bool AccessibilityUIElement::ariaIsGrabbed() const { return false; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::ariaDropEffects() const { return 0; }
+int AccessibilityUIElement::lineForIndex(int) { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int) { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned, unsigned) { return 0; }
+void AccessibilityUIElement::setSelectedTextRange(unsigned, unsigned) { }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForRange(unsigned, unsigned) { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned, unsigned) { return 0; }
+bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned, unsigned) { return false; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementForSearchPredicate(AccessibilityUIElement*, bool, JSStringRef, JSStringRef) { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::cellForColumnAndRow(unsigned, unsigned) { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::horizontalScrollbar() const { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::verticalScrollbar() const { return 0; }
+bool AccessibilityUIElement::addNotificationListener(JSValueRef) { return false; }
+bool AccessibilityUIElement::removeNotificationListener() { return false; }
+PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForElement(AccessibilityUIElement*) { return 0; }
+int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange*) { return 0; }
+PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker*, AccessibilityTextMarker*) { return 0; }
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker*) { return 0; }
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForPoint(int, int) { return 0; }
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker*) { return 0; }
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker*) { return 0; }
+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange*) { return 0; }
+#endif
+
+} // namespace WTR
+
diff --git a/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h b/Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
new file mode 100644 (file)
index 0000000..e2e1f26
--- /dev/null
@@ -0,0 +1,247 @@
+/*
+ * Copyright (C) 2011 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. 
+ */
+
+#ifndef AccessibilityUIElement_h
+#define AccessibilityUIElement_h
+
+#include "AccessibilityTextMarker.h"
+#include "AccessibilityTextMarkerRange.h"
+#include "JSWrappable.h"
+
+#include <JavaScriptCore/JSObjectRef.h>
+#include <JavaScriptCore/JSRetainPtr.h>
+#include <wtf/Platform.h>
+#include <wtf/Vector.h>
+
+#if PLATFORM(MAC)
+#ifdef __OBJC__
+typedef id PlatformUIElement;
+#else
+typedef struct objc_object* PlatformUIElement;
+#endif
+#elif PLATFORM(WIN)
+#undef _WINSOCKAPI_
+#define _WINSOCKAPI_ // Prevent inclusion of winsock.h in windows.h
+
+#include <WebCore/COMPtr.h>
+#include <oleacc.h>
+
+typedef COMPtr<IAccessible> PlatformUIElement;
+#elif PLATFORM(GTK)
+#include <atk/atk.h>
+typedef AtkObject* PlatformUIElement;
+#else
+typedef void* PlatformUIElement;
+#endif
+
+#if PLATFORM(MAC)
+#ifdef __OBJC__
+typedef id NotificationHandler;
+#else
+typedef struct objc_object* NotificationHandler;
+#endif
+#endif
+
+namespace WTR {
+
+class AccessibilityUIElement : public JSWrappable {
+public:
+    static PassRefPtr<AccessibilityUIElement> create(PlatformUIElement);
+    static PassRefPtr<AccessibilityUIElement> create(const AccessibilityUIElement&);
+
+    ~AccessibilityUIElement();
+
+    PlatformUIElement platformUIElement() { return m_element; }
+    virtual JSClassRef wrapperClass();
+
+    static JSObjectRef makeJSAccessibilityUIElement(JSContextRef, const AccessibilityUIElement&);
+
+    bool isEqual(AccessibilityUIElement* otherElement);
+    
+    PassRefPtr<AccessibilityUIElement> elementAtPoint(int x, int y);
+    PassRefPtr<AccessibilityUIElement> childAtIndex(unsigned);
+    unsigned indexOfChild(AccessibilityUIElement*);
+    int childrenCount();
+    PassRefPtr<AccessibilityUIElement> titleUIElement();
+    PassRefPtr<AccessibilityUIElement> parentElement();
+
+    void takeFocus();
+    void takeSelection();
+    void addSelection();
+    void removeSelection();
+
+    // Methods - platform-independent implementations
+    JSRetainPtr<JSStringRef> allAttributes();
+    JSRetainPtr<JSStringRef> attributesOfLinkedUIElements();
+    PassRefPtr<AccessibilityUIElement> linkedUIElementAtIndex(unsigned);
+    
+    JSRetainPtr<JSStringRef> attributesOfDocumentLinks();
+    JSRetainPtr<JSStringRef> attributesOfChildren();
+    JSRetainPtr<JSStringRef> parameterizedAttributeNames();
+    void increment();
+    void decrement();
+    void showMenu();
+    void press();
+
+    // Attributes - platform-independent implementations
+    JSRetainPtr<JSStringRef> stringAttributeValue(JSStringRef attribute);
+    double numberAttributeValue(JSStringRef attribute);
+    PassRefPtr<AccessibilityUIElement> uiElementAttributeValue(JSStringRef attribute) const;
+    bool boolAttributeValue(JSStringRef attribute);
+    bool isAttributeSupported(JSStringRef attribute);
+    bool isAttributeSettable(JSStringRef attribute);
+    bool isActionSupported(JSStringRef action);
+    JSRetainPtr<JSStringRef> role();
+    JSRetainPtr<JSStringRef> subrole();
+    JSRetainPtr<JSStringRef> roleDescription();
+    JSRetainPtr<JSStringRef> title();
+    JSRetainPtr<JSStringRef> description();
+    JSRetainPtr<JSStringRef> language();
+    JSRetainPtr<JSStringRef> stringValue();
+    JSRetainPtr<JSStringRef> accessibilityValue() const;
+    JSRetainPtr<JSStringRef> helpText() const;
+    JSRetainPtr<JSStringRef> orientation() const;
+    double x();
+    double y();
+    double width();
+    double height();
+    double intValue() const;
+    double minValue();
+    double maxValue();
+    JSRetainPtr<JSStringRef> valueDescription();
+    int insertionPointLineNumber();
+    JSRetainPtr<JSStringRef> selectedTextRange();
+    bool isEnabled();
+    bool isRequired() const;
+    
+    bool isFocused() const;
+    bool isFocusable() const;
+    bool isSelected() const;
+    bool isSelectable() const;
+    bool isMultiSelectable() const;
+    void setSelectedChild(AccessibilityUIElement*) const;
+    unsigned selectedChildrenCount() const;
+    PassRefPtr<AccessibilityUIElement> selectedChildAtIndex(unsigned) const;
+    
+    bool isValid() const;
+    bool isExpanded() const;
+    bool isChecked() const;
+    bool isVisible() const;
+    bool isOffScreen() const;
+    bool isCollapsed() const;
+    bool isIgnored() const;
+    bool hasPopup() const;
+    int hierarchicalLevel() const;
+    double clickPointX();
+    double clickPointY();
+    JSRetainPtr<JSStringRef> documentEncoding();
+    JSRetainPtr<JSStringRef> documentURI();
+    JSRetainPtr<JSStringRef> url();
+
+    // CSS3-speech properties.
+    JSRetainPtr<JSStringRef> speak();
+    
+    // Table-specific attributes
+    JSRetainPtr<JSStringRef> attributesOfColumnHeaders();
+    JSRetainPtr<JSStringRef> attributesOfRowHeaders();
+    JSRetainPtr<JSStringRef> attributesOfColumns();
+    JSRetainPtr<JSStringRef> attributesOfRows();
+    JSRetainPtr<JSStringRef> attributesOfVisibleCells();
+    JSRetainPtr<JSStringRef> attributesOfHeader();
+    int indexInTable();
+    JSRetainPtr<JSStringRef> rowIndexRange();
+    JSRetainPtr<JSStringRef> columnIndexRange();
+    int rowCount();
+    int columnCount();
+    
+    // Tree/Outline specific attributes
+    PassRefPtr<AccessibilityUIElement> selectedRowAtIndex(unsigned);
+    PassRefPtr<AccessibilityUIElement> disclosedByRow();
+    PassRefPtr<AccessibilityUIElement> disclosedRowAtIndex(unsigned);
+
+    // ARIA specific
+    PassRefPtr<AccessibilityUIElement> ariaOwnsElementAtIndex(unsigned);
+    PassRefPtr<AccessibilityUIElement> ariaFlowToElementAtIndex(unsigned);
+
+    // ARIA Drag and Drop
+    bool ariaIsGrabbed() const;
+    // A space concatentated string of all the drop effects.
+    JSRetainPtr<JSStringRef> ariaDropEffects() const;
+    
+    // Parameterized attributes
+    int lineForIndex(int);
+    JSRetainPtr<JSStringRef> rangeForLine(int);
+    JSRetainPtr<JSStringRef> boundsForRange(unsigned location, unsigned length);
+    void setSelectedTextRange(unsigned location, unsigned length);
+    JSRetainPtr<JSStringRef> stringForRange(unsigned location, unsigned length);
+    JSRetainPtr<JSStringRef> attributedStringForRange(unsigned location, unsigned length);
+    bool attributedStringRangeIsMisspelled(unsigned location, unsigned length);
+    PassRefPtr<AccessibilityUIElement> uiElementForSearchPredicate(AccessibilityUIElement* startElement, bool isDirectionNext, JSStringRef searchKey, JSStringRef searchText);
+    
+    // Table-specific
+    PassRefPtr<AccessibilityUIElement> cellForColumnAndRow(unsigned column, unsigned row);
+
+    // Scrollarea-specific
+    PassRefPtr<AccessibilityUIElement> horizontalScrollbar() const;
+    PassRefPtr<AccessibilityUIElement> verticalScrollbar() const;
+
+    // Text markers.
+    PassRefPtr<AccessibilityTextMarkerRange> textMarkerRangeForElement(AccessibilityUIElement*);    
+    PassRefPtr<AccessibilityTextMarkerRange> textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker);
+    PassRefPtr<AccessibilityTextMarker> startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
+    PassRefPtr<AccessibilityTextMarker> endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange*);
+    PassRefPtr<AccessibilityTextMarker> textMarkerForPoint(int x, int y);
+    PassRefPtr<AccessibilityTextMarker> previousTextMarker(AccessibilityTextMarker*);
+    PassRefPtr<AccessibilityTextMarker> nextTextMarker(AccessibilityTextMarker*);
+    PassRefPtr<AccessibilityUIElement> accessibilityElementForTextMarker(AccessibilityTextMarker*);
+    JSRetainPtr<JSStringRef> stringForTextMarkerRange(AccessibilityTextMarkerRange*);
+    int textMarkerRangeLength(AccessibilityTextMarkerRange*);
+    
+    // Notifications
+    // Function callback should take one argument, the name of the notification.
+    bool addNotificationListener(JSValueRef functionCallback);
+    // Make sure you call remove, because you can't rely on objects being deallocated in a timely fashion.
+    bool removeNotificationListener();
+    
+private:
+    AccessibilityUIElement(PlatformUIElement);
+    AccessibilityUIElement(const AccessibilityUIElement&);
+
+    PlatformUIElement m_element;
+    
+    // A retained, platform specific object used to help manage notifications for this object.
+#if PLATFORM(MAC)
+    NotificationHandler m_notificationHandler;
+
+    void getLinkedUIElements(Vector<RefPtr<AccessibilityUIElement> >&);
+    void getDocumentLinks(Vector<RefPtr<AccessibilityUIElement> >&);
+    void getChildren(Vector<RefPtr<AccessibilityUIElement> >&);
+    void getChildrenWithRange(Vector<RefPtr<AccessibilityUIElement> >&, unsigned location, unsigned length);
+#endif
+};
+    
+} // namespace WTR
+    
+#endif // AccessibilityUIElement_h
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityController.idl
new file mode 100644 (file)
index 0000000..4c3233e
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2011 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+module WTR {
+
+    interface AccessibilityController {
+        readonly attribute AccessibilityUIElement rootElement;
+        readonly attribute AccessibilityUIElement focusedElement;
+        AccessibilityUIElement elementAtPoint(in int x, in int y);
+        
+        void addNotificationListener(in AccessibilityUIElement element, in object functionCallback);
+        void notificationReceived(in AccessibilityUIElement element, in DOMString eventName);
+
+        void logFocusEvents();
+        void logValueChangeEvents();
+        void logScrollingStartEvents();
+        void logAccessibilityEvents();
+        void resetToConsistentState();
+    };
+
+}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarker.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarker.idl
new file mode 100644 (file)
index 0000000..8855848
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2011 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+module WTR {
+
+    interface AccessibilityTextMarker {
+        boolean isEqual(in AccessibilityTextMarker otherMarker);
+    };
+
+}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarkerRange.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityTextMarkerRange.idl
new file mode 100644 (file)
index 0000000..6c2b60e
--- /dev/null
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2011 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+module WTR {
+
+    interface AccessibilityTextMarkerRange {
+        boolean isEqual(in AccessibilityTextMarkerRange otherMarkerRange);
+    };
+
+}
diff --git a/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl b/Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
new file mode 100644 (file)
index 0000000..46051e8
--- /dev/null
@@ -0,0 +1,162 @@
+/*
+ * Copyright (C) 2011 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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+module WTR {
+
+    interface AccessibilityUIElement {
+        boolean isEqual(in AccessibilityUIElement otherElement);
+
+        // Element access.
+        AccessibilityUIElement elementAtPoint(in int x, in int y);
+        AccessibilityUIElement childAtIndex(in unsigned long index);
+        unsigned long indexOfChild(in AccessibilityUIElement child);
+        AccessibilityUIElement linkedUIElementAtIndex(in unsigned long index);
+        AccessibilityUIElement selectedChildAtIndex(in unsigned long index);
+        void setSelectedChild(in AccessibilityUIElement element);
+        AccessibilityUIElement titleUIElement();
+        AccessibilityUIElement parentElement();
+        
+        readonly attribute DOMString role;
+        readonly attribute DOMString subrole;
+        readonly attribute DOMString roleDescription;
+        readonly attribute DOMString title;
+        readonly attribute DOMString description;
+        readonly attribute DOMString language;
+        readonly attribute DOMString helpText;
+        readonly attribute DOMString valueDescription;
+        readonly attribute DOMString url;
+        readonly attribute DOMString speak;
+        readonly attribute DOMString orientation;
+        readonly attribute int insertionPointLineNumber;
+        readonly attribute DOMString selectedTextRange;
+    
+        DOMString stringAttributeValue(in DOMString attr);
+        double numberAttributeValue(in DOMString attr);
+        AccessibilityUIElement uiElementAttributeValue(in DOMString attr);  
+        boolean boolAttributeValue(in DOMString attr);
+        boolean isAttributeSupported(in DOMString attr);
+        boolean isAttributeSettable(in DOMString attr);
+        boolean isActionSupported(in DOMString attr);
+
+        readonly attribute DOMString stringValue;
+        readonly attribute int intValue;
+        readonly attribute int minValue;
+        readonly attribute int maxValue;
+        
+        readonly attribute boolean isEnabled;
+        readonly attribute boolean isRequired;
+        readonly attribute boolean isFocused;
+        readonly attribute boolean isSelected;
+        readonly attribute boolean isMultiSelectable;
+        readonly attribute boolean isExpanded;
+        readonly attribute boolean isChecked;
+        readonly attribute boolean isVisible;
+        readonly attribute boolean isCollapsed;
+        readonly attribute boolean hasPopup;
+        readonly attribute boolean isIgnored;
+        readonly attribute boolean isOffScreen;
+        readonly attribute boolean isValid;
+        readonly attribute int hierarchicalLevel;
+        readonly attribute boolean ariaIsGrabbed;
+        readonly attribute DOMString ariaDropEffects;
+        
+        readonly attribute int x;
+        readonly attribute int y;
+        readonly attribute int width;
+        readonly attribute int height;
+        readonly attribute int clickPointX;
+        readonly attribute int clickPointY;
+
+        readonly attribute int childrenCount;
+        readonly attribute int selectedChildrenCount;
+        readonly attribute int rowCount;
+        readonly attribute int columnCount;
+
+        // Actions.
+        void increment();
+        void decrement();
+        void press();
+        void showMenu();
+
+        // Attribute info.
+        DOMString allAttributes();
+        DOMString attributesOfChildren();
+        DOMString attributesOfLinkedUIElements();
+        DOMString attributesOfDocumentLinks();
+        
+        // Table info.
+        DOMString attributesOfColumnHeaders();
+        DOMString attributesOfRowHeaders();
+        DOMString attributesOfColumns();
+        DOMString attributesOfRows();
+        DOMString attributesOfVisibleCells();
+        DOMString attributesOfHeader();
+        AccessibilityUIElement cellForColumnAndRow(in unsigned long column, in unsigned long row);
+        AccessibilityUIElement selectedRowAtIndex(in unsigned long index);
+        AccessibilityUIElement disclosedByRow();
+        AccessibilityUIElement disclosedRowAtIndex(in unsigned long index);
+        int indexInTable();
+        DOMString rowIndexRange();
+        DOMString columnIndexRange();
+        int rowCount();
+        int columnCount();
+    
+        AccessibilityUIElement ariaOwnsElementAtIndex(in unsigned long index);
+        AccessibilityUIElement ariaFlowToElementAtIndex(in unsigned long index);
+
+        // Paramaterized attributes.
+        DOMString parameterizedAttributeNames();
+        int lineForIndex(in int index);
+        DOMString rangeForLine(in int index);
+        DOMString boundsForRange(in unsigned long location, in unsigned long length);
+        DOMString stringForRange(in unsigned long location, in unsigned long length);
+        DOMString attributedStringForRange(in unsigned long location, in unsigned long length);
+        boolean attributedStringRangeIsMisspelled(in unsigned long location, in unsigned long length);
+        AccessibilityUIElement uiElementForSearchPredicate(in AccessibilityUIElement startElement, in boolean isDirectionNext, in DOMString searchKey, in DOMString searchText);
+        void setSelectedTextRange(in unsigned long location, in unsigned long length);
+
+        // Scroll area attributes.
+        readonly attribute AccessibilityUIElement horizontalScrollbar;
+        readonly attribute AccessibilityUIElement verticalScrollbar;
+
+        // Text markers.
+        AccessibilityTextMarkerRange textMarkerRangeForElement(in AccessibilityUIElement element);    
+        AccessibilityTextMarkerRange textMarkerRangeForMarkers(in AccessibilityTextMarker startMarker, in AccessibilityTextMarker endMarker);
+        AccessibilityTextMarker startTextMarkerForTextMarkerRange(in AccessibilityTextMarkerRange range);
+        AccessibilityTextMarker endTextMarkerForTextMarkerRange(in AccessibilityTextMarkerRange range);
+        AccessibilityTextMarker textMarkerForPoint(in int x, in int y);
+        AccessibilityTextMarker previousTextMarker(in AccessibilityTextMarker marker);
+        AccessibilityTextMarker nextTextMarker(in AccessibilityTextMarker marker);
+        AccessibilityUIElement accessibilityElementForTextMarker(in AccessibilityTextMarker marker);
+        DOMString stringForTextMarkerRange(in AccessibilityTextMarkerRange range);
+        int textMarkerRangeLength(in AccessibilityTextMarkerRange range);
+
+        // Notification support.
+        boolean addNotificationListener(in object callbackFunction);
+        boolean removeNotificationListener();
+        
+    };
+
+}
index 354afb0..4ce74b0 100644 (file)
@@ -131,6 +131,8 @@ module WTR {
         void setBackingScaleFactor(in double backingScaleFactor, in object callback);
 
         void setWindowIsKey(in boolean isKey);
+        
+        readonly attribute DOMString platformName;
     };
 
 }
index d21c997..4daac74 100644 (file)
@@ -192,6 +192,7 @@ void InjectedBundle::beginTesting()
     m_gcController = GCController::create();
     m_eventSendingController = EventSendingController::create();
     m_textInputController = TextInputController::create();
+    m_accessibilityController = AccessibilityController::create();
 
     WKBundleSetShouldTrackVisitedLinks(m_bundle, false);
     WKBundleRemoveAllVisitedLinks(m_bundle);
index 901ba57..86041bd 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef InjectedBundle_h
 #define InjectedBundle_h
 
+#include "AccessibilityController.h"
 #include "EventSendingController.h"
 #include "GCController.h"
 #include "LayoutTestController.h"
@@ -56,6 +57,7 @@ public:
     GCController* gcController() { return m_gcController.get(); }
     EventSendingController* eventSendingController() { return m_eventSendingController.get(); }
     TextInputController* textInputController() { return m_textInputController.get(); }
+    AccessibilityController* accessibilityController() { return m_accessibilityController.get(); }
 
     InjectedBundlePage* page() const;
     size_t pageCount() const { return m_pages.size(); }
@@ -105,6 +107,7 @@ private:
     WKBundlePageGroupRef m_pageGroup;
     Vector<OwnPtr<InjectedBundlePage> > m_pages;
 
+    RefPtr<AccessibilityController> m_accessibilityController;
     RefPtr<LayoutTestController> m_layoutTestController;
     RefPtr<GCController> m_gcController;
     RefPtr<EventSendingController> m_eventSendingController;
index 0f4f198..d7f3f0a 100644 (file)
@@ -655,6 +655,8 @@ void InjectedBundlePage::didClearWindowForFrame(WKBundleFrameRef frame, WKBundle
     InjectedBundle::shared().gcController()->makeWindowObject(context, window, &exception);
     InjectedBundle::shared().eventSendingController()->makeWindowObject(context, window, &exception);
     InjectedBundle::shared().textInputController()->makeWindowObject(context, window, &exception);
+    InjectedBundle::shared().accessibilityController()->makeWindowObject(context, window, &exception);
+
 #if PLATFORM(QT)
     DumpRenderTreeSupportQt::injectInternalsObject(context);
 #else
index 62a8a32..b47cb47 100644 (file)
@@ -190,6 +190,8 @@ public:
     void callFocusWebViewCallback();
     void callSetBackingScaleFactorCallback();
 
+    JSRetainPtr<JSStringRef> platformName();
+    
 private:
     static const double waitToDumpWatchdogTimerInterval;
 
index 8db4ca2..d8d0ed5 100644 (file)
@@ -65,4 +65,10 @@ JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef u
     return url;
 }
 
+JSRetainPtr<JSStringRef> LayoutTestController::platformName()
+{
+    JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("gtk"));
+    return platformName;
+}
+
 } // namespace WTR
diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerMac.mm
new file mode 100644 (file)
index 0000000..face90c
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2010 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 "AccessibilityTextMarker.h"
+
+namespace WTR {
+
+bool AccessibilityTextMarker::isEqual(AccessibilityTextMarker* other)
+{
+    return [(id)platformTextMarker() isEqual:(id)other->platformTextMarker()];
+}
+
+} // namespace WTR
+
diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityTextMarkerRangeMac.mm
new file mode 100644 (file)
index 0000000..2186497
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2011 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 "AccessibilityTextMarkerRange.h"
+
+namespace WTR {
+    
+bool AccessibilityTextMarkerRange::isEqual(AccessibilityTextMarkerRange* other)
+{
+    return [(id)platformTextMarkerRange() isEqual:(id)other->platformTextMarkerRange()];
+}
+    
+} // namespace WTR
+
diff --git a/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm b/Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm
new file mode 100644 (file)
index 0000000..d222d36
--- /dev/null
@@ -0,0 +1,1443 @@
+/*
+ * Copyright (C) 2011 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 "AccessibilityUIElement.h"
+#import "InjectedBundle.h"
+#import "InjectedBundlePage.h"
+
+#import <AppKit/NSAccessibility.h>
+#import <Foundation/Foundation.h>
+#import <JavaScriptCore/JSRetainPtr.h>
+#import <JavaScriptCore/JSStringRef.h>
+#import <JavaScriptCore/JSStringRefCF.h>
+#import <WebKit2/WKBundleFrame.h>
+#import <wtf/RetainPtr.h>
+#import <wtf/Vector.h>
+
+
+#ifndef NSAccessibilityOwnsAttribute
+#define NSAccessibilityOwnsAttribute @"AXOwns"
+#endif
+
+#ifndef NSAccessibilityGrabbedAttribute
+#define NSAccessibilityGrabbedAttribute @"AXGrabbed"
+#endif
+
+#ifndef NSAccessibilityDropEffectsAttribute
+#define NSAccessibilityDropEffectsAttribute @"AXDropEffects"
+#endif
+
+// If an unsupported attribute is passed in, it will raise an accessibility exception. These are usually caught by the Accessibility Runtime to inform
+// the AX client app of the error. However, DRT is the AX client app, so it must catch these exceptions.
+#define BEGIN_AX_OBJC_EXCEPTIONS @try {
+#define END_AX_OBJC_EXCEPTIONS } @catch(NSException *e) { if (![[e name] isEqualToString:NSAccessibilityException]) @throw; }
+
+
+typedef void (*AXPostedNotificationCallback)(id element, NSString* notification, void* context);
+
+@interface NSObject (WebKitAccessibilityAdditions)
+- (NSArray *)accessibilityArrayAttributeValues:(NSString *)attribute index:(NSUInteger)index maxCount:(NSUInteger)maxCount;
+- (void)accessibilitySetShouldRepostNotifications:(BOOL)repost;
+- (NSUInteger)accessibilityIndexOfChild:(id)child;
+- (NSUInteger)accessibilityArrayAttributeCount:(NSString *)attribute;
+@end
+
+@interface NSString (JSStringRefAdditions)
++ (NSString *)stringWithJSStringRef:(JSStringRef)jsStringRef;
+- (JSStringRef)createJSStringRef;
+@end
+
+@implementation NSString (JSStringRefAdditions)
+
++ (NSString *)stringWithJSStringRef:(JSStringRef)jsStringRef
+{
+    if (!jsStringRef)
+        return NULL;
+    
+    CFStringRef cfString = JSStringCopyCFString(kCFAllocatorDefault, jsStringRef);
+    return [(NSString *)cfString autorelease];
+}
+
+- (JSStringRef)createJSStringRef
+{
+    return JSStringCreateWithCFString((CFStringRef)self);
+}
+
+@end
+
+@interface AccessibilityNotificationHandler : NSObject
+{
+    id m_platformElement;
+    JSValueRef m_notificationFunctionCallback;
+}
+
+@end
+
+@implementation AccessibilityNotificationHandler
+
+- (id)initWithPlatformElement:(id)platformElement
+{
+    self = [super init];
+
+    m_platformElement = platformElement;
+    
+    // Once an object starts requesting notifications, it's on for the duration of the program.
+    // This is to avoid any race conditions between tests turning this flag on and off. Instead
+    // AccessibilityNotificationHandler can just listen when they want to.
+    [m_platformElement accessibilitySetShouldRepostNotifications:YES];
+    [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(_notificationReceived:) name:@"AXDRTNotification" object:nil];
+
+    return self;
+}
+- (void)dealloc
+{
+    [[NSNotificationCenter defaultCenter] removeObserver:self];
+
+    WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(WTR::InjectedBundle::shared().page()->page());
+    JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
+    
+    JSValueUnprotect(context, m_notificationFunctionCallback);
+    m_notificationFunctionCallback = 0;
+    
+    [super dealloc];
+}
+
+- (void)_notificationReceived:(NSNotification *)notification
+{
+    NSString *notificationName = [[notification userInfo] objectForKey:@"notificationName"];
+    if (!notificationName)
+        return;
+    
+    WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(WTR::InjectedBundle::shared().page()->page());
+    JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
+
+    JSRetainPtr<JSStringRef> jsNotification(Adopt, [notificationName createJSStringRef]);
+    JSValueRef argument = JSValueMakeString(context, jsNotification.get());
+    JSObjectCallAsFunction(context, const_cast<JSObjectRef>(m_notificationFunctionCallback), 0, 1, &argument, 0);
+}
+
+- (void)setCallback:(JSValueRef)callback
+{
+    if (!callback)
+        return;
+    WKBundleFrameRef mainFrame = WKBundlePageGetMainFrame(WTR::InjectedBundle::shared().page()->page());
+    JSContextRef context = WKBundleFrameGetJavaScriptContext(mainFrame);
+
+    // Release the old callback.
+    if (m_notificationFunctionCallback) 
+        JSValueUnprotect(context, m_notificationFunctionCallback);
+    
+    m_notificationFunctionCallback = callback;
+    JSValueProtect(context, m_notificationFunctionCallback);
+}
+
+@end
+
+namespace WTR {
+
+AccessibilityUIElement::AccessibilityUIElement(PlatformUIElement element)
+    : m_element(element)
+    , m_notificationHandler(0)
+{
+    // FIXME: ap@webkit.org says ObjC objects need to be CFRetained/CFRelease to be GC-compliant on the mac.
+    [m_element retain];
+}
+
+AccessibilityUIElement::AccessibilityUIElement(const AccessibilityUIElement& other)
+    : m_element(other.m_element)
+    , m_notificationHandler(0)
+{
+    [m_element retain];
+}
+
+AccessibilityUIElement::~AccessibilityUIElement()
+{
+    // The notification handler should be nil because removeNotificationListener() should have been called in the test.
+    ASSERT(!m_notificationHandler);
+    [m_element release];
+}
+
+bool AccessibilityUIElement::isEqual(AccessibilityUIElement* otherElement)
+{
+    return platformUIElement() == otherElement->platformUIElement();
+}
+    
+static NSString* descriptionOfValue(id valueObject, id focusedAccessibilityObject)
+{
+    if (!valueObject)
+        return NULL;
+
+    if ([valueObject isKindOfClass:[NSArray class]])
+        return [NSString stringWithFormat:@"<array of size %d>", [(NSArray*)valueObject count]];
+
+    if ([valueObject isKindOfClass:[NSNumber class]])
+        return [(NSNumber*)valueObject stringValue];
+
+    if ([valueObject isKindOfClass:[NSValue class]]) {
+        NSString* type = [NSString stringWithCString:[valueObject objCType] encoding:NSASCIIStringEncoding];
+        NSValue* value = (NSValue*)valueObject;
+        if ([type rangeOfString:@"NSRect"].length > 0)
+            return [NSString stringWithFormat:@"NSRect: %@", NSStringFromRect([value rectValue])];
+        if ([type rangeOfString:@"NSPoint"].length > 0)
+            return [NSString stringWithFormat:@"NSPoint: %@", NSStringFromPoint([value pointValue])];
+        if ([type rangeOfString:@"NSSize"].length > 0)
+            return [NSString stringWithFormat:@"NSSize: %@", NSStringFromSize([value sizeValue])];
+        if ([type rangeOfString:@"NSRange"].length > 0)
+            return [NSString stringWithFormat:@"NSRange: %@", NSStringFromRange([value rangeValue])];
+    }
+
+    // Strip absolute URL paths
+    NSString* description = [valueObject description];
+    NSRange range = [description rangeOfString:@"LayoutTests"];
+    if (range.length)
+        return [description substringFromIndex:range.location];
+
+    // Strip pointer locations
+    if ([description rangeOfString:@"0x"].length) {
+        NSString* role = [focusedAccessibilityObject accessibilityAttributeValue:NSAccessibilityRoleAttribute];
+        NSString* title = [focusedAccessibilityObject accessibilityAttributeValue:NSAccessibilityTitleAttribute];
+        if ([title length])
+            return [NSString stringWithFormat:@"<%@: '%@'>", role, title];
+        return [NSString stringWithFormat:@"<%@>", role];
+    }
+    
+    return [valueObject description];
+}
+
+static NSString* attributesOfElement(id accessibilityObject)
+{
+    NSArray* supportedAttributes = [accessibilityObject accessibilityAttributeNames];
+
+    NSMutableString* attributesString = [NSMutableString string];
+    for (NSUInteger i = 0; i < [supportedAttributes count]; ++i) {
+        NSString* attribute = [supportedAttributes objectAtIndex:i];
+        
+        // Right now, position provides useless and screen-specific information, so we do not
+        // want to include it for the sake of universally passing tests.
+        if ([attribute isEqualToString:@"AXPosition"])
+            continue;
+        
+        // accessibilityAttributeValue: can throw an if an attribute is not returned.
+        // For DumpRenderTree's purpose, we should ignore those exceptions
+        BEGIN_AX_OBJC_EXCEPTIONS
+        id valueObject = [accessibilityObject accessibilityAttributeValue:attribute];
+        NSString* value = descriptionOfValue(valueObject, accessibilityObject);
+        [attributesString appendFormat:@"%@: %@\n", attribute, value];
+        END_AX_OBJC_EXCEPTIONS
+    }
+    
+    return attributesString;
+}
+
+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());
+}
+
+static void convertNSArrayToVector(NSArray* array, Vector<RefPtr<AccessibilityUIElement> >& elementVector)
+{
+    NSUInteger count = [array count];
+    for (NSUInteger i = 0; i < count; ++i)
+        elementVector.append(AccessibilityUIElement::create([array objectAtIndex:i]));
+}
+
+static JSStringRef descriptionOfElements(Vector<RefPtr<AccessibilityUIElement> >& elementVector)
+{
+    NSMutableString* allElementString = [NSMutableString string];
+    size_t size = elementVector.size();
+    for (size_t i = 0; i < size; ++i) {
+        RefPtr<AccessibilityUIElement> uiElement = elementVector[i];
+        NSString* attributes = attributesOfElement(uiElement->platformUIElement());
+        [allElementString appendFormat:@"%@\n------------\n", attributes];
+    }
+    
+    return [allElementString createJSStringRef];
+}
+
+void AccessibilityUIElement::getLinkedUIElements(Vector<RefPtr<AccessibilityUIElement> >& elementVector)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* linkedElements = [m_element accessibilityAttributeValue:NSAccessibilityLinkedUIElementsAttribute];
+    convertNSArrayToVector(linkedElements, elementVector);
+    END_AX_OBJC_EXCEPTIONS
+}
+
+void AccessibilityUIElement::getDocumentLinks(Vector<RefPtr<AccessibilityUIElement> >& elementVector)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* linkElements = [m_element accessibilityAttributeValue:@"AXLinkUIElements"];
+    convertNSArrayToVector(linkElements, elementVector);
+    END_AX_OBJC_EXCEPTIONS
+}
+
+void AccessibilityUIElement::getChildren(Vector<RefPtr<AccessibilityUIElement> >& elementVector)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* children = [m_element accessibilityAttributeValue:NSAccessibilityChildrenAttribute];
+    convertNSArrayToVector(children, elementVector);
+    END_AX_OBJC_EXCEPTIONS
+}
+
+void AccessibilityUIElement::getChildrenWithRange(Vector<RefPtr<AccessibilityUIElement> >& elementVector, unsigned location, unsigned length)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* children = [m_element accessibilityArrayAttributeValues:NSAccessibilityChildrenAttribute index:location maxCount:length];
+    convertNSArrayToVector(children, elementVector);
+    END_AX_OBJC_EXCEPTIONS
+}
+
+int AccessibilityUIElement::childrenCount()
+{
+    Vector<RefPtr<AccessibilityUIElement> > children;
+    getChildren(children);
+    
+    return children.size();
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::elementAtPoint(int x, int y)
+{
+    id element = [m_element accessibilityHitTest:NSMakePoint(x, y)];
+    if (!element)
+        return nil;
+    
+    return AccessibilityUIElement::create(element);
+}
+
+unsigned AccessibilityUIElement::indexOfChild(AccessibilityUIElement* element)
+{
+    return [m_element accessibilityIndexOfChild:element->platformUIElement()];
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::childAtIndex(unsigned index)
+{
+    Vector<RefPtr<AccessibilityUIElement> > children;
+    getChildrenWithRange(children, index, 1);
+
+    if (children.size() == 1)
+        return children[0];
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::linkedUIElementAtIndex(unsigned index)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* objects = [m_element accessibilityAttributeValue:NSAccessibilityLinkedUIElementsAttribute];
+    if (index < [objects count])
+        return AccessibilityUIElement::create([objects objectAtIndex:index]);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaOwnsElementAtIndex(unsigned index)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* objects = [m_element accessibilityAttributeValue:NSAccessibilityOwnsAttribute];
+    if (index < [objects count])
+        return AccessibilityUIElement::create([objects objectAtIndex:index]);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::ariaFlowToElementAtIndex(unsigned index)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* objects = [m_element accessibilityAttributeValue:NSAccessibilityLinkedUIElementsAttribute];
+    if (index < [objects count])
+        return AccessibilityUIElement::create([objects objectAtIndex:index]);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedRowAtIndex(unsigned index)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* rows = [m_element accessibilityAttributeValue:NSAccessibilityDisclosedRowsAttribute];
+    if (index < [rows count])
+        return AccessibilityUIElement::create([rows objectAtIndex:index]);
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedChildAtIndex(unsigned index) const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* array = [m_element accessibilityAttributeValue:NSAccessibilitySelectedChildrenAttribute];
+    if (index < [array count])
+        return AccessibilityUIElement::create([array objectAtIndex:index]);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+unsigned AccessibilityUIElement::selectedChildrenCount() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    return [m_element accessibilityArrayAttributeCount:NSAccessibilitySelectedChildrenAttribute];
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::selectedRowAtIndex(unsigned index)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* rows = [m_element accessibilityAttributeValue:NSAccessibilitySelectedRowsAttribute];
+    if (index < [rows count])
+        return AccessibilityUIElement::create([rows objectAtIndex:index]);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::titleUIElement()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id accessibilityObject = [m_element accessibilityAttributeValue:NSAccessibilityTitleUIElementAttribute];
+    if (accessibilityObject)
+        return AccessibilityUIElement::create(accessibilityObject);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::parentElement()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id accessibilityObject = [m_element accessibilityAttributeValue:NSAccessibilityParentAttribute];
+    if (accessibilityObject)
+        return AccessibilityUIElement::create(accessibilityObject);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::disclosedByRow()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id accessibilityObject = [m_element accessibilityAttributeValue:NSAccessibilityDisclosedByRowAttribute];
+    if (accessibilityObject)
+        return AccessibilityUIElement::create(accessibilityObject);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfLinkedUIElements()
+{
+    Vector<RefPtr<AccessibilityUIElement> > linkedElements;
+    getLinkedUIElements(linkedElements);
+    return descriptionOfElements(linkedElements);
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfDocumentLinks()
+{
+    Vector<RefPtr<AccessibilityUIElement> > linkElements;
+    getDocumentLinks(linkElements);
+    return descriptionOfElements(linkElements);
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfChildren()
+{
+    Vector<RefPtr<AccessibilityUIElement> > children;
+    getChildren(children);
+    return descriptionOfElements(children);
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::allAttributes()
+{
+    NSString* attributes = attributesOfElement(m_element);
+    return [attributes createJSStringRef];
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringAttributeValue(JSStringRef attribute)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:[NSString stringWithJSStringRef:attribute]];
+    if ([value isKindOfClass:[NSString class]])
+        return [value createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0;
+}
+
+double AccessibilityUIElement::numberAttributeValue(JSStringRef attribute)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:[NSString stringWithJSStringRef:attribute]];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value doubleValue];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementAttributeValue(JSStringRef attribute) const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id uiElement = [m_element accessibilityAttributeValue:[NSString stringWithJSStringRef:attribute]];
+    return AccessibilityUIElement::create(uiElement);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+    
+bool AccessibilityUIElement::boolAttributeValue(JSStringRef attribute)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:[NSString stringWithJSStringRef:attribute]];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value boolValue];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return false;
+}
+
+bool AccessibilityUIElement::isAttributeSettable(JSStringRef attribute)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    return [m_element accessibilityIsAttributeSettable:[NSString stringWithJSStringRef:attribute]];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return false;
+}
+
+bool AccessibilityUIElement::isAttributeSupported(JSStringRef attribute)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    return [[m_element accessibilityAttributeNames] containsObject:[NSString stringWithJSStringRef:attribute]];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return false;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::parameterizedAttributeNames()
+{
+    NSArray* supportedParameterizedAttributes = [m_element accessibilityParameterizedAttributeNames];
+    
+    NSMutableString* attributesString = [NSMutableString string];
+    for (NSUInteger i = 0; i < [supportedParameterizedAttributes count]; ++i) {
+        [attributesString appendFormat:@"%@\n", [supportedParameterizedAttributes objectAtIndex:i]];
+    }
+    
+    return [attributesString createJSStringRef];
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::role()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSString *role = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityRoleAttribute], m_element);
+    return concatenateAttributeAndValue(@"AXRole", role);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::subrole()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSString* role = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilitySubroleAttribute], m_element);
+    return concatenateAttributeAndValue(@"AXSubrole", role);
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::roleDescription()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSString* role = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityRoleDescriptionAttribute], m_element);
+    return concatenateAttributeAndValue(@"AXRoleDescription", role);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::title()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSString* title = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityTitleAttribute], m_element);
+    return concatenateAttributeAndValue(@"AXTitle", title);
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::description()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityDescriptionAttribute], m_element);
+    return concatenateAttributeAndValue(@"AXDescription", description);
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::orientation() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityOrientationAttribute], m_element);
+    return concatenateAttributeAndValue(@"AXOrientation", description);    
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringValue()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityValueAttribute], m_element);
+    return concatenateAttributeAndValue(@"AXValue", description);
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::language()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id description = descriptionOfValue([m_element accessibilityAttributeValue:@"AXLanguage"], m_element);
+    return concatenateAttributeAndValue(@"AXLanguage", description);
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::helpText() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id description = descriptionOfValue([m_element accessibilityAttributeValue:NSAccessibilityHelpAttribute], m_element);
+    return concatenateAttributeAndValue(@"AXHelp", description);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+double AccessibilityUIElement::x()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSValue* positionValue = [m_element accessibilityAttributeValue:NSAccessibilityPositionAttribute];
+    return static_cast<double>([positionValue pointValue].x);    
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0.0f;
+}
+
+double AccessibilityUIElement::y()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSValue* positionValue = [m_element accessibilityAttributeValue:NSAccessibilityPositionAttribute];
+    return static_cast<double>([positionValue pointValue].y);    
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0.0f;
+}
+
+double AccessibilityUIElement::width()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSValue* sizeValue = [m_element accessibilityAttributeValue:NSAccessibilitySizeAttribute];
+    return static_cast<double>([sizeValue sizeValue].width);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0.0f;
+}
+
+double AccessibilityUIElement::height()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSValue* sizeValue = [m_element accessibilityAttributeValue:NSAccessibilitySizeAttribute];
+    return static_cast<double>([sizeValue sizeValue].height);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0.0f;
+}
+
+double AccessibilityUIElement::clickPointX()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSValue* positionValue = [m_element accessibilityAttributeValue:@"AXClickPoint"];
+    return static_cast<double>([positionValue pointValue].x);        
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0.0f;
+}
+
+double AccessibilityUIElement::clickPointY()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSValue* positionValue = [m_element accessibilityAttributeValue:@"AXClickPoint"];
+    return static_cast<double>([positionValue pointValue].y);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0.0f;
+}
+
+double AccessibilityUIElement::intValue() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityValueAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [(NSNumber*)value doubleValue]; 
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0.0f;
+}
+
+double AccessibilityUIElement::minValue()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityMinValueAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [(NSNumber*)value doubleValue]; 
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0.0f;
+}
+
+double AccessibilityUIElement::maxValue()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityMaxValueAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [(NSNumber*)value doubleValue]; 
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0.0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::valueDescription()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSString* valueDescription = [m_element accessibilityAttributeValue:NSAccessibilityValueDescriptionAttribute];
+    if ([valueDescription isKindOfClass:[NSString class]])
+         return [valueDescription createJSStringRef];
+
+    END_AX_OBJC_EXCEPTIONS
+    return 0;
+}
+
+int AccessibilityUIElement::insertionPointLineNumber()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityInsertionPointLineNumberAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [(NSNumber *)value intValue]; 
+    END_AX_OBJC_EXCEPTIONS
+    
+    return -1;
+}
+
+bool AccessibilityUIElement::isActionSupported(JSStringRef action)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* actions = [m_element accessibilityActionNames];
+    return [actions containsObject:[NSString stringWithJSStringRef:action]];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return false;
+}
+
+bool AccessibilityUIElement::isEnabled()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityEnabledAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value boolValue];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return false;
+}
+
+bool AccessibilityUIElement::isRequired() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:@"AXRequired"];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value boolValue];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return false;
+}
+
+bool AccessibilityUIElement::isFocused() const
+{
+    // FIXME: implement
+    return false;
+}
+
+bool AccessibilityUIElement::isSelected() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilitySelectedAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value boolValue];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return false;
+}
+
+bool AccessibilityUIElement::isExpanded() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityExpandedAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value boolValue];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return false;
+}
+
+bool AccessibilityUIElement::isChecked() const
+{
+    // On the Mac, intValue()==1 if a a checkable control is checked.
+    return intValue() == 1;
+}
+
+int AccessibilityUIElement::hierarchicalLevel() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityDisclosureLevelAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value intValue];
+    END_AX_OBJC_EXCEPTIONS
+
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::speak()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:@"AXDRTSpeechAttribute"];
+    if ([value isKindOfClass:[NSString class]])
+        return [value createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+        
+    return 0;
+}
+
+bool AccessibilityUIElement::ariaIsGrabbed() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityGrabbedAttribute];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value boolValue];
+    END_AX_OBJC_EXCEPTIONS
+
+    return false;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::ariaDropEffects() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityDropEffectsAttribute];
+    if (![value isKindOfClass:[NSArray class]])
+        return 0;
+
+    NSMutableString* dropEffects = [NSMutableString string];
+    NSInteger length = [value count];
+    for (NSInteger k = 0; k < length; ++k) {
+        [dropEffects appendString:[value objectAtIndex:k]];
+        if (k < length - 1)
+            [dropEffects appendString:@","];
+    }
+    
+    return [dropEffects createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+// parameterized attributes
+int AccessibilityUIElement::lineForIndex(int index)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityLineForIndexParameterizedAttribute forParameter:[NSNumber numberWithInt:index]];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [(NSNumber *)value intValue]; 
+    END_AX_OBJC_EXCEPTIONS
+
+    return -1;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::rangeForLine(int line)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityRangeForLineParameterizedAttribute forParameter:[NSNumber numberWithInt:line]];
+    if ([value isKindOfClass:[NSValue class]]) {
+        return [NSStringFromRange([value rangeValue]) createJSStringRef];
+    }
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::boundsForRange(unsigned location, unsigned length)
+{
+    NSRange range = NSMakeRange(location, length);
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:NSAccessibilityBoundsForRangeParameterizedAttribute forParameter:[NSValue valueWithRange:range]];
+    NSRect rect = NSMakeRect(0,0,0,0);
+    if ([value isKindOfClass:[NSValue class]])
+        rect = [value rectValue]; 
+    
+    // don't return position information because it is platform dependent
+    NSMutableString* boundsDescription = [NSMutableString stringWithFormat:@"{{%f, %f}, {%f, %f}}",-1.0f,-1.0f,rect.size.width,rect.size.height];
+    return [boundsDescription createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForRange(unsigned location, unsigned length)
+{
+    NSRange range = NSMakeRange(location, length);
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id string = [m_element accessibilityAttributeValue:NSAccessibilityStringForRangeParameterizedAttribute forParameter:[NSValue valueWithRange:range]];
+    if (![string isKindOfClass:[NSString class]])
+        return 0;
+    
+    return [string createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributedStringForRange(unsigned location, unsigned length)
+{
+    NSRange range = NSMakeRange(location, length);
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSAttributedString* string = [m_element accessibilityAttributeValue:NSAccessibilityAttributedStringForRangeParameterizedAttribute forParameter:[NSValue valueWithRange:range]];
+    if (![string isKindOfClass:[NSAttributedString class]])
+        return 0;
+    
+    NSString* stringWithAttrs = [string description];
+    return [stringWithAttrs createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+bool AccessibilityUIElement::attributedStringRangeIsMisspelled(unsigned location, unsigned length)
+{
+    NSRange range = NSMakeRange(location, length);
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSAttributedString* string = [m_element accessibilityAttributeValue:NSAccessibilityAttributedStringForRangeParameterizedAttribute forParameter:[NSValue valueWithRange:range]];
+    if (![string isKindOfClass:[NSAttributedString class]])
+        return false;
+
+    NSDictionary* attrs = [string attributesAtIndex:0 effectiveRange:nil];
+    if([[attrs objectForKey:NSAccessibilityMisspelledTextAttribute] boolValue])
+        return true;    
+    END_AX_OBJC_EXCEPTIONS
+    
+    return false;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::uiElementForSearchPredicate(AccessibilityUIElement* startElement, bool isDirectionNext, JSStringRef searchKey, JSStringRef searchText)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSMutableDictionary* parameter = [NSMutableDictionary dictionary];
+    [parameter setObject:(isDirectionNext) ? @"AXDirectionNext" : @"AXDirectionPrevious" forKey:@"AXDirection"];
+    [parameter setObject:[NSNumber numberWithInt:1] forKey:@"AXResultsLimit"];
+    if (startElement)
+        [parameter setObject:(id)startElement->platformUIElement() forKey:@"AXStartElement"];
+    if (searchKey)
+        [parameter setObject:[NSString stringWithJSStringRef:searchKey] forKey:@"AXSearchKey"];
+    if (searchText && JSStringGetLength(searchText))
+        [parameter setObject:[NSString stringWithJSStringRef:searchText] forKey:@"AXSearchText"];
+    
+    id uiElement = [[m_element accessibilityAttributeValue:@"AXUIElementsForSearchPredicate" forParameter:parameter] lastObject];
+    return AccessibilityUIElement::create(uiElement);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumnHeaders()
+{
+    // not yet defined in AppKit... odd
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* columnHeadersArray = [m_element accessibilityAttributeValue:@"AXColumnHeaderUIElements"];
+    Vector<RefPtr<AccessibilityUIElement> > columnHeadersVector;
+    convertNSArrayToVector(columnHeadersArray, columnHeadersVector);
+    return descriptionOfElements(columnHeadersVector);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRowHeaders()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* rowHeadersArray = [m_element accessibilityAttributeValue:@"AXRowHeaderUIElements"];
+    Vector<RefPtr<AccessibilityUIElement> > rowHeadersVector;
+    convertNSArrayToVector(rowHeadersArray, rowHeadersVector);
+    return descriptionOfElements(rowHeadersVector);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfColumns()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* columnsArray = [m_element accessibilityAttributeValue:NSAccessibilityColumnsAttribute];
+    Vector<RefPtr<AccessibilityUIElement> > columnsVector;
+    convertNSArrayToVector(columnsArray, columnsVector);
+    return descriptionOfElements(columnsVector);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfRows()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* rowsArray = [m_element accessibilityAttributeValue:NSAccessibilityRowsAttribute];
+    Vector<RefPtr<AccessibilityUIElement> > rowsVector;
+    convertNSArrayToVector(rowsArray, rowsVector);
+    return descriptionOfElements(rowsVector);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfVisibleCells()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* cellsArray = [m_element accessibilityAttributeValue:@"AXVisibleCells"];
+    Vector<RefPtr<AccessibilityUIElement> > cellsVector;
+    convertNSArrayToVector(cellsArray, cellsVector);
+    return descriptionOfElements(cellsVector);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::attributesOfHeader()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id headerObject = [m_element accessibilityAttributeValue:NSAccessibilityHeaderAttribute];
+    if (!headerObject)
+        return [@"" createJSStringRef];
+    
+    Vector<RefPtr<AccessibilityUIElement> > headerVector;
+    headerVector.append(AccessibilityUIElement::create(headerObject));
+    return descriptionOfElements(headerVector);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+int AccessibilityUIElement::rowCount()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    return [m_element accessibilityArrayAttributeCount:NSAccessibilityRowsAttribute];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+int AccessibilityUIElement::columnCount()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    return [m_element accessibilityArrayAttributeCount:NSAccessibilityColumnsAttribute];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+int AccessibilityUIElement::indexInTable()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSNumber* indexNumber = [m_element accessibilityAttributeValue:NSAccessibilityIndexAttribute];
+    if (indexNumber)
+        return [indexNumber intValue];
+    END_AX_OBJC_EXCEPTIONS
+
+    return -1;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::rowIndexRange()
+{
+    NSRange range = NSMakeRange(0,0);
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSValue* indexRange = [m_element accessibilityAttributeValue:@"AXRowIndexRange"];
+    if (indexRange)
+        range = [indexRange rangeValue];
+    NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%d, %d}",range.location, range.length];
+    return [rangeDescription createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::columnIndexRange()
+{
+    NSRange range = NSMakeRange(0,0);
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSNumber* indexRange = [m_element accessibilityAttributeValue:@"AXColumnIndexRange"];
+    if (indexRange)
+        range = [indexRange rangeValue];
+    NSMutableString* rangeDescription = [NSMutableString stringWithFormat:@"{%d, %d}",range.location, range.length];
+    return [rangeDescription createJSStringRef];    
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::cellForColumnAndRow(unsigned col, unsigned row)
+{
+    NSArray *colRowArray = [NSArray arrayWithObjects:[NSNumber numberWithUnsignedInt:col], [NSNumber numberWithUnsignedInt:row], nil];
+    BEGIN_AX_OBJC_EXCEPTIONS
+    return AccessibilityUIElement::create([m_element accessibilityAttributeValue:@"AXCellForColumnAndRow" forParameter:colRowArray]);
+    END_AX_OBJC_EXCEPTIONS    
+
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::horizontalScrollbar() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    return AccessibilityUIElement::create([m_element accessibilityAttributeValue:NSAccessibilityHorizontalScrollBarAttribute]);
+    END_AX_OBJC_EXCEPTIONS    
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::verticalScrollbar() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    return AccessibilityUIElement::create([m_element accessibilityAttributeValue:NSAccessibilityVerticalScrollBarAttribute]);
+    END_AX_OBJC_EXCEPTIONS        
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::selectedTextRange()
+{
+    NSRange range = NSMakeRange(NSNotFound, 0);
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSValue *indexRange = [m_element accessibilityAttributeValue:NSAccessibilitySelectedTextRangeAttribute];
+    if (indexRange)
+        range = [indexRange rangeValue];
+    NSMutableString *rangeDescription = [NSMutableString stringWithFormat:@"{%d, %d}",range.location, range.length];
+    return [rangeDescription createJSStringRef];    
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+void AccessibilityUIElement::setSelectedTextRange(unsigned location, unsigned length)
+{
+    NSRange textRange = NSMakeRange(location, length);
+    NSValue *textRangeValue = [NSValue valueWithRange:textRange];
+    BEGIN_AX_OBJC_EXCEPTIONS
+    [m_element accessibilitySetValue:textRangeValue forAttribute:NSAccessibilitySelectedTextRangeAttribute];
+    END_AX_OBJC_EXCEPTIONS
+}
+
+void AccessibilityUIElement::increment()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    [m_element accessibilityPerformAction:NSAccessibilityIncrementAction];
+    END_AX_OBJC_EXCEPTIONS
+}
+
+void AccessibilityUIElement::decrement()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    [m_element accessibilityPerformAction:NSAccessibilityDecrementAction];
+    END_AX_OBJC_EXCEPTIONS
+}
+
+void AccessibilityUIElement::showMenu()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    [m_element accessibilityPerformAction:NSAccessibilityShowMenuAction];
+    END_AX_OBJC_EXCEPTIONS
+}
+
+void AccessibilityUIElement::press()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    [m_element accessibilityPerformAction:NSAccessibilityPressAction];
+    END_AX_OBJC_EXCEPTIONS
+}
+
+void AccessibilityUIElement::setSelectedChild(AccessibilityUIElement* element) const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* array = [NSArray arrayWithObject:element->platformUIElement()];
+    [m_element accessibilitySetValue:array forAttribute:NSAccessibilitySelectedChildrenAttribute];
+    END_AX_OBJC_EXCEPTIONS    
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::accessibilityValue() const
+{
+    // FIXME: implement
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::documentEncoding()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::documentURI()
+{
+    return JSStringCreateWithCharacters(0, 0);
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::url()
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSURL *url = [m_element accessibilityAttributeValue:NSAccessibilityURLAttribute];
+    return [[url absoluteString] createJSStringRef];    
+    END_AX_OBJC_EXCEPTIONS
+    
+    return nil;
+}
+
+bool AccessibilityUIElement::addNotificationListener(JSValueRef functionCallback)
+{
+    if (!functionCallback)
+        return false;
+    // Mac programmers should not be adding more than one notification listener per element.
+    // Other platforms may be different.
+    if (m_notificationHandler)
+        return false;
+    m_notificationHandler = [[AccessibilityNotificationHandler alloc] initWithPlatformElement:platformUIElement()];
+    [m_notificationHandler setCallback:functionCallback];
+
+    return true;
+}
+
+bool AccessibilityUIElement::removeNotificationListener()
+{
+    // Mac programmers should not be trying to remove a listener that's already removed.
+    ASSERT(m_notificationHandler);
+
+    [m_notificationHandler release];
+    m_notificationHandler = nil;
+    
+    return true;
+}
+
+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::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
+{
+    BOOL result = NO;
+    BEGIN_AX_OBJC_EXCEPTIONS
+    result = [m_element accessibilityIsIgnored];
+    END_AX_OBJC_EXCEPTIONS
+    return result;
+}
+
+bool AccessibilityUIElement::hasPopup() const
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id value = [m_element accessibilityAttributeValue:@"AXHasPopup"];
+    if ([value isKindOfClass:[NSNumber class]])
+        return [value boolValue];
+    END_AX_OBJC_EXCEPTIONS
+
+    return false;
+}
+
+void AccessibilityUIElement::takeFocus()
+{
+    // FIXME: implement
+}
+
+void AccessibilityUIElement::takeSelection()
+{
+    // FIXME: implement
+}
+
+void AccessibilityUIElement::addSelection()
+{
+    // FIXME: implement
+}
+
+void AccessibilityUIElement::removeSelection()
+{
+    // FIXME: implement
+}
+
+// Text markers
+PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForElement(AccessibilityUIElement* element)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id textMarkerRange = [m_element accessibilityAttributeValue:@"AXTextMarkerRangeForUIElement" forParameter:element->platformUIElement()];
+    return AccessibilityTextMarkerRange::create(textMarkerRange);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+int AccessibilityUIElement::textMarkerRangeLength(AccessibilityTextMarkerRange* range)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSNumber* lengthValue = [m_element accessibilityAttributeValue:@"AXLengthForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()];
+    return [lengthValue intValue];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::previousTextMarker(AccessibilityTextMarker* textMarker)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id previousMarker = [m_element accessibilityAttributeValue:@"AXPreviousTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    return AccessibilityTextMarker::create(previousMarker);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::nextTextMarker(AccessibilityTextMarker* textMarker)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id nextMarker = [m_element accessibilityAttributeValue:@"AXNextTextMarkerForTextMarker" forParameter:(id)textMarker->platformTextMarker()];
+    return AccessibilityTextMarker::create(nextMarker);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+JSRetainPtr<JSStringRef> AccessibilityUIElement::stringForTextMarkerRange(AccessibilityTextMarkerRange* markerRange)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id textString = [m_element accessibilityAttributeValue:@"AXStringForTextMarkerRange" forParameter:(id)markerRange->platformTextMarkerRange()];
+    return [textString createJSStringRef];
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityTextMarkerRange> AccessibilityUIElement::textMarkerRangeForMarkers(AccessibilityTextMarker* startMarker, AccessibilityTextMarker* endMarker)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    NSArray* textMarkers = [NSArray arrayWithObjects:(id)startMarker->platformTextMarker(), (id)endMarker->platformTextMarker(), nil];
+    id textMarkerRange = [m_element accessibilityAttributeValue:@"AXTextMarkerRangeForUnorderedTextMarkers" forParameter:textMarkers];
+    return AccessibilityTextMarkerRange::create(textMarkerRange);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;
+}
+
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::startTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id textMarker = [m_element accessibilityAttributeValue:@"AXStartTextMarkerForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()];
+    return AccessibilityTextMarker::create(textMarker);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;    
+}
+
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::endTextMarkerForTextMarkerRange(AccessibilityTextMarkerRange* range)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id textMarker = [m_element accessibilityAttributeValue:@"AXEndTextMarkerForTextMarkerRange" forParameter:(id)range->platformTextMarkerRange()];
+    return AccessibilityTextMarker::create(textMarker);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;    
+}
+
+PassRefPtr<AccessibilityTextMarker> AccessibilityUIElement::textMarkerForPoint(int x, int y)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id textMarker = [m_element accessibilityAttributeValue:@"AXTextMarkerForPosition" forParameter:[NSValue valueWithPoint:NSMakePoint(x, y)]];
+    return AccessibilityTextMarker::create(textMarker);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;    
+}
+
+PassRefPtr<AccessibilityUIElement> AccessibilityUIElement::accessibilityElementForTextMarker(AccessibilityTextMarker* marker)
+{
+    BEGIN_AX_OBJC_EXCEPTIONS
+    id uiElement = [m_element accessibilityAttributeValue:@"AXUIElementForTextMarker" forParameter:(id)marker->platformTextMarker()];
+    return AccessibilityUIElement::create(uiElement);
+    END_AX_OBJC_EXCEPTIONS
+    
+    return 0;  
+}
+
+} // namespace WTR
+
index 1d5d008..b1e0265 100644 (file)
@@ -60,5 +60,11 @@ JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef u
 {
     return JSStringRetain(url); // Do nothing on mac.
 }
+    
+JSRetainPtr<JSStringRef> LayoutTestController::platformName()
+{
+    JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("mac"));
+    return platformName;
+}
 
 } // namespace WTR
index 496ce3e..d896187 100644 (file)
@@ -89,6 +89,12 @@ JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef u
     return JSStringCreateWithCharacters(reinterpret_cast<const JSChar*>(path.constData()), path.length());
 }
 
+JSRetainPtr<JSStringRef> LayoutTestController::platformName()
+{
+    JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("qt"));
+    return platformName;
+}
+
 } // namespace WTR
 
 #include "LayoutTestControllerQt.moc"
index 88230c4..be9c414 100644 (file)
@@ -64,4 +64,10 @@ JSRetainPtr<JSStringRef> LayoutTestController::pathToLocalResource(JSStringRef u
     return JSStringRetain(url); // TODO.
 }
 
+JSRetainPtr<JSStringRef> LayoutTestController::platformName()
+{
+    JSRetainPtr<JSStringRef> platformName(Adopt, JSStringCreateWithUTF8CString("win"));
+    return platformName;
+}
+
 } // namespace WTR
index 8aa3dd8..0fc67b5 100644 (file)
 /* Begin PBXBuildFile section */
                0F5169CB1445222D00E0A9D7 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F5169CA1445222D00E0A9D7 /* WebKit.framework */; };
                0F5169CC1445222D00E0A9D7 /* WebKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 0F5169CA1445222D00E0A9D7 /* WebKit.framework */; };
+               29210EAE144CACB700835BB5 /* AccessibilityUIElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29210EA9144CACB200835BB5 /* AccessibilityUIElement.cpp */; };
+               29210EB0144CACBD00835BB5 /* AccessibilityController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29210EA2144CAAA500835BB5 /* AccessibilityController.cpp */; };
+               29210EB4144CACD500835BB5 /* AccessibilityTextMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29210EB1144CACD400835BB5 /* AccessibilityTextMarker.cpp */; };
+               29210EB5144CACD500835BB5 /* AccessibilityTextMarkerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29210EB3144CACD400835BB5 /* AccessibilityTextMarkerMac.mm */; };
+               29210EDA144CC3EA00835BB5 /* AccessibilityUIElementMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29210EAB144CACB200835BB5 /* AccessibilityUIElementMac.mm */; };
+               29210EDB144CD47900835BB5 /* JSAccessibilityController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 583913D014335E95008307E5 /* JSAccessibilityController.cpp */; };
+               29210EE1144CDB2600835BB5 /* JSAccessibilityUIElement.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29210EDB146727E711835BB5 /* JSAccessibilityUIElement.cpp */; };
+               29A8FCCB145EF02E009045A6 /* JSAccessibilityTextMarker.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29210EE1144CDE6789815EE5 /* JSAccessibilityTextMarker.cpp */; };
+               29A8FCDD145F0337009045A6 /* JSAccessibilityTextMarkerRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A8FCE1345E7021006AA5A6 /* JSAccessibilityTextMarkerRange.cpp */; };
+               29A8FCE2145F037B009045A6 /* AccessibilityTextMarkerRange.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 29A8FCE1145F037B009045A6 /* AccessibilityTextMarkerRange.cpp */; };
+               29A8FCE5145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 29A8FCE4145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm */; };
                5322FB4313FDA0CD0041ABCC /* CyclicRedundancyCheck.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5322FB4113FDA0CD0041ABCC /* CyclicRedundancyCheck.cpp */; };
                5322FB4613FDA0EA0041ABCC /* PixelDumpSupport.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5322FB4413FDA0EA0041ABCC /* PixelDumpSupport.cpp */; };
                5641E2D014335E95008307E5 /* JSTextInputController.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 5641E2CE14335E95008307E5 /* JSTextInputController.cpp */; };
 
 /* Begin PBXFileReference section */
                0F5169CA1445222D00E0A9D7 /* WebKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = WebKit.framework; sourceTree = BUILT_PRODUCTS_DIR; };
+               29210EA2144CAAA500835BB5 /* AccessibilityController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityController.cpp; sourceTree = "<group>"; };
+               29210EA3144CAAA500835BB5 /* AccessibilityController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityController.h; sourceTree = "<group>"; };
+               29210EA8144CAB8800835BB5 /* AccessibilityController.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AccessibilityController.idl; sourceTree = "<group>"; };
+               29210EA9144CACB200835BB5 /* AccessibilityUIElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityUIElement.cpp; sourceTree = "<group>"; };
+               29210EAA144CACB200835BB5 /* AccessibilityUIElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityUIElement.h; sourceTree = "<group>"; };
+               29210EAB144CACB200835BB5 /* AccessibilityUIElementMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityUIElementMac.mm; path = mac/AccessibilityUIElementMac.mm; sourceTree = "<group>"; };
+               29210EB1144CACD400835BB5 /* AccessibilityTextMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityTextMarker.cpp; sourceTree = "<group>"; };
+               29210EB2144CACD400835BB5 /* AccessibilityTextMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityTextMarker.h; sourceTree = "<group>"; };
+               29210EB3144CACD400835BB5 /* AccessibilityTextMarkerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityTextMarkerMac.mm; path = mac/AccessibilityTextMarkerMac.mm; sourceTree = "<group>"; };
+               29210EDB146727E711835BB5 /* JSAccessibilityUIElement.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSAccessibilityUIElement.cpp; path = DerivedSources/WebKitTestRunner/JSAccessibilityUIElement.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
+               29210EDB146727E811835BB5 /* JSAccessibilityUIElement.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSAccessibilityUIElement.h; path = DerivedSources/WebKitTestRunner/JSAccessibilityUIElement.h; sourceTree = BUILT_PRODUCTS_DIR; };
+               29210EDC144CD56E00835BB5 /* AccessibilityUIElement.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AccessibilityUIElement.idl; sourceTree = "<group>"; };
+               29210EE1144CDE6789815EE5 /* JSAccessibilityTextMarker.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSAccessibilityTextMarker.cpp; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarker.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
+               29210EE1145CDE6789815EE5 /* JSAccessibilityTextMarker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSAccessibilityTextMarker.h; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarker.h; sourceTree = BUILT_PRODUCTS_DIR; };
+               29A8FCC5145B93C6009045A6 /* AccessibilityTextMarker.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = AccessibilityTextMarker.idl; sourceTree = "<group>"; };
+               29A8FCD2145EF8F2009045A6 /* AccessibilityTextMarkerRange.idl */ = {isa = PBXFileReference; lastKnownFileType = text; path = AccessibilityTextMarkerRange.idl; sourceTree = "<group>"; };
+               29A8FCDF145F0358009045A6 /* AccessibilityTextMarkerRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = AccessibilityTextMarkerRange.h; sourceTree = "<group>"; };
+               29A8FCE1145F037B009045A6 /* AccessibilityTextMarkerRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = AccessibilityTextMarkerRange.cpp; sourceTree = "<group>"; };
+               29A8FCE1345E7021006AA5A6 /* JSAccessibilityTextMarkerRange.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSAccessibilityTextMarkerRange.cpp; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarkerRange.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
+               29A8FCE1345E7021006AA5A7 /* JSAccessibilityTextMarkerRange.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSAccessibilityTextMarkerRange.h; path = DerivedSources/WebKitTestRunner/JSAccessibilityTextMarkerRange.h; sourceTree = BUILT_PRODUCTS_DIR; };
+               29A8FCE4145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = AccessibilityTextMarkerRangeMac.mm; path = mac/AccessibilityTextMarkerRangeMac.mm; sourceTree = "<group>"; };
                378D442213346D00006A777B /* config.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = config.h; sourceTree = "<group>"; };
                41230E16138C78BF00BCCFCA /* libWebCoreTestSupport.dylib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.dylib"; path = libWebCoreTestSupport.dylib; sourceTree = BUILT_PRODUCTS_DIR; };
                4181731B138AD39D0057AAA4 /* WebCoreTestSupport.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebCoreTestSupport.h; path = WebCoreTestSupport/WebCoreTestSupport.h; sourceTree = BUILT_PRODUCTS_DIR; };
                5664A49914326384008881BE /* TextInputController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextInputController.h; sourceTree = "<group>"; };
                5670B8261386FC13002EB355 /* EventSenderProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = EventSenderProxy.h; sourceTree = "<group>"; };
                5670B8271386FCA5002EB355 /* EventSenderProxy.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = EventSenderProxy.mm; sourceTree = "<group>"; };
+               583913D014335E95008307E5 /* JSAccessibilityController.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = JSAccessibilityController.cpp; path = DerivedSources/WebKitTestRunner/JSAccessibilityController.cpp; sourceTree = BUILT_PRODUCTS_DIR; };
+               583913D114335E95008307E5 /* JSAccessibilityController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSAccessibilityController.h; path = DerivedSources/WebKitTestRunner/JSAccessibilityController.h; sourceTree = BUILT_PRODUCTS_DIR; };
                6510A77711EC643800410867 /* AHEM____.TTF */ = {isa = PBXFileReference; lastKnownFileType = file; name = "AHEM____.TTF"; path = "fonts/AHEM____.TTF"; sourceTree = "<group>"; };
                6510A77911EC643800410867 /* WebKitWeightWatcher100.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher100.ttf; path = fonts/WebKitWeightWatcher100.ttf; sourceTree = "<group>"; };
                6510A77A11EC643800410867 /* WebKitWeightWatcher200.ttf */ = {isa = PBXFileReference; lastKnownFileType = file; name = WebKitWeightWatcher200.ttf; path = fonts/WebKitWeightWatcher200.ttf; sourceTree = "<group>"; };
                        name = Products;
                        sourceTree = "<group>";
                };
+               29A8FCE0145F035D009045A6 /* Accessibility */ = {
+                       isa = PBXGroup;
+                       children = (
+                               29210EA2144CAAA500835BB5 /* AccessibilityController.cpp */,
+                               29210EA3144CAAA500835BB5 /* AccessibilityController.h */,
+                               29210EA9144CACB200835BB5 /* AccessibilityUIElement.cpp */,
+                               29210EAA144CACB200835BB5 /* AccessibilityUIElement.h */,
+                               29210EAB144CACB200835BB5 /* AccessibilityUIElementMac.mm */,
+                               29210EB1144CACD400835BB5 /* AccessibilityTextMarker.cpp */,
+                               29210EB2144CACD400835BB5 /* AccessibilityTextMarker.h */,
+                               29210EB3144CACD400835BB5 /* AccessibilityTextMarkerMac.mm */,
+                               29A8FCE1145F037B009045A6 /* AccessibilityTextMarkerRange.cpp */,
+                               29A8FCDF145F0358009045A6 /* AccessibilityTextMarkerRange.h */,
+                               29A8FCE4145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm */,
+                       );
+                       name = Accessibility;
+                       sourceTree = "<group>";
+               };
                65EB859E11EC67CC0034D300 /* mac */ = {
                        isa = PBXGroup;
                        children = (
                BC14E4E0120E02F900826C0C /* Controllers */ = {
                        isa = PBXGroup;
                        children = (
+                               29A8FCE0145F035D009045A6 /* Accessibility */,
                                BC8FD8C9120E527F00F3E71A /* EventSendingController.cpp */,
                                BC8FD8C8120E527F00F3E71A /* EventSendingController.h */,
                                BC14E4D9120E02D000826C0C /* GCController.cpp */,
                                BC952C0E11F3B97B003398B4 /* JSWrappable.h */,
                                BC952C0C11F3B965003398B4 /* JSWrapper.cpp */,
                                BC952C0B11F3B965003398B4 /* JSWrapper.h */,
+                               29210EA8144CAB8800835BB5 /* AccessibilityController.idl */,
+                               29A8FCC5145B93C6009045A6 /* AccessibilityTextMarker.idl */,
+                               29A8FCD2145EF8F2009045A6 /* AccessibilityTextMarkerRange.idl */,
+                               29210EDC144CD56E00835BB5 /* AccessibilityUIElement.idl */,
                                BC8FD8CB120E52B000F3E71A /* EventSendingController.idl */,
                                BC14E4E1120E032000826C0C /* GCController.idl */,
                                BC952ED211F3C29F003398B4 /* LayoutTestController.idl */,
                BC952D3A11F3BF1F003398B4 /* Derived Sources */ = {
                        isa = PBXGroup;
                        children = (
+                               583913D014335E95008307E5 /* JSAccessibilityController.cpp */,
+                               583913D114335E95008307E5 /* JSAccessibilityController.h */,
+                               29210EE1144CDE6789815EE5 /* JSAccessibilityTextMarker.cpp */,
+                               29210EE1145CDE6789815EE5 /* JSAccessibilityTextMarker.h */,
+                               29A8FCE1345E7021006AA5A6 /* JSAccessibilityTextMarkerRange.cpp */,
+                               29A8FCE1345E7021006AA5A7 /* JSAccessibilityTextMarkerRange.h */,
+                               29210EDB146727E711835BB5 /* JSAccessibilityUIElement.cpp */,
+                               29210EDB146727E811835BB5 /* JSAccessibilityUIElement.h */,
                                BC8FD8D0120E545B00F3E71A /* JSEventSendingController.cpp */,
                                BC8FD8D1120E545B00F3E71A /* JSEventSendingController.h */,
                                BC14E4E8120E03D800826C0C /* JSGCController.cpp */,
                                C0CE720B1247C93300BC0EC4 /* LayoutTestControllerMac.mm in Sources */,
                                5664A49A14326384008881BE /* TextInputController.cpp in Sources */,
                                5641E2D014335E95008307E5 /* JSTextInputController.cpp in Sources */,
+                               29210EAE144CACB700835BB5 /* AccessibilityUIElement.cpp in Sources */,
+                               29210EB0144CACBD00835BB5 /* AccessibilityController.cpp in Sources */,
+                               29210EB4144CACD500835BB5 /* AccessibilityTextMarker.cpp in Sources */,
+                               29210EB5144CACD500835BB5 /* AccessibilityTextMarkerMac.mm in Sources */,
+                               29210EDA144CC3EA00835BB5 /* AccessibilityUIElementMac.mm in Sources */,
+                               29210EDB144CD47900835BB5 /* JSAccessibilityController.cpp in Sources */,
+                               29210EE1144CDB2600835BB5 /* JSAccessibilityUIElement.cpp in Sources */,
+                               29A8FCCB145EF02E009045A6 /* JSAccessibilityTextMarker.cpp in Sources */,
+                               29A8FCDD145F0337009045A6 /* JSAccessibilityTextMarkerRange.cpp in Sources */,
+                               29A8FCE2145F037B009045A6 /* AccessibilityTextMarkerRange.cpp in Sources */,
+                               29A8FCE5145F0464009045A6 /* AccessibilityTextMarkerRangeMac.mm in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
index f728d63..045ad6d 100644 (file)
                                >
                        </File>
                        <File
+                               RelativePath="..\InjectedBundle\Bindings\AccessibilityController.idl"
+                               >
+                               <FileConfiguration
+                                       Name="Debug|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug_All|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug_Cairo_CFLite|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release_Cairo_CFLite|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Production|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                       </File>
+                       <File
+                               RelativePath="..\InjectedBundle\Bindings\AccessibilityTextMarker.idl"
+                               >
+                               <FileConfiguration
+                                       Name="Debug|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug_All|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug_Cairo_CFLite|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release_Cairo_CFLite|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Production|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                       </File>
+                       <File
+                               RelativePath="..\InjectedBundle\Bindings\AccessibilityTextMarkerRange.idl"
+                               >
+                               <FileConfiguration
+                                       Name="Debug|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug_All|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug_Cairo_CFLite|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release_Cairo_CFLite|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Production|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                       </File>
+                       <File
+                               RelativePath="..\InjectedBundle\Bindings\AccessibilityUIElement.idl"
+                               >
+                               <FileConfiguration
+                                       Name="Debug|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug_All|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Debug_Cairo_CFLite|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Release_Cairo_CFLite|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                               <FileConfiguration
+                                       Name="Production|Win32"
+                                       ExcludedFromBuild="true"
+                                       >
+                                       <Tool
+                                               Name="VCMIDLTool"
+                                       />
+                               </FileConfiguration>
+                       </File>
+                       <File
                                RelativePath="..\InjectedBundle\Bindings\EventSendingController.idl"
                                >
                                <FileConfiguration
                        Name="Derived Sources"
                        >
                        <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSAccessibilityController.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSAccessibilityController.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSAccessibilityTextMarker.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSAccessibilityTextMarker.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSAccessibilityTextMarkerRange.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSAccessibilityTextMarkerRange.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSAccessibilityUIElement.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSAccessibilityUIElement.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\JSEventSendingController.cpp"
                                >
                        </File>
                        </File>
                </Filter>
                <File
+                       RelativePath="..\InjectedBundle\AccessibilityController.cpp"
+                       >
+               </File>
+               <File
+                       RelativePath="..\InjectedBundle\AccessibilityController.h"
+                       >
+               </File>
+               <File
+                       RelativePath="..\InjectedBundle\AccessibilityTextMarker.cpp"
+                       >
+               </File>
+               <File
+                       RelativePath="..\InjectedBundle\AccessibilityTextMarker.h"
+                       >
+               </File>
+               <File
+                       RelativePath="..\InjectedBundle\AccessibilityTextMarkerRange.cpp"
+                       >
+               </File>
+               <File
+                       RelativePath="..\InjectedBundle\AccessibilityTextMarkerRange.h"
+                       >
+               </File>
+               <File
+                       RelativePath="..\InjectedBundle\AccessibilityUIElement.cpp"
+                       >
+               </File>
+               <File
+                       RelativePath="..\InjectedBundle\AccessibilityUIElement.h"
+                       >
+               </File>
+               <File
                        RelativePath="..\InjectedBundle\win\ActivateFonts.cpp"
                        >
                </File>