Re: Validity constraints on <section>

I have made a change to the definition of section:

added to definition:

"Each section should include a heading (h1-h6 element) which briefly
describes the content of the section."

http://www.w3.org/html/wg/drafts/html/master/sections.html#the-section-element

https://github.com/w3c/html/commit/423ee2376ce2e0ab6ee7d9c9631cf07c77da57de

bug: https://www.w3.org/Bugs/Public/show_bug.cgi?id=23490

review and feedback at your leisure.


--

Regards

SteveF
HTML 5.1 <http://www.w3.org/html/wg/drafts/html/master/>


On 22 March 2013 04:35, Leif Halvard Silli <xn--mlform-iua@xn--mlform-iua.no
> wrote:

> Silvia Pfeiffer, Fri, 22 Mar 2013 07:36:17 +1100:
> > On 22 Mar 2013 01:40, "Robin Berjon" wrote:
> >> On 21/03/2013 15:15 , Léonie Watson wrote:
>
> >>> (screen readers use the region role mapping to report section
> >>> elements). That's 216 announcements on a single page.
>
> >> Yes, that's exactly the problem I was thinking of.
> >>
> >> So far the only negative feedback we've received is that in
> >> books or papers
>
> > I've seen slide templates use <section> for every slide.
>
> In Silvia’s slides use case, the headingless section elements are *not*
> (right, Silvia?) children of any parent section element. (But perhaps
> they would be the children of an <article> element, which should be OK
> - or even promoted.) It should be simple to exempt section elements
> that are not themselves children of other section elements from the
> heading content constraint.
>
> However, the Lockerz.com web site also contains things like this:
>    <section>
>       <section> … </section>
>       <h1> … </h1>
>       …
>    </section>
> And thus, to simply say that a section must contain a h1-h6 element,
> would in fact 'bless' the above construct. Therefore Jirka had a point
> when he suggested that the first child should be a heading. However, it
> seems enough to demand that the heading content occurs *in front* of
> the section children.
>
> Based on the above, I would like to propose the constraints:
>
>   A) Section elements are constrained from having any section
>      children unless the section *itself* contains heading content
>      *in front of* the first child section element.
>   B) When a section element contains section children, then not only
>      the section element itself, but also all the section children
>      must contain heading content.
>   C) Section elements are not allowed to be empty. (Lockerz.com has
>      two empty section elements.
>
> I’m not 100% sure that the the B) constraint is necessary - may be A)
> is enough.
> --
> leif halvard silli

Received on Monday, 14 October 2013 16:22:57 UTC