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

Why can't <header> have <header> descendants? #273

Closed
travisleithead opened this issue Apr 27, 2016 · 15 comments
Closed

Why can't <header> have <header> descendants? #273

travisleithead opened this issue Apr 27, 2016 · 15 comments

Comments

@travisleithead
Copy link
Member

travisleithead commented Apr 27, 2016

Moved from https://www.w3.org/Bugs/Public/show_bug.cgi?id=24853

@stevefaulkner might be able to answer this. Original Bugzilla bug created by: n**a@gmail.com

http://w3c.github.io/html/single-page.html#the-header-element states:

Flow content, but with no header, footer, or main element descendants.

this is pointless! so i can have an <article> inside <header> but it can't have an <header> ? what is the point of this limitation?

the content model of <header> and <footer> should be free, imho

what's not clear is: why are sectioning elements allowed but headers inside them not?

you disallow them both or you allow them both

by the way, that's an use case that i often see:

<article>
    <header>
        <h1>Flexbox the definitive guide</h1>
        <aside>
            <header>
                <h1>About the author</h1>
                <p>A nice guy that hates everything and everyone</p>
                <p><a href="./wes/">Contact Him!</a></p>
            </header>
            <p>This article is brought to you by Wesley,
            skilled expert in "always-in-beta" applications
            that will never see the light</p>
        </aside>
    </header>
    <p>Actual article here Actual article here Actual article here
    Actual article here Actual article here Actual article
    here Actual article here</p>
</article>

in this case, the "about the author" is not part of the actual contents, it is part of the header of the article imho

hth

@ZoeBijl
Copy link

ZoeBijl commented Apr 27, 2016

That code example makes little sense to me. In the case of an “About the author” section, it should be either an aside to the article, the main, or in the footer of either of those. It does seem weird to me that an article within a header would be allowed.

@chaals
Copy link
Collaborator

chaals commented Apr 27, 2016

This duplicates #34 - please check the discussion there too.

@travisleithead
Copy link
Member Author

From @stevefaulkner in #34:

Suggest we add some advice to spec to effect that if there is a circumstance where an author thinks header or footer needs a nested footer or header then use a section element in place of the outer header/footer

@travisleithead
Copy link
Member Author

Comment #273 (comment) sounds reasonable to me.

@Wes0617
Copy link
Contributor

Wes0617 commented Apr 28, 2016

as header itself is neither sectioning content or sectioning root, it makes no sense to allow a header as a child of header.

It's not a child of an header, it's a child of a sectioning element that is within an header.

<section>
    <header>
        <section>
            <header></header>
        </section>
    </header>
</section>

I think sections in site footers are pretty common, and those section may have an header with a title, and that's just as common. If this restriction will be permanent, people will use <section/aside/figure> rather than <footer> for site footers, and it's not what HTML semantics aim for. Several times already I had to use aside/figure for those content blocks that were literally just site footers... your move...

OT @travisleithead can you please remove my email to be publicly visible in this issue's first post? desperately trying (and failing) to avoid spam :-P ty

@ZoeBijl
Copy link

ZoeBijl commented Apr 28, 2016

Nested header's feel like nested table's; if you need it, you're probably doing something wrong. Can you post a link to an example that would benefit from this? I'm really curious.

@travisleithead
Copy link
Member Author

email obfuscated -- sorry about that.

@chaals
Copy link
Collaborator

chaals commented May 3, 2016

WG discussion

@chaals
Copy link
Collaborator

chaals commented May 10, 2016

A use case to allow - you build a component with a header, and that goes into a header.

Check ARIA mapping implications - @stevefaulkner

@plehegar
Copy link
Member

[make sure that content model for header and footer can accept headers and footers]

@stevefaulkner
Copy link
Contributor

I note that my comments: #34 (comment) have had no response, I don't see any substantive arguments as to why we should be allowing this change.

@chaals
Copy link
Collaborator

chaals commented May 26, 2016

@stevefaulkner Because there are concrete use cases that seem legitimate, and because there is no obvious value to the restriction in the first place, notwithstanding @MichielBijl's point.

@stevefaulkner
Copy link
Contributor

@chaals looking at the provided example #273 (comment) this is not a reason to allow header to have headers as children but to allow headers to have header descendents when the header contains a sectioning element. I suggest that this makes sense but allowing headers not contained within sectioning descendents does not. So i suggest that:

<header>
<header>

or

<header>
<div>
<header> 

should remain non conforming, but

<header>
<section> _or other sectioning element_
<header>

should be allowed, which covers the provided use case

@chaals
Copy link
Collaborator

chaals commented May 26, 2016

I understand why the markup you suggest is better, but I am not sure what value we get out of requiring that.

@stevefaulkner
Copy link
Contributor

@chaals the value is that nesting of headers is discouraged and when used as a descendent of a sectioning element it is scoped as intended.

stevefaulkner added a commit to stevefaulkner/html-2 that referenced this issue May 27, 2016
adanilo pushed a commit that referenced this issue May 30, 2016
…#429)

* modified header content model +added example

refer to #273

* modified footer element content model to reflect header
travisleithead pushed a commit that referenced this issue Jun 1, 2016
* modified header content model +added example

refer to #273

* modified footer element content model to reflect header

* update article element to match reality better

refer to #110

* missed UA advice in last commit
arronei pushed a commit that referenced this issue Jun 1, 2016
…eality (#448)

* modified header content model +added example

refer to #273

* modified footer element content model to reflect header

* update article element to match reality better

refer to #110

* missed UA advice in last commit

* updated sectioning content to reflect reality

added information to each sectioning element about how AT and other user
agents may convey the semantics and provide navigation. Updated examples
to reflect of heading semantics implementation, updated warning about
the outline algorithm, reinforcing normatively that authors SHOULD use
headings of appropriate level in relation to how they are nested within
sectioning content.

* updated sections text to respond to various comments

refer to @chaals comments in #448
arronei pushed a commit to arronei/html that referenced this issue Apr 17, 2017
…w3c#429)

* modified header content model +added example

refer to w3c#273

* modified footer element content model to reflect header
arronei pushed a commit to arronei/html that referenced this issue Apr 17, 2017
* modified header content model +added example

refer to w3c#273

* modified footer element content model to reflect header

* update article element to match reality better

refer to w3c#110

* missed UA advice in last commit
arronei pushed a commit to arronei/html that referenced this issue Apr 17, 2017
…eality (w3c#448)

* modified header content model +added example

refer to w3c#273

* modified footer element content model to reflect header

* update article element to match reality better

refer to w3c#110

* missed UA advice in last commit

* updated sectioning content to reflect reality

added information to each sectioning element about how AT and other user
agents may convey the semantics and provide navigation. Updated examples
to reflect of heading semantics implementation, updated warning about
the outline algorithm, reinforcing normatively that authors SHOULD use
headings of appropriate level in relation to how they are nested within
sectioning content.

* updated sections text to respond to various comments

refer to @chaals comments in w3c#448
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants