-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
replace current outline algorithm with one based on heading levels #7829
Conversation
The CSS UA styles partial implementation has been left as is https://html.spec.whatwg.org/multipage/rendering.html#sections-and-headings Why partial? refer to https://codepen.io/stevef/pen/ZEvmNPg
+1. Within the BBC we have to specifically inform devs that the spec does not represent what is implemented or planned to be implemented. For us at least, this change would have positive real world impact. |
This deeply saddens me, but it's the right thing to do. |
100% support for this. Maybe removing the outline algorithm makes it possible to find solutions for its use cases that can and will actually be implemented. |
As discussed in the thread you link to, we cannot remove the outline algorithm, as documents still have outlines. It instead needs to be based on heading levels, without sectioning complications. |
It's hard to see why it's better to keep an outline algorithm that's totally wrong with respect to the outline that documents actually have, than to simply remove it. There's certainly a case for adding back in an algorithm that describes the true outline accurately, but I don't see why the lack of the latter precludes the former. |
used modified text of @annevk PR headings and sections section whatwg#3499
general clean up and closer alignment with @annevk PR whatwg#3499
Great! Let us know when the conflicts with the main branch are resolved and then we can work on review. |
@domenic conflicts resolved |
after feedback from @mtrootyy whatwg#7829 (review)
Thanks. Could you also make sure the build passes? |
@sideshowbarker said he would take a look at that |
Thanks to @sideshowbarker build now passes |
83bc19d
to
e230b44
Compare
This error seems to have been introduced in f5def65, whatwg#7475 — so it’s unclear why CI didn’t catch it there.
Changing the spec source markup to use a p element in hgroup will need to wait until after the spec change lands.
e230b44
to
d7a8d50
Compare
Hello, I have a question. What is the difference between a rank and a level in a heading?
In HTML5 and HTML LS, they are called "rank". This time, the term "heading level" has been restored in the Headings and sections but "rank" is still used for heading elements. |
Hey @SaekiTominaga , IIRC rank is a concept to determine the level of the heading in a corresponding section. They are not the same thing. Suppose there is a document with three headings: <h1>h1</h1>
<h2>h2</h2>
<h2>h2</h2> This would create the following outline:
Now, if you change the first h2 to h3, what would the outline be? <h1>h1</h1>
<h3>h3</h3>
<h2>h2</h2> It might be surprising but this would yield the same outline (except the text) per the current algorithm.
In this case, the rank in the heading of the first subsection is three, but the level of the heading is two. |
In the current version of the spec, the `body` element belongs to no content category. The sectioning root concept has been removed entirely from the HTML spec in this PR: whatwg/html#7829
This PR is an attempt to bring the HTML spec in line with the decade+ old reality of non-implementation of the outline algorithm in User Agents and the continued presence of misleading content in the HTML spec relating to the outline algorithm.
Notes:
hgroup
definition to reflect what it actually does/isRelates to:
The CSS UA styles partial implementation has been left as is
https://html.spec.whatwg.org/multipage/rendering.html#sections-and-headings
Why partial? refer to https://codepen.io/stevef/pen/ZEvmNPg
/dom.html ( diff )
/form-elements.html ( diff )
/grouping-content.html ( diff )
/index.html ( diff )
/indices.html ( diff )
/infrastructure.html ( diff )
/interaction.html ( diff )
/interactive-elements.html ( diff )
/links.html ( diff )
/sections.html ( diff )
/tables.html ( diff )