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

hgroup element mapping update #398

Merged
merged 17 commits into from
Mar 8, 2023
Merged

hgroup element mapping update #398

merged 17 commits into from
Mar 8, 2023

Conversation

scottaohara
Copy link
Member

@scottaohara scottaohara commented Apr 28, 2022

Related to whatwg/html#7829.

hgroup was revised to no longer have any expectation of multiple headings as nested children. This PR simply revises the mapping of hgroup from a generic to a role=group. This mapping change is done to indicate this element represents a group of related content, and to allow authors to name this group without the need of a specific ARIA attribute.

Previous discussion about revising the roles of errant headings, beyond the first valid instance, have been put on hold for now, and are not part of this PR.

this resolves #123
this may well help resolving w3c/aria-practices#1157

Implementation bugs filed:


Preview | Diff

Related to whatwg/html#7829.

Assuming this PR lands, an `hgroup` will only allow a single heading and paragraph elements <small>(and script-supporting elements, but that's not relevant here)</small> to represent sub-heading information.

However, as there are _lots_ of instances of `hgroup` in the wild where multiple headings are used - as this was allowed prior to the HTML PR, these will become invalid markup patterns, and indicating that the headings of lower level be treated as `p` elements will at least mitigate for this change.

For additional discussion:
- should `hgroup` be exposed as a 'heading group' or even just a 'group' to define the boundaries of where the hgroup content starts/stops
- should `p` elements or errant extra `h#` elements be exposed as 'sub headings'.  `doc-subtitle` could potentially be used - though I'm not sure if that is actually appropriate, as we _don't_ want the subheadings to be exposed as 'headings' as some of the mappings for `doc-subtitle` would seem to indicate might be the result of mapping to this role.  This could potentially be related to what dpub ARIA roles should be brought back into ARIA proper - e.g., `role=subheading` 

this effectively resolves #123
this may well help resolving w3c/aria-practices#1157
@scottaohara
Copy link
Member Author

marked as not ready for merge until discussion topics are covered and continued work on the associated html issue

@scottaohara
Copy link
Member Author

Resolution from today's call - don't do anything regarding hgroup role or p roles until HTML spec update lands and there is an explicit desire/need for these additional changes.

@scottaohara
Copy link
Member Author

@jnurthen shall we talk about this again now that the updated heading outline has landed in HTML?

@scottaohara
Copy link
Member Author

scottaohara commented Jul 12, 2022

@jnurthen, spoke to @stevefaulkner this morning.

agreed that, especially in lieu of updating the mapping for address, it makes sense to map hgroup to group.
Otherwise, for now at least - leave the idea of a subheading/subtitle role alone. We can always re-assess in the future if people actually "want" a role like this announced/exposed.

Extra (now) invalid headings within the hgroup just need to be decided upon. If they remain headings, or if they get remapped.

index.html Outdated Show resolved Hide resolved
index.html Outdated Show resolved Hide resolved
@stevefaulkner
Copy link
Contributor

stevefaulkner commented Jul 14, 2022

@scottaohara @jnurthen thinking more about mapping, wondering if it is worthwhile having a specific mapping for hgroup such as headinggroup. Reasoning for this is that if AT would like to provide info to users about <p>'s within hgroup representing content as a subheading, subtitle, alternative title or tagline with role=group this will be ambiguous. If it is specified as a specific type of group it will be clear. I am not thinking that the semantics of the p elements or the <hgroup> will generally be conveyed to users, but would be good to have a clear mechanism to do so for AT. Thoughts??

@css-meeting-bot
Copy link
Member

The ARIA Working Group just discussed multiple headings in hgroup.

The full IRC log of that discussion <jamesn> topic: multiple headings in hgroup
<jamesn> zakim, next item
<Zakim> agendum 6 -- -> indicate what to do with multiple headings in hgroup https://github.com//pull/398 -- taken up [from agendabot]
<jamesn> github: https://github.com//pull/398
<jamesn> scotto: defered this until outline changes were resolved
<jamesn> scotto: the proposal is for extra headings within an hgroup outside of the highest level get mapped to a paragraph
<jamesn> scotto: or that we don't do anything and let invalid code be invalid code and validators would be the ones to inform authors of this
<jamesn> scotto: the other ask is whether we would be interested in creating a heading group role
<jamesn> scotto: to allow AT the option of letting users know that this stuff is all related to the heading
<jamesn> scotto: steve's thought otherwise is that there isn't any real boundary
<jamesn> scotto: these are the proposals
<jamesn> Matt_King: is the name heading group?
<jamesn> scotto: hgroup
<jamesn> scotto: original purpose was to contribute to the never implemented outline algorithm and authors could group headings together and that never happened
<jamesn> scotto: now the content model allows a single heading and other paragraphs to provide additional info
<jamesn> scotto: there are implementations which group a bunch of headings
<jamesn> scotto: we could do something about that or not do anything and have validators flag them as being in error and have authors fix them
<jamesn> Matt_King: hgroup could have h1 h2 ... h6 within them
<jamesn> Matt_King: only the h1 is supposed to be a heading and the others wouldn't be heading content?
<jamesn> scotto: yes but browsers never implemented it
<jamesn> scotto: purpose was to allow you to use these headings essentially for styling things
<jamesn> Matt_King: if people are doing for styling reasons
<jamesn> Matt_King: could be H1 followed by 2 H4s
<jamesn> Matt_King: the right thing from AT is P elements
<jamesn> Matt_King: no point in showing the boundaries
<jamesn> Matt_King: groups almost never help
<jamesn> scotto: do we want to specify that errant headings be Paragraphs
<jamesn> scotto: might be easier to have validators call this out
<jamesn> Matt_King: sounds more reasonable to me
<jamesn> jamesn: make validators shout loudly
<jamesn> chlane: is that a case for deprecation?
<jamesn> scotto: no - not now

Copy link
Member Author

@scottaohara scottaohara left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updates coming out of WG discussion from today

index.html Outdated Show resolved Hide resolved
index.html Show resolved Hide resolved
@spectranaut spectranaut removed the Agenda label Aug 2, 2022
@scottaohara scottaohara changed the title indicate what to do with multiple headings in hgroup hgroup element mapping update Mar 8, 2023
@scottaohara
Copy link
Member Author

merging per bugs for this change being filed and no objections to this change from the wg.

@scottaohara scottaohara merged commit 472383b into gh-pages Mar 8, 2023
@scottaohara scottaohara deleted the hgroup-update branch March 8, 2023 21:11
aarongable pushed a commit to chromium/chromium that referenced this pull request Mar 15, 2023
See HTML-AAM changes: w3c/html-aam#398

Bug: 1422741
Change-Id: I3e19d675c1ba2c3fae18851ffb9715af4213237b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4329037
Auto-Submit: Ahmed Elwasefi <ahmad.alwasifi@gmail.com>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Reviewed-by: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1117678}
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

Successfully merging this pull request may close these issues.

Change mapping of h1-h6 and hgroup
4 participants