Contemporary web browsers implement a variety of different engine modes in order to handle web pages authored according to web standards and those authored according to older practices that prevailed in the late 1990s. This article explains what those patterns are and how to trigger them.
Original text: Activating Browser Modes with Doctype by Henri Sivonen
The mode switching included in this article applies to Firefox and other Gecko-based browsers, Safari, Chrome and other Webkit-based browsers, Opera, Konqueror, Internet Explorer for Mac, Internet Explorer for Windows, and IE embedded browsers. device. Avoid mentioning the name of the browser engine and instead use the name of the most well-known browser for that engine.
This article focuses on the mode selection mechanism rather than documenting the exact behavior of each mode.
Here are the various modes:
The mode selection for text/html content depends on doctype sniffing ( discussed later in this article ). In IE8, the mode depends on other factors as well. However, by default in IE8, the mode for non-intranet sites that are not on Microsoft's blacklist depends on the document type.
It cannot be overemphasized that the precise behavior of patterns differs in each browser, even though it is discussed uniformly in this article.
In Firefox, Safari, Chrome and Opera, the application/xhtml+xml HTTP content type (not a meta element nor a doctype!) triggers XML mode. In XML mode, the browser attempts to give the XML document specification-correct processing to the extent specified in the browser.
E6, 7 and 8 do not support application/xhtml+xml, nor does Mac IE5.
In the WebKit-based Nokia S60 browser, the application/xhtml+xml HTTP content type cannot trigger XML mode because the concern in mobile walled gardens is compatibility with non-standard content. ( Older "mobile browsers" can't use real XML parsers because non-canonical content is already tagged as XML.)
Without testing Konqueror enough, I can't say exactly what will happen in this browser.