Be Wary of doc-subtitle
August 16, 2020; 0 Comments
In early March, Steve Faulkner shared this nugget for making sub-headings:
?If you want to semantically identify a heading subtitle, look no further than role="doc-subtitle" w3.org/TR/dpub-aria-1.0/#doc-subtitle
#HTML #ARIA #WebDev pic.twitter.com/uaHcVRp6oz
Steve Faulkner (@stevefaulkner) March 7, 2020
On its surface it looks pretty handy. Handy enough that Chris Ferdinandi wrote about it in his July 23 post How to create accessible subtitles. Handy enough that Chris Coyier wrote about it in his August 6 post HTML for Subheadings and Headings.
Neither of these talks about support (first Chris is updating his post) nor where the role comes from (first Chris is updating his post again). So let’s wade into both.
I am not going to talk about <hgroup>, its original intent in the mythical document outline algorithm, its removal from the W3C HTML5 candidate recommendation, the open issue to remove outlining from the WHATWG spec (obsoleting <hgroup>), nor its lack of support in any assistive technology.
The ARIA
If you really need to convey to screen reader users that your sub-head is a distinct yet related heading, then Steve provided a trick. As a reminder, only screen readers do anything with ARIA. Browsers expose [...]