# Re: self-closing tags in html5

From: William F Hammond <hammond@csc.albany.edu>
Date: Mon, 20 Sep 2010 13:56:47 -0400
To: Henri Sivonen <hsivonen@iki.fi>
Cc: public-html@w3.org, Ian Hixie <ian@hixie.ch>, www-math@w3.org
Message-ID: <i7k4mgxpr4.fsf@hilbert.math.albany.edu>
I'm not subscribed to "public-html".  I had hoped that the list
manager would allow my previous message to go through, but that has
in full what you're replying to.

Henri Sivonen <hsivonen@iki.fi> writes to public-html@w3.org:

> For which values of X and Y? I see the exact same serialization in
> the latest Firefox trunk nightly (Mac) and in IE8 (Windows XP).

Firefox 4 and IE-8 are both correct on this.  X and Y are others that
I did not want to name in public.  My point was that the incorrect doms
built by X and Y trip up MathJax in different ways.

>> I think that things might work better if all self-closing tags,
>> foreign or not, i.e., marked up in the form "<foo/>", are recognized
>> as empty elements, whether defined-empty or merely de facto empty.  Of
>> course, if "foo" is the name of an element in the short list of
>> defined-empty html elements, it should still be the case that "<foo>"
>> is recognized as indicating an empty element.  It would certainly be
>> simpler for building the dom skeleton this way.
>
> For backwards compatibility reasons, it's not OK to make <foo/> act
> as self-closing syntax when foo is an HTML element. On the other
> hand, where foo is a MathML element, we don't need to make <foo>
> (without the slash) self-close, since introducing that level of DWIM
> isn't necessary for compatibility.

This statement about backwards compatibility is often asserted, but I
doubt its truth.

Consider the small html4.01-strict document
http://math.albany.edu/pers/hammond/Test/tb7.html

It contains the following nonsense (that Firefox, Google Chrome,
IE-8, lynx, Opera, and w3m correctly IMO do not render):

<p/Tiny paragraph.>

Because the sgml declaration for html4 unwisely allowed full use of
SHORTTAG, this document validates with opensp.  However, the W3C
validator puts out a warning message: "NET-enabling start-tag requires
SHORTTAG YES".

But the error -- not a warning -- (and the rule) should be:

NESTC tag '/' not immediately followed by null end-tag '>'

And, as I said, this one rule should work well in the text/html
serialization of html5 in both foreign and domestic namespaces.

BTW it's easy enough to fix the SHORTTAG issues in the sgml
declaration for HTML 4.  See
http://math.albany.edu/pers/hammond/ht4decl-diffs

-- Bill

Received on Monday, 20 September 2010 17:57:26 UTC

This archive was generated by hypermail 2.3.1 : Tuesday, 6 January 2015 21:27:43 UTC