Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

example in 4.3.6 doesn’t make sense #584

Closed
ghost opened this issue Sep 11, 2016 · 9 comments
Closed

example in 4.3.6 doesn’t make sense #584

ghost opened this issue Sep 11, 2016 · 9 comments
Assignees

Comments

@ghost
Copy link

ghost commented Sep 11, 2016

Currently, an example in the h1h6 section doesn’t make sense. It shows how two different code fragments mean the same thing, and mentions how you can mix both styles, yet doesn’t say how. The thing is: the second code fragment it mentions is supposed to be the mixed style. Compare the WHATWG’s version (makes sense) to the W3C’s version (doesn’t make sense).

Here is how the second code fragment is currently:

<body>
  <h1>Let’s call it a draw(ing surface)</h1>
  <section>
    <h2>Diving in</h2>
  </section>
  <section>
    <h2>Simple shapes</h2>
  </section>
  <section>
    <h2>Canvas coordinates</h2>
    <section>
      <h3>Canvas coordinates diagram</h3>
    </section>
  </section>
  <section>
    <h2>Paths</h2>
  </section>
</body>

Here is how it’s supposed to be:

<body>
  <h1>Let’s call it a draw(ing surface)</h1>
  <section>
    <h1>Diving in</h1>
  </section>
  <section>
    <h1>Simple shapes</h1>
  </section>
  <section>
    <h1>Canvas coordinates</h1>
    <section>
      <h1>Canvas coordinates diagram</h1>
    </section>
  </section>
  <section>
    <h1>Paths</h1>
  </section>
</body>
@stevefaulkner stevefaulkner self-assigned this Sep 11, 2016
@stevefaulkner
Copy link
Contributor

@Zambonifofex The 2 styles are implicit sectioning via heading elements versus explicit sectioning via section elements.

I think, the bit that doesn't make sense is

The two styles can be combined, for compatibility with legacy tools while still future-proofing for when that compatibility is no longer needed.

I will remove this.

The example you quoted from the whatwg spec was intentionally removed, it does not make practical sense, as its semantics are not supported in user agents and we don't want to continue promoting a coding method that results in a loss of meaning for users.

@stevefaulkner
Copy link
Contributor

relates to #33 and #331

@ghost
Copy link
Author

ghost commented Sep 11, 2016

Sorry, but while you (the W3C) don’t recommend using nested <section><h1>s to indicate different heading levels, is this style still conforming and semantical according to the spec, even if browsers don’t implement it? Because if it’s not conforming, it’s important to note that section 10.3.7 still mentions styling elements as if it was.

Either way, this was my preferred style for marking up sections with headings. I really think it’s a much more dynamic and beautiful approach to marking up headings; I was really delighted to find this style in the WHATWG’s spec, and I’m really sad to see it out of yours 😢 😭.

@chaals
Copy link
Collaborator

chaals commented Sep 11, 2016

Yes it is true that having a mechanism to nest headings without having to declare the level in advance would be far more useful. Sadly, no browser actually implemented that.

Instead, they did implement the stylesheet in 10.3.7 to which you refer, which makes it look like they did something useful - and because that's what they implement, that is what is in the spec.

Unfortunately, the underlying semantics conflict with the visual semantics - which is why it is not valid for authors to use this approach.

@ghost
Copy link
Author

ghost commented Sep 11, 2016

Sorry, but is it, then, conforming according to the spec (even if not encouraged by the W3C, and not implemented in browsers) to use only h1s and sections to indicate different heading level? Because if it’s not, I really think section 10.3.7 should not include that stylesheet. If it isn’t conforming, the stylesheet isn’t just misleading, but it also affects the “mixing of both styles”.

<body>
    <h1>Foo Bar</h1> <!-- Looks like an h1 (OK) -->
    <section>
        <h2>Foo Bar</h2> <!-- Looks like an h3 -->
        <section>
            <h3>Foo Bar</h3> <!-- Looks like an h5 -->
        </section>
    </section>
</body>

@stevefaulkner
Copy link
Contributor

Sorry, but is it, then, conforming according to the spec (even if not encouraged by the W3C, and not implemented in browsers) to use only h1s and sections to indicate different heading level?

There is a should conformance requirement in W3C HTML:

Sections may contain headings of a rank equal to their section nesting level. Authors should use headings of the appropriate rank for the section’s nesting level.
https://w3c.github.io/html/sections.html#headings-and-sections

The HTML validator emits a warning about use of incorrectly nested headings.

You example code appears to suggest that headings with a rank equal to their nesting level results in an adverse styling effect:
<h2>Foo Bar</h2> <!-- Looks like an h3 -->

Which it does not. in this example the h2's and h3's are styled the same whether in or out of a section.

I really think section 10.3.7 should not include that stylesheet.

The rendering section of the spec includes quite a few style declarations for non conforming elements and attributes, for example

blink { text-decoration: blink; }

Even when features become obsolete or non conforming it still makes sense to include the rules for their rendering.

@ghost
Copy link
Author

ghost commented Sep 11, 2016

@stevefaulkner

You are correct. It seems browsers (at least Chrome) only style h1s differently based on which section level they are. Sorry for the derpyness.

Sorry for asking here, but I’ve been reading the links you posted, and eventually I got to this thread. It’s very sad to me that it has lost traction two years ago. What do you think I should do to get that feature a little more attention again?

@stevefaulkner
Copy link
Contributor

Sorry for the derpyness.

no problem

What do you think I should do to get that feature a little more attention again?

I am unsure how to proceed, the browser vendors have show little interest in implementing :-(

@chaals
Copy link
Collaborator

chaals commented Oct 19, 2016

Seems we can close this...

@chaals chaals closed this as completed Oct 19, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants