Categories
HTML Accessibility

Doing my heading in

Beganyito visits Jonny's farm and is thoroughly lambasted by all and sundry a rural scene unfolds with a small, white shed adorned with a Canadian flag standing beside a larger garage. In front of these structures, two individuals (Patrick and Steve) stand talking, while another person (David) relaxes in a hanging chair. Nearby, two more people are seen, one by the house (Jonny) and the other closer to the shed (Beganyito). The house, with green siding and a metal roof, is surrounded by construction materials, indicating ongoing renovation work. Two vehicles are parked in front of the house, and the entire setting is enveloped by lush, wooded greenery, creating a serene backdrop for this casual gathering.

Interviewed by Mat Marquis

Earlier in 2024 I was approached by Mat Marquis to answer some questions on HTML headings. At the time I was only vaguely aware that the interview would become part of a printed Zine (pleasant surprise face), published by Mat with profits going to support Trans Lifeline.

So waste no time and buy a copy and get to read all the great stuff Mat has gathered and edited, by others including Eric Bailey and Heydon Pickering.

Multipage version Issue 1, summer 2024 Zine cover page: WE FUCKED UP HEADINGS

Q: (Question) Who are you, what’s your whole deal, etc.

I consider myself to be a Wanker (Whatareya? (You’re A Yob or You’re A Wanker) I am also a Web Accessibility Worker, have been so for too long (20 odd years). I have also been a Web Standards worker (at W3C) since 2006. I am also now one of 4 directors/partners in TetraLogical, an accessibility consultancy based in the UK, where I have lived for 18 years, although I still identify as an Australian. Outside of my main job I do Web Standards consulting for Vispero™, working with some old chums from Freedom Scientific™, the makers of JAWS™ to help improve JAWS support for HTML/ARIA. In my spare time I write stuff and I design and sell Web Standards Leisurewear.

Q: Pretend for a moment that I’m a different, worse guy: what do headings have to do with accessibility?

Many HTML elements and attributes are mapped to accessibility semantics in the browser. For example, <h1> has a role=heading and a property level=1. This information is used by assistive technology (AT), such as screen readers, to convey meaning to users aurally, just as text size and placement conveys meaning to users who consume the UI visually. AT users find the information useful by being able to understand which content is acting as a heading, being able to access the UI structure and navigate by headings.

Q: So, what happened? How did headings end up so busted in the first place?

I think the genesis of the HTML headings fiasco started with the choice of the original standardistas to opt for a hard coded level based definition for headings in HTML. This worked ok for a while, but as the web developed and HTML started to be used for more complex User Interfaces (UI) and UIs became more dynamic and componentized, the hard coded structural nature of H1-H6 became a brittle semantic, that caused issues for the new kids. Not that it wasn’t fragile to start with:

documents should not skip levels (for example, from H1 to H3), as converting such documents to other representations is often problematic.

Source: HTML 2 –  https://www.w3.org/MarkUp/html-spec/html-spec_5.html#SEC5.4

It is also the case that developers don’t understand the fundamentals of HTML semantics or don’t care much about conveying an accurate document structure non visually. So even when HTML headings are used, oftentimes, the heading element used does not match their implied semantics.

Q: Then HTML5 set out to fix it?

I first encountered the HTML outline algorithm at a W3C meeting in 2008. It was in a breakout session at TPAC. It was being spruiked by 2 of the movers and shakers of the burgeoning WHAT WG. In essence the Outline algorithm moved the semantics of a heading level from being derived from a headings name h1-h6, to being derived from the nesting level of a heading within sectioning content. The obvious issue with this method is that it was never implemented in browsers. Yes the CSS styling was implemented, but the actual exposing of the headings with the level they theoretically represented was not. Thus the W3C HTML5 spec included a warning I added to make it clear to developers that the outline algorithm was a fiction.

Warning! There are currently no known native implementations of the outline algorithm in graphical browsers or assistive technology user agents, although the algorithm is implemented in other software such as conformance checkers and browser extensions. Therefore the outline algorithm cannot be relied upon to convey document structure to users. Authors should use heading rank (h1-h6) to convey document structure.

As at the time there were 2 versions of HTML I also filed an issue, in 2015, on the WHATWG HTML spec to add a warning.

Q: [Seems sensible enough.] What went wrong?

I waited, and waited, and waited some more, until 2022 when I realised that unless someone other than the editors did the work the WHATWG HTML spec would continue to have a decade old theoretical fiction masquerading as HTML truth. Note by this time the spec wars were long over and the only maintained specification was WHATWG HTML. There had been lots of discussion and hand wringing by various Web Standards Celebrities, but no actual changes in the spec or implementations of the outline algorithm in user agents. So I decided to do it myself with a Pull Request (PR): replace current outline algorithm with one based on heading levels.

My thinking at the time was that at least if the HTML spec reflected some sort of reality, after a decade of misdirection, developers would no longer be misled into thinking that the nesting of headings in sectioning elements actually did anything.

Note the process of updating the spec was positively facilitated by the WHATWG editing gang at the time.

Q: Speaking of HTML5, what was wrong with hgroup — it makes sense on paper, yeah? “Made?”

During my time as an editor of the HTML5 spec (at W3C) I ended up removing <hgroup> as what it represented was meaningless as it derived its semantics from a fiction and in reality was nothing more than a styling hook (think <div>) that lead developers to use h1-h6 elements as subheadings, when they did not work as such. I did try to work with the editors of the WHATWG HTML spec at the time, to make <hgroup> more meaningful, to no avail. It remained in the WHATWG HTML so when I came to do the PR to update the outline algorithm, rather than re-litigate the uselessness of <hgroup> I decided to recast hgroup in a form that mitigated its negative effects.

Q: Where do you land on this proposed headingstart attribute?

To be honest I have pretty much tuned out of the discussion, I find my attention span is fairly limited for this particular rabbit hole and prefer to work on the myriad other web standards opportunities that present themselves. Having read through the issue it seems reasonable and the right heads are involved in the discussion. If it gets implemented interoperably, bravo!!

Q: While we wait to see how that plays out, what should we be doing right now?

Use h1-h6 as described in the HTML spec. Also have a read of Subheadings, subtitles, alternative titles and taglines in HTML

Lyrics – Whatareya? (You’re A Yob or You’re A Wanker)
You're a yob or you're a wanker
Take your fucking choice
So who is your favourite genius
James Hird or James Joyce?
You ever seen a live performance?
Join the wanker club
You thought I meant table top dancing?
You're a yobbo, bub
What are ya? Yob or wanker?
Wankers once used mobile phones
But now that's sorta changing
And yobs once lived in cottage homes
Ain't social change amazing?
If a yob and wanker want a girl
The wanker guy will get her
Both of them are equally ugly
But the wanker hides it better
What are ya? Yob or wanker?
A wanker fights inequality
And for people's rights;
A wanker fights class prejudice
A yobbo just fights
Yob or wanker, wanker or yob
Pass me the brush to tar ya
Make your choice then live your life
Come on pal, what are ya?

Leave a Reply

Your email address will not be published. Required fields are marked *