Re: self-closing tags in html5

J. K. Korpela writes:

> ... It would be nice to know in advance which draft is
> referred to ...

Sorry.

> I don't quite understand the phrase "de facto empty elements".

A defacto empty element is an element that is either defined-empty in
the document type definition OR any element in the current document
instance that has no content.

> . . .  It would be odd to intentionally rely on that, but if a
> document accidentally contains, say, <html /> at the start, should
> the page really be displayed as empty?

There could be a special parsing rule in the spec to support what
browser representatives agree to do with it.

> . . .
> (see the Saga of the slashed validators, 
> http://www.cs.tut.fi/~jkorpela/qattr.html )

This is the result of the imo unwise enabling of full shorttag in the
sgml declaration, i.e., "HTML4.decl", for html 4 (also, as I recall,
earlier versions of w3c html).  One of the shorttag features enables
string values without whitespace for attributes to be unquoted (not a
good thing for urls), and another of those features gives '/' a
limited meaning as markup.

Without changing any of the dtd's one can modify the declaration to
turn off shorttag.  If having done that, one wants to enable some
of the shorttag features individually, that can be done.

One might think about these things for constructing private use sgml
document types that comply with, but are more restrictive than, the
text/html serialization of html5.

> And you can link to the root of a server using <a href=/>

See my previous message in this list.

                                    -- Bill

Received on Monday, 27 September 2010 19:26:30 UTC