Will the web page block css rendering during the download process of the script tag (Synchronize)?

Let me ask you a question. When the web page is open, when the script tag is in the process of downloading (Synchronize), will it block css rendering?

I don"t seem to know how to test it with the chorome debug tool.

clipboard.png

Mar.13,2021

No, browsers are multithreaded.

the kernel of the browser is multithreaded, and they cooperate with each other under kernel control to keep Synchronize. A browser implements at least three resident threads:

javascript engine thread javascript engine is based on event-driven single-thread execution, the JS engine has been waiting for the arrival of the task in the task queue, and then processes it. The browser has only one JS thread running the JS program at any time.

the GUI rendering thread the GUI rendering thread is responsible for rendering the browser interface, which executes when the interface needs to redraw the (Repaint) or causes a backflow of (reflow) due to some operation. However, it should be noted that the GUI rendering thread and the JS engine are mutually exclusive, the GUI thread will be suspended when the JS engine executes, and the GUI update will be saved in a queue until the JS engine is idle.

browser event triggers thread event trigger thread, and when an event is triggered, the thread adds the event to the end of the "task queue" and waits for the JS engine to process it. These events can come from blocks of code currently executed by the JavaScript engine, such as setTimeOut, or from other threads from the browser kernel, such as mouse clicks, AJAX asynchronous requests, and so on, but because JS is executed in a single thread, all these events have to be queued for the JS engine to process.

Menu