Quirks Mode and Standards Mode

  • Revision slug: Quirks_Mode_and_Standards_Mode
  • Revision title: Quirks Mode and Standards Mode
  • Revision id: 37624
  • Created:
  • Creator: Mcaruso
  • Is current revision? No
  • Comment Syntax mistake

Revision Content

Because existing content on the web is not standards-compliant or would appear in unintended ways on a standards-compliant browser, Mozilla handles some content in a backwards compatible way and some content according to standards.

There are three modes used by the layout engine: quirks mode, almost standards mode, and full standards mode. In Quirks mode, layout emulates nonstandard behavior in Navigator 4 and MSIE for Windows that is required not to break existing content on the Web. In full standards mode, the behavior is (hopefully) the behavior described by the HTML and CSS specifications. In almost standards mode, there are only a very small number of quirks implemented: those that break real pages on the web that use the DOCTYPEs that trigger almost standards mode.

How does Mozilla determine which mode to use?

For documents sent as text/html, Mozilla must decide whether to handle them in quirks mode or standards mode. (Content sent as text/xml or other XML or XHTML MIME types is always handled in strict mode.) Currently Mozilla does this through DOCTYPE sniffing. That is, it uses the DOCTYPE declaration (DTD) as a hint as to whether the page is a recently written web page that can be expected to behave properly when all standard behavior is used. See the detailed description of how DOCTYPE sniffing is used to determine the layout mode.

There have been requests for authors to be able to set (or suggest) the layout mode without changing the DTD of the page, since the DTD exists primarily for other reasons. So far no such method has been implemented, but the leading proposal is an HTTP header that would also be accessible through a META element in the head of the document.

What are the differences between the modes?

See the list of quirks for the differences between the modes.

Original Document Information

  • Author(s): David Baron
  • Last Updated Date: December 12, 2004

Revision Source

<p>Because existing content on the web is not standards-compliant or would appear in unintended ways on a standards-compliant browser, Mozilla handles some content in a backwards compatible way and some content according to standards.
</p><p>There are three modes used by the layout engine: quirks mode, almost standards mode, and full standards mode. In Quirks mode, layout emulates nonstandard behavior in Navigator 4 and MSIE for Windows that is required not to break existing content on the Web. In full standards mode, the behavior is (hopefully) the behavior described by the HTML and CSS specifications. In almost standards mode, there are only a very small number of quirks implemented: those that break real pages on the web that use the DOCTYPEs that trigger almost standards mode. 
</p>
<h3 name="How_does_Mozilla_determine_which_mode_to_use.3F"> How does Mozilla determine which mode to use? </h3>
<p>For documents sent as text/html, Mozilla must decide whether to handle them in quirks mode or standards mode. (Content sent as text/xml or other XML or XHTML MIME types is always handled in strict mode.) Currently Mozilla does this through DOCTYPE sniffing. That is, it uses the DOCTYPE declaration (DTD) as a hint as to whether the page is a recently written web page that can be expected to behave properly when all standard behavior is used. See the <a class="external" href="http://www.mozilla.org/docs/web-developer/quirks/doctypes.html,">detailed description</a> of how DOCTYPE sniffing is used to determine the layout mode.
</p><p>There have been requests for authors to be able to set (or suggest) the layout mode without changing the DTD of the page, since the DTD exists primarily for other reasons. So far no such method has been implemented, but the leading proposal is an HTTP header that would also be accessible through a META element in the head of the document.
</p>
<h3 name="What_are_the_differences_between_the_modes.3F"> What are the differences between the modes? </h3>
<p>See the <a class="external" href="http://www.mozilla.org/docs/web-developer/quirks/quirklist.html,">list of quirks</a> for the differences between the modes.
</p>
<div class="originaldocinfo">
<h3 name="Original_Document_Information"> Original Document Information </h3>
<ul><li> Author(s): David Baron
</li><li> Last Updated Date: December 12, 2004
</li></ul>
</div>
Revert to this revision