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

Suggest adding a warning about outline algorithm #83

Closed
stevefaulkner opened this issue Sep 1, 2015 · 120 comments
Closed

Suggest adding a warning about outline algorithm #83

stevefaulkner opened this issue Sep 1, 2015 · 120 comments
Labels
accessibility Affects accessibility document conformance normative change removal/deprecation Removing or deprecating a feature

Comments

@stevefaulkner
Copy link
Contributor

Currently the HTML standard does not provide any advice in regards to the outline algorithm not being implemented, This has lead to some developers believing that the outline algorithm has an effect in browsers and assitive technology which it does not. THis can lead to developers using markup patterns that don't convey document structure. Suggest adding a warning, for example this is the warning in the W3C HTML spec

There are currently no known 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. Therefore the outline algorithm cannot be relied upon to convey document structure to users. Authors are advised to use heading rank (h1-h6) to convey document structure.

@domenic
Copy link
Member

domenic commented Sep 1, 2015

I kind of feel we should either leave as-is or just remove the outline algorithm altogether...

@gsnedders
Copy link
Member

An outline algorithm probably makes sense to keep around, given outlining is used in some sense in most screenreaders, as far as I'm aware. That said, may well make sense to drop the current one (and the semantics that go along with it...).

@Hixie
Copy link
Member

Hixie commented Sep 1, 2015

The algorithm just describes the semantics of the elements. If the tools aren't supporting the semantics, they're buggy and should be fixed. Changing the semantics would be a pretty drastic change to the spec, especially as people have been using these elements for years.

We can't just remove the outline algorithm, either. We need something to define the semantics of these elements. Even if we were to say that tools should ignore the semantics and just use the h1-h6 elements in the naive flat way (ignoring tree structure, as if we were back in the 90s), you'd still need the algorithm to be able to define the authoring conformance criteria (so that conforming documents only used h1-h6 in a manner consistent with the semantics). That's pretty silly though. The right solution is just to fix the tools.

@domenic
Copy link
Member

domenic commented Sep 1, 2015

@Hixie, when you say "tools," do you include user agents and their accessibility bindings?

At some point we cannot claim that user agents are broken. They are instead rejecting our change request. https://www.w3.org/Bugs/Public/show_bug.cgi?id=25003 contains comments from both Firefox and Chrome accessibility developers explicitly rejecting the idea of implementing the outline algorithm in their accessibility bindings. It also outlines the history of JAWS removing their support. Although their reasoning may be wrong, it doesn't seem fruitful at this point to challenge them.

I think it would be better for the semantics in the spec to match the semantics already exposed through accessibility bindings in implementations. People have been using these elements for years, but either (a) they have been using them in a way supported by user agents, which contradicts the spec; or (b) they have been using them in the way specified, which means their content is broken in current user agents (for users which count on those accessibility bindings). Neither of these seem good.

@domenic
Copy link
Member

domenic commented Sep 1, 2015

My last message wasn't entirely clear. I agree with @gsnedders and phrasing this as "removing the outline algorithm" was incorrect. Rather, we should update the outline algorithm to reflect implementations. In some ways this is a "revert" of the "change request" that proposed a sectioning-based outline algorithm; it differs only in degree from a4313d3, which was a revert of the change request 78f1994 to simplify selector case-sensitivity matching rules.

@Hixie
Copy link
Member

Hixie commented Sep 1, 2015

If we want to require that authors use h1-h6 instead of being able to do the XHTML-style <h1>-everywhere, then we need two outline algorithms: one that describes how user agents are to act, and one that describes the restrictions that authors have to follow in order for their h1-h6 headers to not contradict the sectioning semantics. (And maybe a third one, that describes how an authoring tool could convert from the saner one-heading-element style to the legacy h1-h6 style for UAs.)

