W3C home > Mailing lists > Public > whatwg@whatwg.org > April 2011

[whatwg] <summary> and <details> elements' specification

From: Jukka K. Korpela <jkorpela@cs.tut.fi>
Date: Tue, 12 Apr 2011 08:14:59 +0300
Message-ID: <9EA7F4E9AAAA49A9BD020B51637172D8@JukanPC>
Aryeh Gregor wrote:

> On Mon, Apr 11, 2011 at 11:58 AM, Jukka K. Korpela
> <jkorpela at cs.tut.fi> wrote:
>> Not necessarily. The for="..." attribute could be made optional, so
>> that the default association is to associate the <summary> attribute
>> with the next sibling element.
>> (I wonder why the association between <label> elements and input
>> fields has not been defined this way. It's too late now, but things
>> aren't too late for <details>.)
> If <label> has no "for" attribute, it labels its first labelable
> descendant.

Yes, as in HTML 4, but that's a different issue, related to descendants, not 
siblings. It requires that the input field be written inside a <label> 
element, which is illogical: the field is not part of its label.

Just as <label> could have been defined to be paired with (by default) its 
next sibling or, perhaps better, with the next input field, <summary> could 
be defined to be paired with its next sibling or, perhaps better, with the 
next <details> element, by default.

The element name "summary" is somewhat odd, and would appear even more odd 
if liberated from appearing inside <details>. This element is really meant 
to be a control for rendering vs. not rendering the contents of the 
<details> element, and its contents is just a label for the control. The 
example at
is accompanied with the note "In these examples, the summary really just 
summarises what the controls can change, and not the actual values, which is 
less than ideal." In reality, the example seems to correspond to _normal_ 
expected use of <details>, so the name "summary" is misleading. Perhaps 
<control> would be better, but as it's really a special kind of control 
only, how about <open>?

Yucca, http://www.cs.tut.fi/~jkorpela/ 
Received on Monday, 11 April 2011 22:14:59 UTC

This archive was generated by hypermail 2.3.1 : Monday, 13 April 2015 23:09:05 UTC