当前位置:网站首页>DOM - page rendering process
DOM - page rendering process
2022-08-02 16:35:00 【z_Xiao Zhang classmate】
After the user enters the url (web address) in the browser address bar, the stage that the page goes through when the page is rendered:
- The browser receives the URL and starts the network request thread.
- A complete HTTP request is issued
- The server receives the request and goes to specific background processing
- HTTP interaction between front and backend and designed caching mechanism
- The critical rendering path after the browser receives the packet
- The parsing process of the JS engine
(For the specific process, please check and learn online by yourself)
The general process of loading an html document by a browser is divided into the following stages:
1) Parse tags, text, comments, attributes, etc. into a node tree (DOM Tree)
2) When parsing nodes in the node tree (DOM Tree), different operations will be performed if different elements are encountered:
a. If css code is encountered, the css code will be parsed into a CSS style structure
B. When encountering src, it will load (network request) resources
3) Combine the CSS style structure with the node tree DOM Tree into a render tree/Render Tree
4) Draw the page according to the Render Tree
Redraw and Reflow
Redraw: It is to redraw and render the page according to the structure of the document tree
Reflow: The number of elements on the page and the position of the nodes in the tree have changed
Relationship between redrawing and reflow: reflow must cause redrawing, but redrawing does not necessarily cause reflow
hello
Frequent redrawing and reflow will cause poor page performance. Therefore, when operating the page, try to avoid high-frequency redrawing and reflow.
For example: Create 10,000 cells in a table. If ordinary creation and addition, it will be redrawn and reflowed frequently, so we can create an element to carry the element to be rendered:
Using this method, you can avoid high-frequency redraw and reflow operations, and it will not affect the performance of the page.
边栏推荐
- 【TCP 和 UDP 基本原理】
- makefile——杂项
- Principles of permutation entropy, fuzzy entropy, approximate entropy, sample entropy and approximate entropy implemented by MATLAB
- WEB自动化之键盘、鼠标操作
- MATLAB文件操作
- LAMP 环境搭建 yum源安装方式 (Apache 2.4.6 +mysql 8.0.28+php 8.1.3)
- 网络运维系列:二级域名启用与配置
- makefile——pattern rule
- tab 替换空格
- nodejs 的下载安装与环境配置
猜你喜欢
随机推荐
【频域分析】频谱泄露、频率分辨率、栅栏效应
CSV file with the data read and write 】 【 XLS/XLSX file
华为单臂路由配置,实现不同vlan之间的通信
【时间序列模型】AR模型(原理剖析+MATLAB代码)
The DOM event type
JS中的数组方法和循环
Xshell 使用删除键乱码问题
How to tick the word box?
VLAN原理
MYSQL5.7详细安装步骤
Three-way joint interface data security issues
Scala的模式匹配与样例类
Template series-union set
makefile——rule概览
面试追问系列-Redis技术原理
假的服务器日志(给history内容增加ip、用户等内容)
Zabbix: PHP option“date.timezone” Fail
【故障诊断】基于PSO_VMD_MCKD方法的风机轴承微弱故障诊断
RTMP, RTSP, SRT 推流和拉流那些事
golang时间-时间戳的获取-转换-计算