Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
@terrill pointed out in #1272870-92: No semantics for nested comments / bad for screen-readers that threaded comments could be used to track the depth of the reply.
I was thinking about this too and think that there are some real strengths to this idea.
Couple things to consider:
- You'd want the semantics to change but not the size. This could be accomplished with CSS, but it would be a tricky pattern.
- If you allowed headings within the body of the comments, where would you start? Allowing anyone to insert a H4 would be fine until you're 2 replies deep at which point it starts to break the semantics.
- What happens if you're 5 replies deep? There are only 6 heading levels, right?
Still it's an interesting idea and there may be some way to make this work.
Comments
Comment #1
terrill CreditAttribution: terrill commentedThere are only six headings in HTML but you can also use role="heading" and aria-level="7" or beyond. Current versions of JAWS, NVDA, and VoiceOver all support aria-level, but support is relatively new so for browsers that don't support it I think it still best to use HTML headings down to H6.
Comment #2
mgiffordThe use of
aria-level="n"
would make it much easier.I'm trying to find ways to make this easier. D8 won't be out till 2015 at this point anyways. Most won't be deploying it till 2016. We'll have time for many screen reader users to catch up.
So
<h2 aria-level="8"></h2>
would probably still be considered an H2.Using actual H2-H6 is just going to be a styling nightmare.
I'd suggest we drop the HTML heading & go with
<div role="heading" aria-level="8"></div>
.Might also be an issue to think ahead to for D9. Not sure.
Is anyone else doing this?
Comment #3
mgiffordJust came across this and thought it was interesting:
https://github.com/ThePacielloGroup/html5-h
Comment #4
mgiffordComment #5
mgiffordComment #10
Ivan Berezhnov CreditAttribution: Ivan Berezhnov as a volunteer and at Drupal Ukraine Community for Levi9 commentedComment #22
mgiffordLooks like https://www.w3.org/WAI/WCAG21/Understanding/name-role-value