当前位置:网站首页>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
helloFrequent 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.
边栏推荐
猜你喜欢
随机推荐
DOM —— 事件对象
怎么使用 smart_rtmpd 的纯 webrtc 功能?
WeTest----如何查看Wetest生成测试报告?
【面经】被虐了之后,我翻烂了equals源码,总结如下
makefile——pattern rule
VLAN原理
【故障诊断】基于PSO_VMD_MCKD方法的风机轴承微弱故障诊断
Mysql索引优化二
软件测试之WEB自动化
数据库性能优化的误区!
golang八股文整理(持续搬运)
Oauth2.0 Supplement
nvm详细安装步骤以及使用(window10系统)
【软件测试】测试基础讲解
【网络参考模型】
JMM&synchronized&volatile详解
Homebrew的简单介绍
DOM —— 事件机制及事件链
小知识点系列:数组与多维数组
hybrid 实现同网段但不同vlan之间通讯








