W3C home > Mailing lists > Public > public-html-comments@w3.org > September 2010

Re: self-closing tags in html5

From: William F Hammond <hammond@csc.albany.edu>
Date: Mon, 27 Sep 2010 13:14:27 -0400
To: whatwg@whatwg.org, public-html-comments@w3.org
Message-ID: <i7ocbjrtvw.fsf@hilbert.math.albany.edu>
Bjoern Hoehrmann <derhoermi@gmx.net> writes:

> * William F Hammond wrote:
>>Does anyone seriously think that "<foo/>" is an ordinary open tag?
> They do if it's like in `<a href=http://example.org/>`.

Well, the spec (w3 version) has detailed parsing rules for text/html
in section 8.2.  I _think_ those rules would understand the last '/'
in this example to be part of an unquoted value string.  If I'm right
about that, the parsing rules would NOT say that the self closing flag
should be set for this example.  In fact, I see that validator.nu
accepts this example.

My suggestion is that when the parsing rules say the self-closing
flag _should_ be set (which Henri Sivonen's validator.nu seems to
be clear about), browsers should close off the element whether it
is foreign or html.

This validator.nu message

  Error: Self-closing syntax (/>) used on a non-void HTML element.
         Ignoring the slash and treating as a start tag.

represents the cognitive dissonance that I think is a problem.
(See http://math.albany.edu/pers/hammond/Test/leaptag.html)

                                    -- Bill
Received on Monday, 27 September 2010 17:14:58 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 20:26:26 UTC