Re: [cowan@mercury.ccil.org: Questions about HTML void elements]

Anne van Kesteren scripsit:

> This is quite easy to verify in the specification. Does something need to 
> be simplified there? What is stopping you checking it there?

The fact that I got two mutually confirmatory responses in 40 minutes,
during which I was able to do something else other than looking through
a tangle of not-quite-consistent documents.  :-)

>> 1) There are 14 void elements, namely area, base, br, col, command,
>>    embed, hr, img, input, keygen, link, meta, param, and source.
>
> There's also track and wbr. <image> becomes <img> and <isindex> is a  
> special macro.

Thanks.  The polyglot markup document does not list track or wbr.

>> 12) All other void elements behave like hr.
>
> No, only <hr> implies a </p> tag when there is a p element in scope.

I meant, with respect to treatment of start-tags, end-tags, and
empty-tags.  Since hr is block content rather than flow content, it
clearly has different implications for element closure.

>> 13) The list of void elements will never grow.
>
> We might add elements in the future.

It is to be hoped, then, that they allow end-tags as well as empty-tags,
or at the very least that they don't treat end-tags as start-tags.
That will allow programs to generate valid HTML from start-element and
end-element events by knowing only the 16 existing void elements.

Thanks also to Sam Ruby.

-- 
John Cowan    http://ccil.org/~cowan    cowan@ccil.org
[T]here is a Darwinian explanation for the refusal to accept Darwin.
Given the very pessimistic conclusions about moral purpose to which his
theory drives us, and given the importance of a sense of moral purpose
in helping us cope with life, a refusal to believe Darwin's theory may
have important survival value. --Ian Johnston

Received on Thursday, 20 January 2011 18:23:52 UTC