[whatwg] Allow trailing slash in always-empty HTML5 elements?

Steve Runyon s.runyon at gmail.com
Wed Nov 29 12:21:47 PST 2006


Thanks Ian - so is it fair to say that self-closing singletons should be
_allowed_ but not _required_ -- that either syntax would be accepted as
valid HTML5?  That only makes sense to me -- it's backward-compatible while
allowing XHTML compatibility as well.

Your point about '<p />test' being the same as '<p>test</p>' is very
interesting.  That's not something I've ever done (that I'm aware of,
anyway), and it surprises me that it works that way.  As a divergent example
-- at least in IE6 -- '<div />' is treated as an inline element rather than
a block...that's probably non-standard behavior, and in any case it was a
surprise when I encountered it.

In case you can't tell, I haven't made it through the whole proposed spec
yet, so apologies if my questions and observations are springing from
ignorance.


On 11/29/06, Ian Hickson <ian at hixie.ch> wrote:
>
> The argument is that the self-closer "/" is an XMLism, and that HTML5 has
> nothing to do with XML, so there's no reason for it to apply here.
>
> Note that in HTML, this:
>
>   <p/> test
>
> ...regardless of what this discussion results in, will always be treated
> exactly the same as:
>
>   <p> test </p>
>
> ...because, for legacy reasons, there's no way we can treat "/" as a
> self-closer in any tag other than void tags (like <img> or <br>).
>
> --
> Ian Hickson               U+1047E                )\._.,--....,'``.    fL
> http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
> Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.whatwg.org/pipermail/whatwg-whatwg.org/attachments/20061129/ae43e059/attachment-0001.htm>


More information about the whatwg mailing list