[webkit-dev] Accessibility Object Searching

Samuel White samuel_white at apple.com
Wed Jun 22 16:32:46 PDT 2011

Hey Dominic,

Thanks for the feedback. I've been prototyping this idea here and it does included text searching as you mentioned. My philosophy was to put the search functionality right into the AccessibilityObject class and leave the job of exposing external APIs up to the experts of each platform save for Mac. In the Mac accessibility code I have this functionality exposed under accessibilityAttributeValue:forParameter: where the attribute one must pass is AXSearchPredicate.

As for implementation details, I'd like to outline how a search is performed in my prototype for you. As I stated above, searching happens in the AccessibilityObject class. The function doing the heavy lifting takes an AccessibiltySearchPredicate which is just a simple data structure that holds the following:

An AccessibilityObject to search within.
An AccessibilityObject to start searching from (ex: search for X within object A but after object B).
A direction to search in.
A search type (link search, heading search, bold text search, etc).
Search text to look for.
Number of AccessibilityObjects to return.

This gives the flexibility to search for just text, or just elements, or both specific text but only within the scope of a specific search type. Thanks again for the initial feedback.


More information about the webkit-dev mailing list