Quirks mode in various web browsers

Quirks mode in IE 6 and greater, actually renders a page using IE 5.5, which is called quirks mode.

Firefox uses Netscape 4.(I think)

What is the quirks mode in Webkit based browsers rendered in or based on?
Safari,
Chrome,
Konquerer (KHTML).
The same question goes for Opera.

Thanks in advance,

No it doesn’t render as Ie5.5 exactly as there are many differences. It does use the broken box model like ie5 but there are too many diffrences to rely on it as an ie5.x copy.
e.g.


<! quirks mode initiated with no doctype -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
<style>
div{back\\ground:red}/* backslash hack*/
</style>
</head>
<body>
<div>only ie5.x is not red</div>
</body>
</html>


There are in fact three modes quirks mode, almost standards mode and standards mode and all vary between browsers (ignoring ie8s myriad of modes of course).

See the sitepoint reference for a quick run down and then [URL=“http://hsivonen.iki.fi/doctype/”]visit here for all the details.

Thanks for the interesting link…

I found this juicy nugget about Webkit:

And finally, we have a Dashboard compatibility mode that has a few extra quirks beyond quirks mode, to handle Dashboard widgets that were coded to depend on old WebKit bugs.

I would find it interesting to see what quirks, all these quirks mode support, and how long they will hang around. How many sites still depend on the broken box model today? Yet we carry the carcass of an old IE5 rendering engine “just in case” we need it.

Its amazing the great lengths browsers go to bring us what they can. With all these different “modes”, the code to write browsers will get ever longer, and harder to maintain. With CSS3 not even finished, and the browsers supporting it already, I look foward to future quirk modes to come.

I don’t think quirks mode is *based on anything, it’s just that: quirks mode; something that makes the browser do crazy things while rendering your markup.

If you are being bothered by the browsers though, and you want to shake quirks mode off your tail bumper, just use the “Strict” Doctype in XHTML. Really, you don’t even need to follow the rules, all you gotta do is _say you’re following the rules, at the beginning of the file.

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>

Also, adding a “Reset” CSS file will get you rid of those darned IE bugs.

Don’t mention it.

“Quirks Mode is triggered by doctype sniffing, also known as doctype switching. This means that the browser inspects the start of an HTML document to see whether it con­tains a doctype declaration as required by HTML specifications.” - from here.

strict mode is triggered by the presence of a valid doctype declaration, not just strict DTDs.

“WebKit, like most browser engines, has a quirks mode that is triggered by certain old HTML doctypes, or lack of a doctype declaration in text/html. Documents with newer or unknown doctypes, or sent as XML, are processed in standards mode. Like Mozilla and Opera, we apply only a limited set of nonstandard behaviors in quirks mode, and otherwise fix bugs across both modes, if they do not have a specific significant impact on Web compatibility. This is in contrast to the IE approach of completely freezing old behavior in quirks mode.” - from here.

WebKit seems to behave a bit different when it comes to quirks mode, but the general rules are the same: the lack of DTD usually triggers quirks mode.