Consider requiring user agents to calculate aria-level, aria-posinset, and aria-setsize when not declared by authors
The proposed comment role includes the following language:
If the author has not explicitly declared aria-level, aria-posinset, or aria-setsize for a comment element, user agents MUST automatically compute the missing values and expose them to assistive technologies.
Currently, ARIA does not include a normative requirement for computing these properties when they are used on elements with other roles that support them. For example, the definition of aria-level includes the following language:
If the DOM ancestry accurately represents the level, the user agent can calculate the level of an item from the document structure. This attribute can be used to provide an explicit indication of the level when that is not possible to calculate from the document structure or the aria-owns attribute. User agent support for automatic calculation of level may vary; authors SHOULD test with user agents and assistive technologies to determine whether this attribute is needed. If the author intends for the user agent to calculate the level, the author SHOULD omit this attribute.
So, user agents are explicitly given a pass here. Let's consider changing this language to require calculation.
I'm all for it. But for role=heading this seems awfully close to the HTML5 Document Outline.
aria-level is required on role=heading so this wouldn't apply there. If it is missing the error-correction technique is to supply aria-level=2
Ah, my (lucky) mistake - thanks for reminding me, @jnurthen!
aria-level is required on role=heading so this wouldn't apply there. If it is missing the error-correction technique is to supply aria-level=2
So the wording for requiring user agents to calculate aria-level will need to specifically mention not calculating on roles where it's a required attribute.
Related: There's already some language in Core-AAM: https://w3c.github.io/core-aam/#mapping_additional_position
Proposal: Because calculating these things is NOT platform-specific mappings, the text belongs in the ARIA spec rather than the Core-AAM (imho). Therefore, it might make sense to use the wording there as a starting point to fix this issue for the ARIA spec. Having done so (and gotten it landed in the ARIA spec), then do a pull request to remove the language from the Core-AAM.
@sinabahram will this be done in time for 1.3?
I'm very sorry, but probably not. Personal and work is absolutely ridiculous right now. Again, apologies.
VoiceOver assumes no level on headings when not supplied by an author, and just speaks "heading" not the more verbose "heading level 0" or the arbitrary "heading level 2." I would recommend against advising AT to verbosely convey info that the author may not have intended.
@cookiecrook but aria-level is required on role heading, so that would be an authoring error.