W3C home > Mailing lists > Public > public-html-comments@w3.org > May 2011

Re: [whatwg] self-closing tags in html5

From: Ian Hickson <ian@hixie.ch>
Date: Mon, 2 May 2011 22:51:13 +0000 (UTC)
To: "William F. Hammond" <hammond@math.albany.edu>
cc: public-html-comments@w3.org
Message-ID: <Pine.LNX.4.64.1105022247140.19153@ps20323.dreamhostps.com>
On Fri, 31 Dec 2010, William F Hammond wrote:
> 
> Why not re-write 8.1.2.1 (6) as follows:
> 
> Then there may be a single U+002F SOLIDUS character (/).  This character 
> has no effect on void elements.  On foreign elements it marks the start 
> tag as self-closing.  On non-void HTML elements it marks the start tag 
> as self closing if it is immediately preceded by whitespace or by a 
> single instance of one of the two markup quoting characters U+0022 or 
> U+0027; otherwise it has no effect, and the start tag is not understood 
> as self-closing.

Because there are cases where people do <p />Hello world!</p>, and this 
would break those pages.


> Without language of this type the specification has not actually covered 
> the example you cited, i.e.,
> 
>              <p/>Hello world!</p> ,
> 
> where the <p/> should not be self-closing.

As far as I can tell it is covered both in the syntax definition and the 
parser definition. In the syntax definition it is covered by the 
definition of "start tags", point 6, which does not allow the presence of 
"/" at the end of a non-void non-foreign HTML element start tag.

-- 
Ian Hickson               U+1047E                )\._.,--....,'``.    fL
http://ln.hixie.ch/       U+263A                /,   _.. \   _\  ;`._ ,.
Things that are impossible just take longer.   `._.-(,_..'--(,_..'`-.;.'
Received on Monday, 2 May 2011 22:51:36 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 1 June 2011 00:14:06 GMT