Skip to content
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

Making p in hgroup align with the html specification #501

Closed
slatian opened this issue Aug 24, 2023 · 6 comments
Closed

Making p in hgroup align with the html specification #501

slatian opened this issue Aug 24, 2023 · 6 comments

Comments

@slatian
Copy link

slatian commented Aug 24, 2023

What would change: any p element inside an hgroup element should default to a doc-subtitle (dpub-aria) role.

Why?

Both have very similar intention:

The p in hgroup construct in the html specification:

one or more p elements containing content representing a subheading, alternative title, or tagline.

The doc-subtitle is defined as:

An explanatory or alternate title for the work, or a section or component within it.

The descriptions overlap in

  • the "alternate title"
  • explanatory and subheading or tagline also have pretty similar, in some cases the same semantics
  • "section or component within it" also reads to me like a kind of subheading.

Both also give similar examples on how they are supposed to be used (with the difference being that the doc-subtitle one uses a header element instead of an hgroup).

Why this proposal?

The benefit of this additional rule would be a clean way to mark up subheading and similar constructs matching the descriptions in plain html without having to resort to setting aria roles "by hand" with the mess-up potential that comes with it.


This is a naive proposal that is probably lacking some insight in other parts of aria, this is something I stumbled across while trying to figure out why hgroup was advised against by some. Feel free to correct me where I'm wrong.

@scottaohara
Copy link
Member

these topics were discussed in #398 where the mapping was discussed and changed.

doc-subtitle is essentially exposed as a type of heading. p within hgroup is not meant to be exposed as a heading. it's a bit complicated, but one reason why that thread was dropped when the hgroup mapping was updated.

i'm not sure what guidance you're referring to where it is being advised against being used? is that guidance legacy - e.g., before the purpose of hgroup and the document outline in html were significantly altered? or is this newer guidance against use - in which case what was the rational?

I'm moving this over to HTML AAM, as that's the specification where element mappings are defined - which seems to be what this is proposing. ARIA in HTML defines how ARIA can be used in HTML, which does not seem to be what this issue is about.

@scottaohara scottaohara transferred this issue from w3c/html-aria Aug 24, 2023
@slatian
Copy link
Author

slatian commented Aug 24, 2023

Thanks for consideration and the quick reply!

doc-subtitle is essentially exposed as a type of heading. p within hgroup is not meant to be exposed as a heading. it's a bit complicated, but one reason why that thread was dropped when the hgroup mapping was updated.

Interaction with the outline … I was unaware of this part. Because it inherits from sectionhead ? If yes where can I find the specification for an aria-aware outline, I wasn't able to find anything like that except for the note on the heading role.

To hopefully help avoiding talking past each other: To me outlines work like in the HTML specification and subheadings while still being part of the heading don't affect them (or only as some kind of annotation depending on the user agent) which explained to me why the p element was chosen for them.

is that guidance legacy

Its more of a rumor that I tried to "investigate" and have at least some knowledge of the specification before saying anything on the matter.

… ARIA in HTML …

I placed it there because it contains the "Rules of ARIA attribute usage by HTML element ", I guess (with hindsight) it only contains derived Information?

@scottaohara
Copy link
Member

Interaction with the outline … I was unaware of this part. Because it inherits from sectionhead ? If yes where can I find the specification for an aria-aware outline, I wasn't able to find anything like that except for the note on the heading role.

i'm not really sure i understand everything you were trying to say there, but maybe this will cover it:

  • headings also inherit from sectionhead - there are a lot of author roles that inherit from different abstract roles, and how they're exposed can differ quite a bit.
  • doc-subtitle, from what i recall, has been implemented in browsers as a type of heading. so per your question about the document outline - elements which are exposed with a heading role will be communicated in the accessibility api as headings - and thus contribute to the document outline presented to assistive technology.
  • using p elements was because they are not exposed as headings. And they were not mapped to use doc-subtitle because right now those are exposed as headings in browsers (or at least they were at the time checked), which would be the opposite of the goal of not exposing them as headings.

re: hgroup usage, your response that there is a 'rumor' still doesn't help clarify the 'why' behind why to use or not. But one reason it was advised not to use in the past is because i didn't do anything the HTML spec said it should (in regards to accessibility). It was no different than using a div. Now, with it's remapping to a group role - in many cases it still will have minimal value UNLESS it's given an accessible name, in which it will then consistently be exposed as a group (with whatever name it was given). The value of doing that can be variable / contingent on the use case.

Re: ARIA in HTML - just to be absolutely clear - that spec is only about using explicit ARIA attributes on different HTML elements. Anything concerning the implicit accessible information an HTML feature has (or hasn't) belongs in this spec... and then updates made here might require an update to how ARIA can be used on HTML features in that spec. But yah, that's a high level of the relationship between the specs.

@slatian
Copy link
Author

slatian commented Aug 25, 2023

doc-subtitle, from what i recall, has been implemented in browsers as a type of heading.

Call me confused, but those implementations don't match the intention of the specification if I'm reading this (and the specification) correctly.

@scottaohara
Copy link
Member

recalling is one thing, pointing directly to the mappings that validate implementation are another - https://www.w3.org/TR/dpub-aam-1.1/#role-map-subtitle

but to close this loop - the potential for modifying the role of the p element was already discussed and decided against when the mapping for hgroup was modified, per the linked PR that coincided with the change in the HTML spec. Semantically the p represents a subtitle - but that doesn't necessarily mean there needs to be a role overtly assigned to it / exposed to users. That seemed of little actual value in the context of most web pages (keeping in mind that dpub is separate from the primary ARIA spec for a reason - so different expectations re: the context in which it is used/consumed do not necessarily apply 1:1 with standard web development).

So while the mapping of doc-subtitle might not make sense for how one might want to use it in HTML - I can only assume it does make sense in the context of dpub. And if that's actually odd over there, well, that's an issue for dpub ARIA / AAM to resolve.

With that I think this issue has run its course. Appreciate you filing it and I hope my answers have been helpful in providing context. But without further changes to the dpub role mapping, and more importantly users indicating they actually want/need this role to be exposed in web pages, there's nothing to really do at this point without evidence to change the previous decision to not modify the p element's mapping in the context of a parent hgroup

@slatian
Copy link
Author

slatian commented Aug 25, 2023

I hope my answers have been helpful in providing context.

They have been, thank you for taking the time to explain to someone who only has done part of their homework!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants