Doctype and browser speed

Is there any connection between the doctype of the HTML document and the rendering speed of the browser?

If so, which one is faster?

+3
source share
4 answers

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

A complex HTML document (a huge DOM tree, many built-in objects) with a complex style (float, positioning, margin, padding) will probably require several rendering traces. In addition, invalid HTML code, the browser will have to handle some errors for parsing and building the DOM tree (but this is not rendering).

Gecko reflow, , , Firefox Gecko HTML- ( mozilla.org, google.co.jp).

+10

Google - . doctype:

<!doctype html>

Google " ".

, Google . , /. , , , , doctype, .

+1

, , .

doctype , :

  • doctype ( , ).
  • XHTML - .

.

, , , - doctype. , , ySlow Google Page Speed ​​, .

0

I have never heard of the difference in rendering speeds in the real world. Similarly, it is often assumed that XHTML will be faster. The idea is that with a well-designed document, the browser does not need to handle errors, but the browser does not know that it is well-formed until it displays it ...

There are many pages with Strict XHTML Doctypes that are not validated.

All other factors are probably much more important - apart from loading speed, the way you use the CSS selector can certainly have an effect, for example.

0
source

Source: https://habr.com/ru/post/1711072/


All Articles