(A building, DOM and CSSOM tree) page rendering mechanism

1, HTML load

  HTML is the foundation of a web page, the download is complete parsed

2, other static resource loading

  When parsing HTML, found that there are other links to external resources such as CSS, JS, images, etc., will immediately enable other threads to download.

  But if the external resource is JS, HTML parsing would stop, and so after the end of downloading the JS execution continues parsing HTML, JS prevent modification has been completed analytical results

3, DOM tree construction

  While HTML parsing, the parser will result into a complete parse DOM object, and further builds the DOM tree

4, CSSOM tree construction

  After downloading the CSS parsing of CSS, CSS parsed into an object, then the CSS objects assembled to build CSSOM tree

5, Render tree construction

  When the DOM tree and the tree are built CSSOM finished, the browser rendering build a tree based on these two trees

6, the layout calculation

  After the render tree is built, all the elements to calculate the size of the browser and the absolute position

7, rendering

  After the layout calculation is complete, the browser page rendering elements. After rendering engine processes the entire page to be displayed

Guess you like

Origin www.cnblogs.com/zhuxingqing/p/11075831.html