Do HTML doctypes guarantee formal parsing?
For example if i use a particular doctype and then produce really bad HTML, will this force the browser to revert to a Quirks mode or guarantee parsing to the doctype?
EDIT: This includes CSS behaviour too.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No.
You’ll be hard pressed to find a browser that will parse using SGML rules under any circumstances.
An XHTML Content-type will trigger some browsers to parse using XML rules.
Most browsers will use their own tag soup parser or the HTML 5 algorithm for any text/html document.
Quirks mode has very little to do with parsing. It is mostly about how CSS is interpreted.
The choice between Quirks / Standards / Almost Standards / etc modes is handled almost entirely by the Doctype though. The exceptions are having an XHTML MIME type (which will force some browsers to standards mode, no matter what the Doctype) and (in the case of MSIE) X-UA-Compatible HTTP headers and
<meta>data.