Bug 109725 - AX: Support aria-posinset/setsize
Summary: AX: Support aria-posinset/setsize
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Accessibility (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: chris fleizach
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-13 11:53 PST by chris fleizach
Modified: 2013-03-05 17:50 PST (History)
15 users (show)

See Also:


Attachments
patch (8.79 KB, patch)
2013-02-13 12:00 PST, chris fleizach
no flags Details | Formatted Diff | Diff
patch (8.39 KB, patch)
2013-02-21 17:48 PST, chris fleizach
webkit-ews: commit-queue-
Details | Formatted Diff | Diff
patch (8.84 KB, patch)
2013-02-21 17:54 PST, chris fleizach
buildbot: commit-queue-
Details | Formatted Diff | Diff
patch (8.84 KB, patch)
2013-02-21 22:00 PST, chris fleizach
thorton: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description chris fleizach 2013-02-13 11:53:41 PST
WebKit needs to support

aria-posinset and
aria-setsize

http://www.w3.org/TR/wai-aria/states_and_properties#aria-posinset
http://www.w3.org/TR/wai-aria/states_and_properties#aria-setsize
Comment 1 chris fleizach 2013-02-13 12:00:25 PST
Created attachment 188138 [details]
patch
Comment 2 chris fleizach 2013-02-13 12:01:24 PST
This is pretty straightforward. Just expose these ARIA attributes so that a screen reader can output something expected
Comment 3 Dominic Mazzoni 2013-02-15 11:50:09 PST
Comment on attachment 188138 [details]
patch

On Windows and GTK, I believe that the position in set and set size are supposed to be exposed for any list item, not just those with an ARIA override. So each item in a simple <ul>, for example, would have a default position in set.

Would it confuse VoiceOver if these were exposed on each list item when ARIA is not used?

If not, my preference would be to remove the ARIA from the method names, and provide default implementations for list items and listbox options.

View in context: https://bugs.webkit.org/attachment.cgi?id=188138&action=review
> Source/WebCore/accessibility/AccessibilityObject.h:521
> +    int ariaPosInset() const;

I'd capitalize this ariaPosInSet, since it's short for "position in set"
Comment 4 Mario Sanchez Prada 2013-02-18 03:03:47 PST
(In reply to comment #3)
> (From update of attachment 188138 [details])
> On Windows and GTK, I believe that the position in set and set size are 
> supposed to be exposed for any list item, not just those with an ARIA override. 
> So each item in a simple <ul>, for example, would have a default position in 
> set.

For the case of GTK, the way a position of a given object in a container/parent is exposed through atk_object_get_n_accessible_children and atk_object_get_index_in_parent, which basically handle positions in the currently exposed a11y tree.

No ARIA stuff is involved at all there, afaik.

> Would it confuse VoiceOver if these were exposed on each list item when ARIA is 
> not used?
> 
> If not, my preference would be to remove the ARIA from the method names, and
> provide default implementations for list items and listbox options.

Not sure if I fully understood your suggestion, Dominic, so please take the following with a grain of salt:

I wonder if it's really a good idea to mix what these ARIA properties [1] mean (not the "visual position" of elements in a visible set of items) with what the current ways to check the "position in parent" for a given object mean.

So, I think it's perhaps a better idea to keep them as separated concepts at the level of AccessibilityObject and let the platforms merge them or not at their will.

[1] http://www.w3.org/TR/wai-aria/states_and_properties
Comment 5 James Craig 2013-02-19 11:12:07 PST
Case-sensitivity: AXARIAPosInset should probably be AXARIAPosInSet
Since it stands for "position in set" not "position inset"…
Comment 6 Dominic Mazzoni 2013-02-19 11:18:13 PST
OK, if there's only one platform that exposes a generic attribute like that, this implementation makes sense.

One last thought: should supportsAriaPosInSet and supportsAriaSetSize only return true when the role is appropriate? The ARIA spec makes it pretty clear that these are only intended for certain roles, perhaps we should enforce that.
Comment 7 James Craig 2013-02-19 11:28:02 PST
(In reply to comment #6)
> One last thought: should supportsAriaPosInSet and supportsAriaSetSize only return true when the role is appropriate? The ARIA spec makes it pretty clear that these are only intended for certain roles, perhaps we should enforce that.

The spec never states that UAs "MUST NOT" expose it elsewhere, so I'd err on the side of exposing it any time it is defined. This is especially true b/c the 1.0 spec clearly has an error in that it lists it for use on listem and option, but this was also intended for:

1. rows in vertical grids and treegrids
2. groups and treeitems in trees
3. gridcells, columnheaders, and rowheaders in horizontal scrolling grids (rare, but possible)
Comment 8 Dominic Mazzoni 2013-02-19 11:32:01 PST
(In reply to comment #7)
> 1. rows in vertical grids and treegrids
> 3. gridcells, columnheaders, and rowheaders in horizontal scrolling grids (rare, but possible)

I'd prefer if we added aria-colindex and aria-rowindex attributes, rather than reuse aria-posinset to mean row index when there's no equivalent for col index.
Comment 9 James Craig 2013-02-19 11:39:12 PST
(In reply to comment #8)
> I'd prefer if we added aria-colindex and aria-rowindex attributes, rather than reuse aria-posinset to mean row index when there's no equivalent for col index.

Will you add that comment to PFWG-ISSUE-398?
https://www.w3.org/WAI/PF/Group/track/issues/398
Comment 10 Dominic Mazzoni 2013-02-19 12:03:53 PST
(In reply to comment #9)
> Will you add that comment to PFWG-ISSUE-398?
> https://www.w3.org/WAI/PF/Group/track/issues/398

Will do.

I don't want to take this bug off topic anymore - I'm happy with this patch once capitalization is fixed.
Comment 11 chris fleizach 2013-02-21 17:48:04 PST
Created attachment 189649 [details]
patch
Comment 12 Early Warning System Bot 2013-02-21 17:53:06 PST
Comment on attachment 189649 [details]
patch

Attachment 189649 [details] did not pass qt-ews (qt):
Output: http://queues.webkit.org/results/16689487
Comment 13 chris fleizach 2013-02-21 17:54:26 PST
Created attachment 189651 [details]
patch
Comment 14 Early Warning System Bot 2013-02-21 17:54:28 PST
Comment on attachment 189649 [details]
patch

Attachment 189649 [details] did not pass qt-wk2-ews (qt):
Output: http://queues.webkit.org/results/16693452
Comment 15 Build Bot 2013-02-21 21:09:22 PST
Comment on attachment 189651 [details]
patch

Attachment 189651 [details] did not pass mac-wk2-ews (mac-wk2):
Output: http://queues.webkit.org/results/16694501

New failing tests:
platform/mac/accessibility/aria-setsize-posinset.html
Comment 16 chris fleizach 2013-02-21 22:00:23 PST
Created attachment 189680 [details]
patch
Comment 17 chris fleizach 2013-03-05 17:50:07 PST
http://trac.webkit.org/changeset/144858