Re: Standards mode and Quirks mode (was Re: [CSS21] Test Suite)

On Friday, July 23, 2004, 11:57:42 PM, L. wrote:

LDB> On Friday 2004-07-23 23:47 +0200, Thomas Scholz wrote:
>> While I see the problem behind the idea of doctypeswitching, I really,
>> really hate the »solution«. It never worked and it will never work. I've
>> seen a lot of documents in »standard mode« which had a »quirks mode«
>> needed and reverse. The document type declaration is just the wrong place
>> to ask for a compatibility mode. It's markup not style, now misused for
>> layout purposes. The doctype switch is the continuation of the layout
>> table with the same methods.

LDB> It was never designed as something that authors should select.  It was
LDB> designed as a heuristic to distinguish new documents from old ones.
LDB> Authors writing new documents should either be using XHTML MIME types or
LDB> should be using DOCTYPE declarations that trigger standards mode.

I agree with that, although unfortunately there was this stuff about
sending XHTML to older browsers instead of a clean switch to an new media
type at the same time as switching to XHTML. This prevented a clean
transition, and increased the need for sniffing.


LDB>  Thus,
LDB> in principle, all new documents should trigger standards mode.

LDB> In reality, this isn't the case, but [...]

In practice though

[1] (HTML 4 transitional) Triggers Quirks mode for Netscape

[2] When XHTML is delivered as text/html and includes the XML
declaration, Quirks mode is triggered for IE and Opera 7.0-7.03. From
Opera 7.1 on, the XML declaration, PIs, and comments are ignored for
determining display mode. When delivered as XML, both Opera and IE use
Standards mode.

In practice therefore to get best compatibility you need to author in
XHTML, have a perl script or something that cuts out the xml
declaration and ensures the string <html or <title is in the first 256
bytes and generally produces something that will not trip up IE,
send the processed stuff as text/html to Win/IE and send the authored
stuff as application/xhtml+xml for everyone else.

(Unfortunately lots of UAs tell you they are IE6.)

I would have swung this back to "and therefore, the test suite needs to
have separate HTML4 and XHTML and XML tests" but you changed the subject
already so I will leave it as a remark in passing.

LDB> After all, authors shouldn't need to know about standards mode and
LDB> quirks mode -- they should just be able to follow appropriate
LDB> standards.

+1 to that.

>> Long time ago, when Opera 7.0 implemented The Switch, I asked for a method
>> to prevent quirks mode in all circumstences. I never got an answer. A
>> simple
>> /*--quirks:never--*/ had been enough. No luck.

LDB> In Mozilla and Safari, you could just add an empty internal subset to
LDB> any existing DOCTYPE declaration to turn off quirks mode.  This causes
LDB> no semantic change to the DOCTYPE declaration.

Correct. It also causes Win/IE to display

]>

as the first line of the document, so people tend not to do that.



-- 
 Chris Lilley                    mailto:chris@w3.org
 Chair, W3C SVG Working Group
 Member, W3C Technical Architecture Group

Received on Friday, 23 July 2004 18:17:56 UTC