W3C home > Mailing lists > Public > www-style@w3.org > June 2004

Re: CSS on invalid HTML

From: David Woolley <david@djwhome.demon.co.uk>
Date: Sat, 5 Jun 2004 08:44:14 +0100 (BST)
Message-Id: <200406050744.i557iEM02607@djwhome.demon.co.uk>
To: www-style@w3.org

> Every browser does that for HTML. But you surely don't mean elements, 
> but tags, which may be absent in the markup according to the HTML 
> specification.

I think he could mean it either way.  Presented with valid HTML with
permitted missing opening tags, a properly CSS compatible browser must
insert the element corresponding to the omitted tags into the document
object model.  This should be a completely specified process.

However, when presented with invalid markup, the IE family try to build
a document object model, which I believe is, in general, no longer a tree
(even though CSS will see it as a tree), and might, for instance, insert
additional elements when an author attempted to overlap two elements,
or tried to nest a %block element into a %inline context.

Of course, things are simpler for conforming XHTML browsers as CSS really
requires well-formedness not strict validity and conforming browsers are
required to reject not-well-formed documents.  There has, of course, been
much discussion as to whether or not it is commercially realistic to
reject documents, and it should be noted that IE is not an XHTML 
compatible browser, it simply tolerates XHTML syntax as a form of
invalid HTML.
Received on Saturday, 5 June 2004 06:54:43 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:30 GMT