Re: [whatwg] self-closing tags in html5

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 UTC