-
Notifications
You must be signed in to change notification settings - Fork 45
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
Update HTML guidance #617
Comments
@chris-gds Thank for looking. Is there any more detail you can provide on what aspects need updating? Or even better, a PR...? |
👋🏼 @timblair - Sure, more details below - initial thoughts centre around
(I've also requested time to see if I can review / update in lot more detail). |
@chris-gds Did you manage to carve out any more time to to a full review of the HTML guidance? |
#617 notes the need for some parts of this guidance to be reviewed, but this has been raised in community meetings a few times and the position is that it's still broadly correct and there are no significant changes required. Marking this as reviewed, but reducing the review time to three months.
I noticed the ARIA in HTML spec' states that the technique of using https://w3c.github.io/html-aria/#el-section Should be a consideration if this is added in this guidance. |
Myself and @chris-gds had a very long discussion about this outside of here and decided that the current guidance on use of |
Still awaiting #617, but in general is still OK.
I haven't found time to put together a PR for the proposed changes and, after discussing it with others, I intend to consult with the frontend community first. I'll update the status of that here when it happens. |
The current guidance on use of `<section>` tags is unclear because: - the approach it recommends (using `aria-labelledby` to use the heading as their accessible name) creates a region landmark but the examples seem to show content that shouldn't be split off into one - from looking through a lot of GDS repos, I couldn't find any code following this pattern - it seems to clash with the current HTML5 spec', which now says you should use `<section>` tags to wrap groupings of content marked by a heading without use of `aria-labelledby` to make the heading the `<section>`s accessible name See HTML5 spec on `<section>`: https://html.spec.whatwg.org/multipage/sections.html#the-section-element By 'region landmark', I mean an element with `role="region"`. The original opinion that this guidance is unclear was stated in this issue: #617 I think a major cause of this confusion comes from the current guidance having been written when the HTML5 spec' still said that `<section>`s should be used with `<h1>`s to create the document outline, something never implemented in any browser: https://www.tpgi.com/html5-document-outline/) This has since been changed: whatwg/html#7829 These changes intend to ensure guidance around use of `<section>` tags is clearer by only referencing them in the bit on region landmarks and making it clear that using them in other ways (without assigning an accessible name) removes any semantics they add. Worth noting that these changes gratefully borrow from https://www.scottohara.me/blog/2018/03/03/landmarks.html
An attempt to rewite the guidance on use of `<section>` tags to solve the problems in #617. I think the current guidance on use of `<section>` tags is unclear because: - the approach it recommends (using `aria-labelledby` to get their accessible name from the heading) creates a region landmark but the examples seem to show content that wouldn't benefit from being in one - from looking through a lot of GDS repos, I couldn't find any code following this pattern - it seems to clash with the current HTML5 spec', which includes similar content examples but doesn't use of `aria-labelledby` to set an accessible name The HTML5 spec' on `<section>`: https://html.spec.whatwg.org/multipage/sections.html#the-section-element). By 'region landmark', I mean an element with `role="region"`. I think a major cause of this confusion comes from the current guidance having been written when the HTML5 spec' still said that `<section>`s should be used with `<h1>`s to create the document outline, something never implemented in any browser: https://www.tpgi.com/html5-document-outline/) This has since been changed: whatwg/html#7829 The spec' now seems to advocate using `<section>`s to identify the scope of a heading. This arguably makes the HTML easier to read but doesn't add any new semantics so I'm wary of including guidance for it here. These changes instead intend to clear up the existing guidance on use of `<section>` tags by making it clear that this approach creates region landmarks and that using them in other ways (without assigning an accessible name) removes any semantics they add. Worth noting that these changes gratefully borrow from https://www.scottohara.me/blog/2018/03/03/landmarks.html Final note: I expect a bit of discussion on this pull request so intend to update the date of the page these changes are in if and when they are agreed to be the correct approach to the issue.
After a short review we noted there are various aspects that are out of date and could go with an update especially around
aria-labelledby=
guidance and<section>
use.https://gds-way.cloudapps.digital/manuals/programming-languages/html.html
The text was updated successfully, but these errors were encountered: