AX: Add ability to specify descendant type when using AXUIElementsForSearchPredicate.
authorsamuel_white@apple.com <samuel_white@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Feb 2014 08:33:43 +0000 (08:33 +0000)
committersamuel_white@apple.com <samuel_white@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 15 Feb 2014 08:33:43 +0000 (08:33 +0000)
commitd12c8fd54b79c65280e607d20e2eef718618e675
treebb08a9abf3ce312054762dd714179e1034b568cf
parentc4fff60f3ff4c99fe429eaae8a3cad81efb51c58
AX: Add ability to specify descendant type when using AXUIElementsForSearchPredicate.
https://bugs.webkit.org/show_bug.cgi?id=128747

Reviewed by Chris Fleizach.

Source/WebCore:

Added support for 'immediate descendant only' to existing predicate based searching. This
addition allows VoiceOver to fetch each child element lazily (rather than all at once via AXChildren).

Test: platform/mac/accessibility/search-predicate-immediate-descendants-only.html

* accessibility/AccessibilityObject.cpp:
(WebCore::AccessibilityObject::findMatchingObjects):
* accessibility/AccessibilityObject.h:
(WebCore::AccessibilitySearchCriteria::AccessibilitySearchCriteria):
* accessibility/mac/WebAccessibilityObjectWrapperMac.mm:
(accessibilitySearchCriteriaForSearchPredicateParameterizedAttribute):

Tools:

Updated uiElementCountForSearchPredicate and uiElementForSearchPredicate test methods to support 'immediate descendant only' searching.

* DumpRenderTree/AccessibilityUIElement.cpp:
(uiElementCountForSearchPredicateCallback):
(uiElementForSearchPredicateCallback):
* DumpRenderTree/AccessibilityUIElement.h:
* DumpRenderTree/atk/AccessibilityUIElementAtk.cpp:
(AccessibilityUIElement::uiElementCountForSearchPredicate):
(AccessibilityUIElement::uiElementForSearchPredicate):
* DumpRenderTree/ios/AccessibilityUIElementIOS.mm:
(AccessibilityUIElement::uiElementCountForSearchPredicate):
(AccessibilityUIElement::uiElementForSearchPredicate):
* DumpRenderTree/mac/AccessibilityUIElementMac.mm:
(searchPredicateParameterizedAttributeForSearchCriteria):
(AccessibilityUIElement::uiElementCountForSearchPredicate):
(AccessibilityUIElement::uiElementForSearchPredicate):
* DumpRenderTree/win/AccessibilityUIElementWin.cpp:
(AccessibilityUIElement::uiElementCountForSearchPredicate):
(AccessibilityUIElement::uiElementForSearchPredicate):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp:
(WTR::AccessibilityUIElement::uiElementCountForSearchPredicate):
(WTR::AccessibilityUIElement::uiElementForSearchPredicate):
* WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h:
* WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl:
* WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp:
(WTR::AccessibilityUIElement::uiElementCountForSearchPredicate):
(WTR::AccessibilityUIElement::uiElementForSearchPredicate):
* WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm:
(WTR::AccessibilityUIElement::uiElementCountForSearchPredicate):
(WTR::AccessibilityUIElement::uiElementForSearchPredicate):
* WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm:
(WTR::searchPredicateParameterizedAttributeForSearchCriteria):
(WTR::AccessibilityUIElement::uiElementCountForSearchPredicate):
(WTR::AccessibilityUIElement::uiElementForSearchPredicate):

LayoutTests:

Added test to verify that 'immediate descendant only' predicate based searching works as expected.

* platform/mac/accessibility/search-predicate-immediate-descendants-only-expected.txt: Added.
* platform/mac/accessibility/search-predicate-immediate-descendants-only.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@164165 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/accessibility/search-predicate-immediate-descendants-only-expected.txt [new file with mode: 0644]
LayoutTests/platform/mac/accessibility/search-predicate-immediate-descendants-only.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/accessibility/AccessibilityObject.cpp
Source/WebCore/accessibility/AccessibilityObject.h
Source/WebCore/accessibility/mac/WebAccessibilityObjectWrapperMac.mm
Tools/ChangeLog
Tools/DumpRenderTree/AccessibilityUIElement.cpp
Tools/DumpRenderTree/AccessibilityUIElement.h
Tools/DumpRenderTree/atk/AccessibilityUIElementAtk.cpp
Tools/DumpRenderTree/ios/AccessibilityUIElementIOS.mm
Tools/DumpRenderTree/mac/AccessibilityUIElementMac.mm
Tools/DumpRenderTree/win/AccessibilityUIElementWin.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.cpp
Tools/WebKitTestRunner/InjectedBundle/AccessibilityUIElement.h
Tools/WebKitTestRunner/InjectedBundle/Bindings/AccessibilityUIElement.idl
Tools/WebKitTestRunner/InjectedBundle/atk/AccessibilityUIElementAtk.cpp
Tools/WebKitTestRunner/InjectedBundle/ios/AccessibilityUIElementIOS.mm
Tools/WebKitTestRunner/InjectedBundle/mac/AccessibilityUIElementMac.mm