Implement GetSetSize/ GetPosInSet for Views Accessibility in ViewAXPlatformNodeDelegate
Implement GetSetSize, GetPosInSet, IsOrderedSet and IsOrderedSetItem overrides for ViewAXPlatformNodeDelegate. These functions currently use the empty base implementation (i.e. return false, 0) so screen readers will not get information about sets for View elements, e.g. groups of radio buttons. With this change, screenreaders using UIA will read 'n of m' for items within a set. The Views-specific implementation for these functions considers two things when calculating set size and pos in set: -If AXNodeData has the attribute kPosInSet or kSetSize, it will return that value first. -If not, it will see if this View is contained in a group (View::GetGroup()). If so, it will count how many nearby Views are in that same group. If the View has a parent, it will start from the parent and include all ancestors of the parent. That way, sibling elements within the same group are included in the count. When calculating position in set, it will return the index of that View in the resulting vector of Views. Views::SetGroup is only used in a few places in the codebase. I have based the implementation off those uses so they are all supported. I general it seems Views that share group ids are siblings, and sometimes also their parent. 1. Radio buttons are constructed with a group_id passed in. Typically, it seems RadioButtons are siblings. 2. Groups of buttons in dialogs (e.g. "Bookmark added" dialog "More", "Done" and "Remove" buttons) may be in groups. See DialogClientView::UpdateDialogButton button->SetGroup(kButtonGroup) 3. ParentAccessView::AccessCodeInput contains multiple AccessibleInputFields. These are all in the same group, including the parent AccessCodeInput. SetGroup(kParentAccessInputGroup); .. field->SetGroup(kParentAccessInputGroup); 4. DesktopMediaListView contains many child DesktopMediaSourceViews, which are all in the same group source_view->SetGroup(kDesktopMediaSourceViewGroupId); Based on that, I think it is reasonable to only count the parent and sibling Views (and their ancestors) in calculating the number of Views in a group. Change-Id: I0fb72ced30b1c8220cd076d92ecb279802d4b36e Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1669329 Commit-Queue: Nektarios Paisios <nektar@chromium.org> Reviewed-by:Nektarios Paisios <nektar@chromium.org> Reviewed-by:
Kevin Babbitt <kbabbitt@microsoft.com> Cr-Commit-Position: refs/heads/master@{#672076}
Showing
Please register or sign in to comment