-
Notifications
You must be signed in to change notification settings - Fork 125
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Concerning the "generic" role #1182
Comments
I think the best argument for keeping @cookiecrook commented:
@mcking65 replied: Thank you for the assistive tech dev use cases. Those, combined with the case of the generic being focusable, are sound reason for having the role rather than mapping to none. |
Wilco does bring up a good point that the prose for "generic" role may need to be changed. |
@WilcoFiers, are you proposing HTML-AAM role mapping for |
If so, the HTML-AAM for this might get a little complicated. It might be doable, but I hadn't considered it before and want to call out some potential fallout. IIRC, WebKit and some others map For plain Mapping to |
@cookiecrook Hey James! And, thanks for the background info @carmacleod. I know that Webkit decides between If I understand correct, the motivation for |
A lot of ATs on Mac/iOS devices use those containers to derive layout information like position and bounds. I think the implementations could change, but I'm not sure the amount of effort required. I expect it would require updates to WebKit at a minimum, likely also to VoiceOver, and perhaps to other AT like Switch Control, Voice Control, Hover Text, etc. |
Layout info is used for display (like the scaled VO cursor), triggering events (like drag/drop or custom gestures in SC), coordination between AT (like Zoom following KB Focus or VO nav), and more. There's a big stack that relies on these. |
The ARIA Working Group just discussed The full IRC log of that discussion<carmacleod> github: https://github.com//issues/1182<jamesn> "A generic can provide a limited number of accessible states and properties for its descendants, such as aria-live attributes. In addition, generic containers are exposed to the API so that assistive technologies can gather certain properties such as layout and bounds. This differentiates it from the presentation role. " <carmacleod> jamesn: nit, should be "accessibility API", not just "API". <carmacleod> mck: do we want to put the statement that we're differentiating from presentation role in front of the new sentence? <carmacleod> carmacleod: yes, that works <carmacleod> mck: I will add that to the pr |
I have a few reservations with distinguishing the role "generic" from role "presentation". ARIA 1.1 isn't explicit about this, but example 8 (under
presentation
) indicates thatspan
elements implicitly have no role:It is not at all unreasonable to assume the same is true for
div
, which is how most browsers have interpreted this. In all Chromium / Webkit browsers (as best I can tell), adiv
is treated as having no role, the same way puttingrole="presentation"
on other elements. The only major browser that seems to differ from this is Firefox, which treatsdiv
elements as containers.Where this matters is in things like set size counts. The following code snippet is counted in Chrome as having 3 items, but in Firefox it is counted as having 2:
I think Chromium / Webkit do the right thing here in excluding these
span
elements from the accessibility tree. That is definitely consistent with what ARIA 1.1 says aboutspan
elements in example 8.This type of pattern is very common. You can see it a lot in component architecture. It produces "div soup". Parent-child relationships quickly get disrupted by wrapping components in deeper abstraction layers. This isn't a big issue in Chromium because it just won't put the
div
in the accessibility tree, and thatmenuitem
will still be counted as a child ofmenu
.Introducing the role
generic
seems like it will make some fairly common patterns more difficult to make accessible. I am not all too sure why anyone would want an element with a generic role in their page at all. When usingdiv
, you'd either want it ignored, or for it to have some type of role, likegroup
. The only explanation there is in ARIA 1.2 is this:But the problem with this is that the
generic
role has the exact same allowed attributes aspresentation
does. You can usearia-live
on an element withpresentation
. I'm not sure it works, but if not, that's something browsers need to fix.In short, can the
generic
role be removed?The text was updated successfully, but these errors were encountered: