Doctype and browser speed

doctype, html

Solution

I don’t think that the document type has an influence on the rendering speed. But the structure and style of an HTML document will have.

A complex HTML document (huge DOM tree, many embedded objects) with a complex style (floats, positioning, margin, padding) will probably need multiple rendering runs. Additionally an invalid HTML code the browser will need to do some error handling for parsing and building the DOM tree (but that’s not the rendering).

Take the Gecko reflow for example that shows how Firefox’s rendering engine Gecko renders an HTML document (videos for mozilla.org, a Wikipedia page and google.co.jp).

Problem

Is there any relation between doctype of an HTML document and browser rendering speed? If yes then which one is fastest?

Original source