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

[whatwg] Editorial comment r/e summary element

From: Ian Hickson <ian@hixie.ch>
Date: Wed, 21 Sep 2011 06:38:38 +0000 (UTC)
Message-ID: <Pine.LNX.4.64.1109210635410.16440@ps20323.dreamhostps.com>
On Wed, 21 Sep 2011, Sergiusz Wolicki wrote:
> I am reading:
> "Contexts in which this element can be used: As the first child of a 
> details<http://www.whatwg.org/specs/web-apps/current-work/multipage/interactive-elements.html#the-details-element>element." 
> My feeling is that unconnected DOM elements in a script are not really 
> an HTML document but only its building blocks (bricks). Therefore, any 
> parent-child relationship required by the spec does not apply until the 
> fragments are connected together to form an HTML document to be 
> interpreted (rendered) by a user agent. Therefore, if "if any" applies 
> to fragments only and not to complete documents, then I feel, it should 
> not be present in the spec.

The specification's requirements apply to all HTML elements, whether in a 
document or not, whenever scripts are not executing. It also applies to 
non-conforming documents (e.g. documents where the parent element of a 
<summary> is not a <details>).

> The problem is that if we add "if any", allowing no parent, then we 
> should also define what <summary> means if there is no parent.

The element doesn't mean anything when there's no parent, because if 
there's no parent, or if the parent is not a <details> element, the only 
line in the spec that says that the <summary> element represents anything 
does not apply (because of the "if any").

> In short: "if any" should not be added if it is only meant to allow an 
> element to be represented separately as DOM in a script, because, if I 
> understand correctly, such representation is allowed for any HTML 
> element.

If I just omit the "if any", then the specification's definition would 
make no sense in the case where the <summary> element has no parent or its 
parent is not a <details> element, as it would refer to an element that 
does not exist.

Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Tuesday, 20 September 2011 23:38:38 UTC

This archive was generated by hypermail 2.4.0 : Wednesday, 22 January 2020 16:59:36 UTC