-
Notifications
You must be signed in to change notification settings - Fork 547
Update outline algorithm #794
Comments
The example given is: <body>
<section>
<section>
<section>
<h4>Heading</h4>
</section>
</section>
</section>
</body> Which produces:
I'm not sure what to do about this, if anything. Flattening could be bad. Another case where we need some decent evidence. |
am unclear why flattening would be bad? In this case I would suggest ignore untitled sections in calculating the level of the heading. |
Also in the case where there is no heading scoped to body I suggest that a heading like this should actually be a level 1 heading (rather than level 2) if empty sections are ignored.
|
I think its a heading a level of 4
|
It probably makes sense to clarify here that flattening (effectively removing a redundant sectioning wrapper) should only take place if the wrapper does not contain anything except another sectioning element. So this:
would be treated as:
While this:
would not be flattened in any way. |
Btw, AT (or an outline algorithm that AT rely on) could probably be smart enough to be able to expose headingless sections by using a starting part of its text content instead of a heading. |
Ah, copy+paste error, sorry.
<h1>My article</h1>
<p>…</p>
<section>
<h1>Comments</h1>
<section class="comment">
<h1>Rethinking the whole thing</h1>
<p>Well actually…</p>
<section>
<h1>A specific problem:</h1>
<p>…</p>
</section>
</section>
<section class="comment">
<p>I agree, but there's one thing I don't like…</p>
<section>
<h1>Concerns about the shed colour</h1>
<p>…</p>
</section>
</section>
</section> In this case, would flattening break the aggregation of the comments? Specifically, is If so, I'm not sure if that's worse than presenting it as a section without a heading. |
As noted, I think we need evidence from reality, but in principle I'd like to discover that people actually get this right an overwhelming majority of the time, because that would simplify what we need to do, and make me feel good about people. Second preference is to find that close to nobody gets it right - while it might make me feel marginally less good about people, I would be even more confident that a change would have minimal legacy impact: most new stuff would be made by people doing what they always did, or by people who really work hard to follow the spec and are far more likely to continue to get it right, so we would only break a few things that shipped in the last few or next few years and are an historical anomaly. We get a problem if we discover that there's maybe a 2:1 ratio or something, since whatever we do then is going to break lots of stuff :( |
I'm not quite sure why a Sectioning content with no content but another Sectioning content would exist. <section> and <article> for example both state:
And in case we have more content nested in the Sectioning content – for example a nested <section> has <p> as sibling, I'll find it hard to assume that the heading of the <section> is also the heading of the <p>, which it would be if flattened. |
Flattening seems to me a fundamentally broken idea - both devs and AT have 'other ways to view' sections in flat, document order. It is impossibly hard, as I described in my post, to reason about many structures today in outline form because we mix this 'flat' concept which actually relies heavily on notions derived from the visual. I'd like to see 'document outline' be about only a new contextual |
I'm against flattening too. It just makes no sense |
here is a 2014 bug that discusses the issue: outline depth calculation should not include empty sections as a result hixie made some ineffectual changes to the whatwg spec. They are ineffectual as they encourage AT to do things, when its the browsers that need to do these things as they produce the accessibility tree that AT use. |
As I stated last week, I'm willing and now interested in creating a speculative polyfill to expose the document outline as written, but I’m still unclear about sectioning roots:
How would I one communicate headings within these section roots? How do I expose an |
@jonathantneal I had a quick look at how this http://s.codepen.io/stevef/debug/jygGVP/vWkRwnbZmamM is outputted by H50 (outliner script) and the https://validator.w3.org/nu/ outline view. neither includes headings in the fieldset in the outline. Which doesn't make a lot of sense in terms of in page structure/navigation. It may make sense if an outline was being constructed for a table of contents maybe... the sectioning root concept needs to be revisited me thinks. |
related #806 |
In case it's helpful, here's what the ARIA 1.1 spec says about a section element (which has a default or implied aria role of "region") without a heading:
The recommended Accessibility API mapping for region says:
So if AT are not including unlabelled sections, then perhaps the outline algorithm shouldn't either? It should be noted that other aria landmark roles (other than the generic "region") do not require a name (label/heading) in order to be included in landmark navigation by AT (however, if they have one, then it can be used when listing landmarks). |
There is a new proposal floating around, but we don't yet know if it will get uptake. I am going to postpone this to the next milestone, but I suspect we would do well to either switch to the new proposal, or just remove the old one and its proposed modifications for now, and note the various approaches as editorial. |
To replace the existing algorithm there is a new speculative proposal. There are several implementations floating around that implement what we have currently:
I suggest we retain the current algorithm for HTML 5.3, with a warning that it may significantly change in the future and a request for feedback, and that we continue to track implementation / usage. |
In which direction? Back to the roots (not always starting with |
@julmot It is hard to predict. There has been relatively low uptake of this algorithm, although not zero - @dominykas' implementation has been used in various projects, as well as the others mentioned above. But it is somewhat complex, and the idea of using h1 as a level-free heading that would be automatically nested appropriately seems not to have got uptake - in particular, among the browser engineers who build the linkage to the Accessibility APIs that screen readers rely on. The idea of heading whose level is determined "live" in context continues to be attractive. People do generate tables of contents all the time - it's a function of any Authoring Tool I have used in the last two decades. So the question is what will get uptake. And that is hard to predict in advance. |
Based upon @stevefaulkner in #774:
As written, the outline algorithm may incorrectly take into account sectioning elements without headings as effecting the outline depth of headings nested more deeply.
How should this operate, and (how) should the specification be updated?
I'm also willing to create a ponyfill for this if Steve would provide an explicit expectation.
The text was updated successfully, but these errors were encountered: