W3C home > Mailing lists > Public > public-html@w3.org > August 2008

Re: Are new void elements really a good idea?

From: Philip Taylor <pjt47@cam.ac.uk>
Date: Sun, 31 Aug 2008 13:10:56 +0100
Message-ID: <48BA8A50.9070102@cam.ac.uk>
To: Julian Reschke <julian.reschke@gmx.de>
CC: "public-html@w3.org" <public-html@w3.org>

Julian Reschke wrote:
> 
> The "<tagname />" syntax is not allowed in HTML4, and thus existing 
> libraries that have been designed to produce HTML4 will not use it.
> 
> On the other hand, what, except ideological reasons, stops us from allowing
> 
>  <tagname></tagname>
> 
> as well?

Allowing both syntaxes means there are more opportunities for authors to 
get confused, and makes the language a bit more complex.

E.g. <embed> is a void element, and so there's never a need to write 
</embed>; but most people (something on the order of 80%) write <embed 
...></embed> anyway. The W3C validator doesn't tell people to just write 
<embed ...> (since instead it complains that 'embed' is not defined in 
HTML4), so they have no reason to learn and promote the simpler way of 
writing it.

Hypothetically, people who are used to writing <embed ...></embed> may 
get confused when they see a page with just <embed ...>, and incorrectly 
think that the page is wrong. (I don't know if this a problem in reality.)

Also hypothetically, people might write <embed ...>Fallback 
content</embed> and expect it to work, since all other elements in HTML 
with start+end tags can contain some content. That's easier to test: 
Looking at some tens of thousands of pages to find some with non-empty 
<embed>s, they all seem to contain either whitespace (spaces, &nbsp;, 
<br>) or <noembed>. That use of <embed 
...><noembed>...</noembed></embed> is a bit confused, but harmless. I 
don't see any cases where there's a real problem caused by this on 
public sites. (But I have no idea how many authors would have 
encountered a real problem while testing it themselves privately, and 
fixed it before uploading.)

-- 
Philip Taylor
pjt47@cam.ac.uk
Received on Sunday, 31 August 2008 12:11:40 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:22 GMT