The browser's rendering mechanism1. Browsers use two engines to process pages, and different browsers use different rendering engines Rendering Engine: js engine 2. The browser will parse HTML into DOM tree, parse css into CSSOM (CSS Object Model); 3. Then the DOM tree and CSSOM will be combined to produce render tree(render tree); 4. After the render tree is completed, the browser will layout according to the render tree. After the layout is completed, a "box model" will be output, which will accurately capture the position and size of each node in the view, and all measurements will be converted into physical pixel values on the screen; (This step will cause 5. After the layout is completed, the browser will immediately issue a paint stup event to convert the render tree into screen pixels; (this step will cause 6.After the above steps, the page will be displayed on the screen. Note that reflow will inevitably cause redrawing, but redrawing does not necessarily cause reflow Reflow and repaintReflowconcept: When part or all of the render tree changes due to changes in the structure, size, layout, etc. of the elements, the browser re-renders part or all of the DOM. Emphasize that the position and distance of element nodes have changed. Actions that cause reflux:
Redrawconcept: When the style of a page element changes without affecting its position in the document flow, the browser simply assigns the new style to the element and repaints it. Emphasize the style of element nodes, such as color, border solid line becomes dashed line (without changing position and distance). Operations that cause redrawing:
The above is the detailed content of the principles and differences of reflow and repaint, which are frequently asked in Web interviews. For more information about reflow and repaint in Web interviews, please pay attention to other related articles on 123WORDPRESS.COM! You may also be interested in:
|
<<: How to use libudev in Linux to get USB device VID and PID
>>: How to connect to MySQL remotely through Navicat
Table of contents 1. CentOS7+MySQL8.0, yum source...
This article records the installation tutorial of...
Overview Nginx can use variables to simplify conf...
There are three types of attribute value regular ...
This article uses examples to illustrate the prin...
Programs in Docker containers often need to acces...
1. Dashed box when cancel button is pressed <br...
Table of contents Master-Master Synchronization S...
ContentsHyperledger fabric1.4 environment setup u...
First, check whether the hard disk device has a d...
Table of contents Preface 1. The database name or...
Table of contents 1. Introduction to ReactJS 2. U...
Sublime Text 2 is a lightweight, simple, efficien...
as follows: docker run -d -p 5000:23 -p 5001:22 -...
Deploy nginx with docker, it's so simple Just...