But IMHO that's a poor place to be in. I don't really see why accessibility tools couldn't expose the real semantics here. It doesn't require a complex algorithm (you only need "previous", "next", and "up" to be able to navigate the tree, and walking around the tree that way is pretty straight-forward as far as I can tell). Accessibility tools are notoriously slow about catching up to implementing new features, this algorithm is not that old by their time scales. (I mean, they still haven't implemented stuff from the 90s correctly, even though there's obvious usability gains to be had by doing so.)

@domenic
Copy link
Member

domenic commented Sep 1, 2015

Can you explain why you need two outline algorithms? Authors would use the sectioning elements the same way they are exposed in accessibility technologies: just like divs.

@gsnedders
Copy link
Member

That ignores that fact that both Firefox and Chrome have explicitly refused to support it, and that algorithm is hella old by their standards (it's what, seven years old now?). I think the battle's lost at this point, sadly. I don't have strong opinions on what we should do, but the spec as it stands now is fiction and will remain fiction. Your argument that they should implement it because they're buggy per spec is trying to oblige behaviour by spec, and we know that's a fallacy when everyone is refusing to implement it.

@Hixie
Copy link
Member

Hixie commented Sep 1, 2015

@domenic Consider the following:

<h1>A</h1>
<section>
 <p>aaa
 <h1>B</h1>
 <p>bbb
</section>
<p>bbb

What are the sections in that document? If the <section> element doesn't align with that answer, then what are the semantics of <section>?

@gsnedders I don't think the battle's been fought. Any time I've seen people say they don't want to do it (e.g. in the bug above) the reasons they've given don't actually fit the facts (e.g. I've heard complaints that it would be prohibitively expensive, but that's only if you recomputed the entire tree, which as far as I can tell is unnecessary). But in any case in my comment above I gave two paths: one that I think is the right path, and another path for the case where we give up on making accessibility tools give good results. We could go down the second path, certainly. It's not just removing text from the spec, though, as I described above.

@domenic
Copy link
Member

domenic commented Sep 1, 2015

My understanding is that as implemented section has no semantics, just like div. I am not sure that implementations have a concept of "sections of a document" as much as they have an accessibility tree plus an outline tree which consists of links into nodes in the accessibility tree. But I am not sure on that; presumably @stevefaulkner has done the research there.

@Hixie
Copy link
Member

Hixie commented Sep 1, 2015

I'm not sure what it would mean for <section> to have "implemented" semantics. Semantics by their very nature are about the meaning of the elements, which is something for humans. It's how you get maintainable documents that different people who have never met can approach and understand.

@annevk
Copy link
Member

annevk commented Sep 2, 2015

Yeah, I guess either you keep the current outline algorithm, or you obsolete <section>/<h1> & <hgroup>?

@domenic
Copy link
Member

domenic commented Sep 2, 2015

Is the idea to keep the current outline algorithm but the output of the algorithm is only something that exists in authors' minds? If so I'd be fine moving it to some section with a preface like "If you want to assemble a mental outline, that does not match that displayed by screen readers, follow the following algorithm: ... NOTE: authors are advised not to author documents that produce outlines catering to this algorithm, but instead author documents catering to accessibility tools, which follow the algorithm in $cross-link-here, according to the priority of constituencies (users over authors)"

But that seems kind of pointless.

@annevk
Copy link
Member

annevk commented Sep 2, 2015

It all depends on whether user agents will implement these elements. If they don't, we should scrap them and the outline algorithm can be simplified to what is supported. If they do, or we expect them to within the next five years or so, it might be worth waiting a little longer.

@domenic
Copy link
Member

domenic commented Sep 2, 2015

Hmm, to be clear, what does "implement these elements" mean? They implement them as HTMLElement instead of HTMLUnknownElement, but they do not implement the accessibility mapping implied by the current outline algorithm, and as discussed up-thread at least a couple have publicly stated they are not planning to do so. (Are those the only two relevant requirements on implementations, or am I missing some?)

@annevk
Copy link
Member

annevk commented Sep 2, 2015

There are some styling and parser requirements too. And there are some speculative CSS features that would build upon the outline algorithm. We would have to check. But styling and outline would be the most important aspects.

@domenic
Copy link
Member

domenic commented Sep 2, 2015

Ah right, thanks for pointing those out.

Also, when you say "obsolete <section> etc.", we could give them "the <main> treatment" instead of "the <dir> treatment". I'm not sure there's any practical difference besides what section they go in, but it's worth pointing out.

@annevk
Copy link
Member

annevk commented Sep 2, 2015

Perhaps it would end up like main since it still has some default ARIA semantics that might be useful. Not sure. I haven't studied this in detail, but I do agree with @Hixie that the fix isn't as simple as adding a note to the outline algorithm or dropping it altogether.

@stevefaulkner
Copy link
Contributor Author

@domenic section is mapped to a region role in browsers, section is not exposed in the aural UI unless it has an accessible name.

There are 2 document scope navigation methods implemented across AT:

  • landmark navigation of header/footer/nav/main/form/section(only if accessible name present) elements.
  • heading navigation via h1-h6 elements.

Implementation of accessibility layer semantics for html element landmarks and h1-h6 is complete in chrome, firefox, Safari

Data on the utilisation of each can be found in webaim screen reader surveys

@stevefaulkner
Copy link
Contributor Author

The reason for the warning is so authors are not mislead into thinking that use of sectioning elements actually does anything for users who consume heading semantics to make sense of and navigate document content.

@annevk annevk added removal/deprecation Removing or deprecating a feature normative change labels Sep 2, 2015
@JohnnyWalkerDigital
Copy link

Adding a similar warning makes most sense, IMO, at least until the Outline Algorithm starts being more adopted. Many authors most likely think that (correctly) placing a <h1> element both inside and outside an <article> will be understood by those using assistive technology.

@alastc
Copy link

alastc commented Sep 2, 2015

I do quite a bit of accessibility training and regularly come across developers who think they should just use H1s (they don't always know about sectioning either).
I agree that it would be more elegant to use sectioning, but unless someone is going to campaign for UAs to implement it, then the spec should align with the reality.

@JohnnyWalkerDigital
Copy link

I would love to help campaign UAs to use it. It would make everyone's lives (developers and users) if they did.

@nhoizey
Copy link

nhoizey commented Sep 14, 2015

Has a web developer, I also would be really happy if the outline worked as intended with sectioning elements, at last.

Working with only h1 is much easier when you want to include (server-side or with Ajax) the same HTML fragment in several places of your pages, with appropriate hierarchy.

@domenic
Copy link
Member

domenic commented Dec 27, 2015

Some Twitter discussion reminded me about this neglected issue. I wanted to summarize the action items here:

  • We are not interested in simply adding a warning like the W3C fork does. "Warning: ignore the following. Here is a bunch of normative text about outlines..." We have higher standards for our specs than that kind of self-contradictory patchwork. Instead, we should actually update the spec to reflect reality.
  • The outline algorithm should be rewritten or replaced to reflect @stevefaulkner's description of implemented AT mechanisms in Suggest adding a warning about outline algorithm #83 (comment). Namely, it should primarily inform about landmark navigation and heading navigation. (Or maybe only the latter of these?)
    • Maybe these are already specced somewhere we should be referring to?
    • It should reflected implemented heading level semantics as announced by screen-readers, not the ones derived from nesting level.
    • We should do some serious hands-on testing with a11y tools (or we could continue to lean on a11y experts to do so for us, but that is not very good) to figure out how to best phrase these things. For example it's not entirely clear to me whether headings are presented as a nested list, or as a flat list with heading level numbers. We should encourage authors to have a mental model that matches what's implemented.
  • With these in mind, we should carefully change the authoring guidance and semantics for related elements (article, section, nav, aside, h1-h6, hgroup, header, footer). In general I think we can keep the "spirit" of existing semantics, e.g. nothing needs to change about what a section "is". But the advice about how to use it relative to headings, or how to use markup patterns that give it an accessible name, and how that impacts the document outline, will need to be carefully reviewed.
    • One exception may be hgroup. But maybe we should leave it as-is for the first pass.

Potential future work:

  • Consider the fate of hgroup further. Does it impact a11y processing anywhere? Should it be repurposed, or obsoleted, or...? Does it have semantics independent of its a11y processing, like non-accessible-name'd sections could be said to?
  • Propose a <h> element that actually gets treated like people want <h1> to be treated. (If we can get the a11y teams of various browsers to implement, then we can merge it into the spec. But let's not add something until we have experimental implementations and commitments.)

All that said, this isn't that high on my priority list, or my employer's. If someone does have the time to devote to this, I'd be happy to help review patches.

@stevefaulkner
Copy link
Contributor Author

"Warning: ignore the following. Here is a bunch of normative text about
outlines..."

While there is normative requirement for UAs to implement the outline
algorithm, many web developers have been lead to believe it is implemented,
the whatwg spec continues to perpetrate the myth. However you choose to
modify the spec to bring it closer to reality will be an improvement.

@sideshowbarker
Copy link
Contributor

I agree with much of the comments fro @Hixie and @annevk in this thread, especially the comment from @Hixie that “We can't just remove the outline algorithm” without needing to make other changes as a consequence, and the question “Yeah, I guess either you keep the current outline algorithm, or you obsolete <section>/<h1> & <hgroup>?”.

But all that said, I have over the years learned a huge amount of things from @stevefaulkner around the problems that some things in the spec cause for AT users, and I think others should read his comments here very carefully. We’re here to solve existing real problems for real users—not to hypothetically solve problems for some of them if we could somehow just get browser implementors to see things our way and implement what we’ve specced, or get AT vendors to fix their horribly broken/buggy tools.

In that spirit I agree very strongly with the implicit goals in the latest comment that @domenic posted and with his concrete suggestions there about how to get progress here. See the related IRC discussion.

Some ways I could help with this might be:

  • Experimentally implementing a Show Outline feature in the Nu HTML Checker that shows a “Here’s what the outline of your document looks like to AT users in practice” view—in parallel to or even in place of the current Show Outline view the checker provides, which shows what the outline looks like according to the outline algorithm in the HTML spec.
  • Adding further experimental warnings to help authors avoid using H1-H6 headings in any way bad for AT users; basically that amounts to uses of H1-H6 in ways different from how we told authors they should use them before we added section and article and allowed nested H1s to be used within them, and allowed uses of H2-H6 that break the existing simple hierarchical use of them.

As far as the second item above, I have already implemented experimental support in the checker for reporting (mis)use of H1 as anything other than a top-level head, and that’s been deployed in the checker for quite a long time now, and I think it’s been helping. But I’d like to help more if I can. I want to make the HTML checker be a tool that helps developers avoid making uninformed authoring choices that are going to cause problems in practice for real users.

@rehierl
Copy link

rehierl commented Apr 26, 2018

The main misconception seems to be that sectioning nodes (headings, section elements, etc.) can be treated like any other element: As being isolated and independent from one another. That however is not the case:

  1. With each of those elements, an author associates content. That is, whether the spec has a definition for "it" or not, sections do exist as associated content/nodes.
  2. If sectioning node "A" has a section that contains sectioning node "B", then section "B" is related to section "A". That is, those elements are not independent, they never were!
  3. By now it should not be difficult to accept that mathematics is involved: What a section hierarchy is depends on the definition of subset and/or subsequence.

Sure, under certain conditions you will be consistent. The problem with that is however: You won't be able to guarantee consistency. That is, under different conditions, you will still be in conflict. And that will keep us from having a Semantic Web.

These kind of issues will keep nagging you over and over again. Simply because mathematics is the only language computers understand. And because mathematics is what it is, it is "reality" that needs to change. The only thing you can do to finally solve our problem is to figure out how to properly deal with it.

(But, you already made it pretty clear that there still is not enough interest for a proper solution.)

annevk added a commit that referenced this issue Mar 14, 2019
This makes a number of fairly big changes:

* Introduces a heading and heading level concept.
* Replaces the outline algorithm with a document headings concept.
* Requires document headings to not skip heading levels and start
  with heading level 1.
* Introduces a :heading pseudo-class selector.
* Introduces a :heading(level) functional pseudo-class selector.
* Does away with the section concept (except insofar it's needed to
  influence the heading level of h1/hgroup).
* Does away with sectioning roots.

Tests: ...

Fixes #83.
@Comandeer
Copy link

I've read the whole discussion around this issue and #3499 and I'm aware that many of the points I mention were already discussed. Yet I want to add my own perspective, which maybe someone will find useful.

TL;DR

  • keep the treatment of headings the way it is really implemented at the moment;
  • reconsider adding built-in custom h element with associated new heading level algorithm;
  • drop hgroup;
  • add section about marking up subheadings.

Issues

After reading proposal of fix in #3499, I noticed some potential issues.

Breakage of existing conforming usage of sectioning elements and headings

Such example was mentioned here before, but I'd like to return to it once more:

<body>
	<main>
		<article>
			<h1>Title of the page</h1>
		</article>
	</main>
</body>

According to the model defined in #3499, h1 in the above code will become a level 2 heading, therefore it won't longer be a heading of the whole page. It means that this change will effectively make now conforming markup incorrect – as it will produce undesirable effect.

I do not agree with the argumentation that authors shouldn't use the above markup as it is redundant. Even if we consider it redundant, it is still valid HTML. However I do not agree that it's redundant – and the new proposal seems to agree with me on that. If it was redundant, the result of calculating heading level in such structure would be the same as for the following one:

<body>
	<main>
		<h1>Title of the page</h1>
	</main>
</body>

Yet it is not the same, as the second one produces a level 1 heading. So there is a slight difference in semantics. As a spec states, main represents dominant contents of the document and article a self-contained composition that can be independently distributable or reusable. Joining these two elements means that dominant contents of the page are additionally self-contained and distributable.

What's more, such article is often followed by another section, e.g. comments in a blogpost:

<body>
	<main>
		<article>
			<h1>Title of the page</h1>
		</article>
		<section>
			<h2>Comments</h2>
		</section>
	</main>
</body>

In such case there are two independent sections inside main and the title of the article is also the title of the page. However, according to the new model, the article's heading can't be the heading of the whole page at the same time.

I'm wondering how popular is the above pattern. I often find it on sites that use WordPress (including mine), as default themes use it. I'm afraid that the change in treating h1 in a special way will break a lot of sites.

Compatibility

The new heading level algorithm have sense only if there is enough support for it. However there will be a transition period between putting the algorithm into the specification and implementing it in browsers. And during that period websites need polyfiils not to appear broken in unsupported environments.

However gaining support can take years, as statistics show that IE is still very popular among AT users. Browsers are only one side of the problem, but it is rather easy to imagine that users use also outdated versions of screen readers. In such cases polyfills will be needed for years or even longer. And we should also consider the possibility that some browsers won't implement the algorithm, which happened already with several HTML features, e.g. dialog element.

Yet there is even a bigger compatibility issue. As I mentioned in the previous point, many sites that have now correct heading levels will become incorrect when the new algorithm is introduced. And that would require action from webmasters to update their sites to the new rules. However many sites can be not actively maintained, still containing much valuable content. They will become less accessible to the users due to the change in the specification. It's very similar situation to Smooshgate, when the normative change would break the web (although we can argue if the case here would really break it or "just" make it less accessible).

Breakage of expectations

For years numbers in hx elements meant heading's level. It's true even in the current version of specification, which defines outline algorithm:

These elements have a rank given by the number in their name.

The new proposal breaks this expectation and ties heading's level directly with the new algorithm.

There are tons of tutorials that explain headings outline using their rank, e.g. MDN's one. Changing it would make most of these materials obsolete in the best scenario and harmful to the accessibility in the worst one. Webdevs creating their sites using advices from such tutorials would create websites that are suboptimal for some groups of users.

What's even more confusing is the fact that the special treatment is reserved only to the one of the headings – the top-level one. Due to that there can be a lot of incorrect websites due to assumption that all headings participate in the new algorithm.

How I perceive headings

Before I describe my vision of ideal headings algorithm, I'd like to quickly describe how I personally use headings.

Some time ago I developed (discovered?) something I call Headings First Principle (HFP). The rule is simple: divide the page into sections using headings, e.g.

<body>
	<h1>Title of the article</h1>
        <h2>Subsection 1</h2>
        <h2>Subsection 2</h2>
        	<h3>Subsubsection 2.1</h3>
        <h2>Subsection 3</h2>
</body>

After dividing page in such way, I add sectioning elements to make the division explicit:

<body>
	<main>
		<article>
			<h1>Title of the article</h1>

			<section>
				<h2>Subsection 1</h2>
			</section>

			<section>
				<h2>Subsection 2</h2>
				
				<section>
					<h3>Subsubsection 2.1</h3>
				</section>
			</section>

			<section>
				<h2>Subsection 3</h2>
			</section>
		</article>
	</main>
</body>

This way I'm sure that all my headings and sections point to the same portions of the site.

It is clear that in the above model sectioning content is somehow redundant and headings alone can be used to structure the site. However similar arguments were raised against main element. In my opinion sectioning content makes the division of page more explicit – or, to say it in HTML terms, more semantic.

All of my proposals are based on the above understanding of headings and sections.

Keep the current status quo

In my opinion headings definition should be kept as is, with the association between number in heading name and its heading level. This solution de facto fixes all of the above mentioned issues. The only downside of this approach is the fact that it won't fix the pages that use outline algorithm. However I'm not sure if the usage of this algorithm is so big that would overweight the breakage of mentioned WordPress sites.

There is also issue with default styling of headings inside sections, due to rendering guidelines, however I do not find it critical. First of all, whole rendering section is not, strictly speaking, normative:

User agents are not required to present HTML documents in any particular way. However, this section provides a set of suggestions for rendering HTML documents that, if followed, are likely to lead to a user experience that closely resembles the experience intended by the documents' authors. So as to avoid confusion regarding the normativity of this section, "must" has not been used.

Secondly, thanks to cascade order, this styling can be overridden with any heading styling, making it basically a non-issue (as only unstyled pages will be hit by the UA's rules).

Reconsider adding h element

In many cases webdevelopers know exactly which level of heading is appropriate for a given part of the content and in such cases h1-h6 elements are enough. However there are also cases, in which we do not know the level of heading, e.g. external widgets rendered inside Shadow DOM or content generated by user in CMS/WYSIWYG.

In CKEditor 5 we decided to default to h2 as the top-level heading. This solution is based on assumption that CKEditor 5 won't be used to edit the whole page, but only the content of the article (disccusion). Yet such solution is far from being ideal. Introducing h element would give us the certainty that all headings will have correct heading levels (assuming that the editor will output sections).

That's why I think that the best solution to this issue would be adding h element to the specification. I do not feel that such proposal is out of scope of this issue, as the new element would be directly associated with the new algorithm and it will be the only – and explicit – way to use it. It means that it would play the role of opt-in mechanism for the new feature, which would guard Web from the breaking connected with changing the meaning of currently conforming markup.

I also think that the recent changes proposed by Chrome – #4696 and #4697 – will make the introduction of the h element much easier. It can be made a built-in custom element, importable via API proposed for Layered APIs/JS standard library and therefore – a good candidate for e.g. origin trail in Chrome. That would give the needed feedback for further examination if it really fixes the issue and if it can be safely moved to the HTML specification. Such importable element will be also much easier to polyfill.

If the h element is introduced, then the whole heading level algorithm will be connected only with it, making the proposed changes "local", instead of current "global" approach. And making them local limits the possibility of breakage of anything nearly to zero.

Drop hgroup

I totally agree with #3499 (comment). Without outline algorithm, hgroup does not make much sense. What's more, it seems to bring even more confusion about how the new (and old) algorithm works. Dropping it seems the most reasonable way to handle it.

Add section about subheadings

Currently there is no sensible way to mark up subheadings according to WHATWG standard. The official advice is to use hgroup:

The element is used to group a set of h1h6 elements when the heading has multiple levels, such as subheadings, alternative titles, or taglines.

However hgroup was never implemented in interoperable way and it's basically styled div in most (if not all) implementations. It is also – as was mentioned before – endangered by removal from the specification. Therefore there is a need to define a new way of marking up subheadings. I propose adopting appropriate section from HTML 5.2. This way the practice that was already common on the web will be codified by the current HTML specification.

And I think that would be all for my short thoughts on this issue!

@zcorpan
Copy link
Member

zcorpan commented Sep 16, 2019

At TPAC HTML/ARIA joint meeting, it's suggested that we should discuss this issue with the APA WG.

annevk added a commit that referenced this issue Oct 11, 2019
This makes a number of fairly big changes:

* Introduces a heading and heading level concept.
* Replaces the outline algorithm with a document headings concept.
* Requires document headings to not skip heading levels and start
  with heading level 1.
* Introduces a :heading pseudo-class selector.
* Introduces a :heading(level) functional pseudo-class selector.
* Does away with the section concept (except insofar it's needed to
  influence the heading level of h1/hgroup).
* Does away with sectioning roots.

Tests: ...

Fixes #83.
@LJWatson
Copy link

Unless I've missed something, it does not look like the outline algorithm is any closer to resolution or replacement than it was two years ago.

Until such time as this changes, please can the algorithm be removed for lack of implementation, or the warning be added?

@rjgotten
Copy link

Another outside perspective on the previously mentioned example:

<body>
  <main>
    <article>
      <h1>Title of the page</h1>
    </article>
    <section>
      <h2>Comments</h2>
    </section>
  </main>
</body>

In such case there are two independent sections inside main and the title of the article is also the title of the page. However, according to the new model, the article's heading can't be the heading of the whole page at the same time.

Technically you could resolve that with some nastiness using a conceptual headedby to forcibly lift the heading element out of the article and apply it to the main. E.g.

<body>
  <main headedby="article_heading">
    <article>
      <h1 id="article_heading">Title of the page</h1>
    </article>
    <section>
      <h2>Comments</h2>
    </section>
  </main>
</body>

Technically the article contents still can be distributed stand-alone. Everything there remains semantically the same. The ID is simply inert in that case. (... Or maybe it actually would still used by other markup inside the article. That's also possible, of course.)

It's not like such a thing would be the only case where explicit attribute markup could perform shifting in things like the structure of the accessibility tree. (E.g. aria-owns creates some precedent.)

@LJWatson
Copy link

LJWatson commented Apr 5, 2022

@annevk and @domenic, I could use your help to resolve an objection raised against publishing the Jan 2021 HTML Review Draft as W3C CR.

I understand that finding and implementing a solution for the problem that the outline algorithm was intended to solve is not a small thing, despite welcome efforts made by @annevk on a polyfil/prototype.

In the interests of taking a small step in a good direction, would you be willing to accept a PR that added a warning to the HTML Standard, to let readers know that the outline algorithm presently has no implementations?

Thanks.

@domenic
Copy link
Member

domenic commented Apr 5, 2022

No, I don't think that's a good solution. First of all, it's not correct; the outline algorithm has plenty of implementations in various tools. The problem is about the mismatch with accessibility tech, not about lack of implementations. Second of all, an internally-incoherent document is not desirable, as stated back in 2015.

@patrickhlauke
Copy link
Member

The problem is about the mismatch with accessibility tech, not about lack of implementations.

Mistmatch of AT, or mismatch of what user agents expose programmatically to those ATs? Implemented, but broken at the UA end?

@aardrian
Copy link

aardrian commented Apr 5, 2022

First of all, it's not correct; the outline algorithm has plenty of implementations in various tools.

What tools?

In a quick test, web browsers still don't expose it.

Using the third block of sample code from 4.3.11 Headings and sections, I made a sample to quickly test: https://codepen.io/aardrian/pen/PoEQjRa

The "debug" version with no Codepen wrappers: https://cdpn.io/pen/debug/PoEQjRa

That WHATWG example nests <h1>s in <section>s and asserts "This third example is also semantically identical" to the previous example using <h2>s in <section>s.

When I visit that in Edge, Chrome, Firefox, or Safari and explore the accessibility tree and document structure, none of those browsers exposes any of the <section> > <h1> constructs as anything other than a level 1 heading.

Sure, visually the text is smaller when the <h1> is a child of the <section>, but that is not the same as programmatic exposure to any accessibility APIs.

The problem is about the mismatch with accessibility tech, not about lack of implementations.

In this case, the lack of implementation in Edge, Chrome, Firefox, and Safari precludes any accessibility tech.

So what plenty of various tools, specifically, implement the outline algorithm?

Then we can explore if or how there is a mismatch with assistive technologies.

@LJWatson
Copy link

LJWatson commented Apr 7, 2022

Thank you @domenic

the outline algorithm has plenty of implementations in various tools.

It does have implementations in tools other than browser engines, yes. As I understand it however, the expectation here is that it is browser engine implementations that matter, hence the position taken on the decision not to accept changes to the ruby family of elements.

If implementation in tools other than browser engines meets the WHATWG benchmark, it would help to have that clearly stated.

The problem is about the mismatch with accessibility tech, not about lack of implementations.

The problem is that although there is a certain amount of cosmetic support in browser UA stylesheets, there is no browser implementation that exposes the semantics of the revised outline.

If the revised semantics are not exposed to the accessibility API, assistive tech cannot query the information without scraping the DOM, and I trust you're not suggesting we return to those days again.

If you consider changes to the UA stylesheet to be an implementation that is fit for purpose based on the intent of the outline algorithm, it would help to have that clearly stated.

Otherwise, it would help to know if any implementors are intending to put time and effort into implementing the outline algorithm in a way that supports its semantics in ways that assistive tech can utilise, and to do so within an established and reasonable timeframe.

Thank you.

@domenic
Copy link
Member

domenic commented Apr 7, 2022

To be clear, we should 100% revise the spec's outline to match accessibility technology's view of the outline. That has been the proposed plan since 2015, and has only been lacking people to do the work. That's the best path forward to resolve the issue.

I could go into depths on how conformance classes work, what the spec currently does and does not mandate with regard to browsers, authors, ATs, etc., and how that intersects with the WHATWG working mode requirements. But none of that really matters, because the path forward is for someone to edit the spec in the way that was outlined 7 years ago.

@sideshowbarker
Copy link
Contributor

the path forward is for someone to edit the spec in the way that was outlined 7 years ago

Isn’t that what #3499 is?

@domenic
Copy link
Member

domenic commented Apr 12, 2022

Isn’t that what #3499 is?

Unfortunately no.

Throughout the history of this issue, there have been essentially three outline algorithms under consideration:

So #3499 was an attempt to introduce a third alternative outline algorithm, along with a couple of new CSS features. It was not an attempt to align HTML and HTML-AAM.

My understanding is that #3499 is mostly abandoned, per https://groups.google.com/g/mozilla.dev.platform/c/SdnMKYwWxzU/m/U-v_b8c2BwAJ. @jakearchibald still seems to think it was somewhat salvageable, per the discussions in https://bugzilla.mozilla.org/show_bug.cgi?id=1590366, but I think the implementation appetite has waned, and we should go back to the 2015 plan.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accessibility Affects accessibility document conformance normative change removal/deprecation Removing or deprecating a feature
Development

Successfully merging a pull request may close this issue.