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

On Wed, 29 Nov 2006, Steve Runyon wrote:
>
> 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.

It's a compelling argument.

I think basically the argument is "it would help people" and the counter 
argument is "it would confuse people". We need evidence to back up these 
arguments so we can make a solid decision. The only relevant data I have 
is that 50% of the web uses trailing slashes, and only 17% uses XHTML. 
This could be used to back up either argument: "clearly people think that 
trailing slashes are allowed, so we should allow them", and "clearly 
people are confused about trailing slashes, so we should get rid of them 
altogether". I don't know which is best.


> Your point about '<p />test' being the same as '<p>test</p>' is very 
> interesting.

To clarify, '<p />test' is the same as '<p>test</p>' because it's the same 
as '<p  >test' -- the "/" character is completely ignored by browsers.


> 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.

Could you show an example of this? I couldn't reproduce the behaviour you 
describe. In my tests, in text/html content, <div> and <div /> acted 
exactly the same, in all browsers that I tested it with.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'

Received on Wednesday, 29 November 2006 14:20:39 UTC