Why is domcontentloaded (blue line) completed before the css is downloaded?
ringa_lee2017-05-19 10:35:42
1. The browser starts to parse the target HTML file, and the order of execution flow is top-down.
2. The HTML parser converts the HTML structure into the basic DOM (Document Object Model). After the DOM tree is built, the DomContendLoaded event is triggered.
3. The CSS parser parses CSS into CSSOM (Cascading Style Sheet Object Model), a tree containing only style information.
4. CSSOM and DOM begin to merge to form a rendering tree, and each node begins to contain specific style information.
5. Calculate the position information of each node in the rendering tree, which is the layout stage.
6. Display the laid out rendering tree on the interface.
PHPz2017-05-19 10:35:42
domcontentloaded
itself is when the HTML tag has finished loading and parsing, no need to wait for the style sheet.
某草草2017-05-19 10:35:42
DOMContentLoaded event will be fired when the initial HTML document has finished loading and parsing, without waiting for stylesheets, images and subframes to be fully loaded.
Reference: https://developer.mozilla.org...
世界只因有你2017-05-19 10:35:42
First of allcss
下载不会阻塞网页渲染,一个网页由html
和资源资源组成,其他资源的下载不会影响到html
The files themselves are downloaded concurrently.
巴扎黑2017-05-19 10:35:42
DOM and CSSOM are independent data structures
Reference: https://developers.google.com...