当前位置:网站首页>[learning notes] Web page rendering process
[learning notes] Web page rendering process
2022-07-24 06:51:00 【Father Zeng Pang】
The rendering process is roughly divided into
1, Handle HTML Tag and build DOM Trees
2, Handle CSS Tag and build CSSOM Trees
3, take DOM and CSSOM Merge into a rendering tree
4, Layout according to the rendering tree , To calculate the geometric information of each node
5, Draw each node to the screen 
The whole rendering process is actually to URL Corresponding resources , Through the analysis of the rendering engine of the tour , Output visual images
1, Handle HTML Tag and build DOM Trees
DOM Node tree species node and HTML The contents of the document correspond one by one ,DOM Tree building process : Read HTML file , Turn bytes into characters , determine tokens
then tokens Convert to node , Build with nodes DOM Trees 
2, Handle CSS Tag and build CSSOM Trees
In the build DOM In the process of trees , stay HTML Document head Encountered in the tag link label , This tag refers to an external css Style sheets , Because it foresees the need to use css Resources to render pages , The browser will immediately issue a request for the css Requests for resources , And carry on CSSOM The construction of trees .CSSOM The construction process of the tree is similar to DOM The construction process of the tree is consistent : Read CSS file , Convert bytes to characters , determine token, then token Convert to nodes , Build with nodes CSSOM Trees
3, take DOM and CSSOM Merge into a rendering tree
DOM+CSSOM= Render tree , Render tree has DOM Trees ,CSSOM Trees merge into , But you don't have to wait CSSOM After the tree is loaded, it starts to load and merge to build the rendering tree , There are five conditions for the construction of the three , Nor are they independent , It's a cross , Build in parallel , Therefore, one side loading , One side analysis , While rendering the working phenomenon .
4, Layout according to the rendering tree , To calculate the geometric information of each node
5, Draw each node to the screen
Calculate the layout of each visible element according to the rendering tree , And output to the drawing process , Renders pixels onto the screen .
边栏推荐
猜你喜欢

10分钟就能写出来的——25~30K的国外企业招聘面试考题,这不是轻轻松松吗~

Learn more about when to use MySQL two locks (table lock and row lock)

Sort by an attribute value of an object in the array

创建WPF项目
![JS: why [] = =! [] return true?](/img/36/94839bf4ce6bd06d2cbe989828c791.png)
JS: why [] = =! [] return true?

【LVGL(5)】标签的(label)用法

类的加载器 和 双亲委派机制详解

JSONObject按照key的A——Z顺序排序
![[esp8266 spot welder] Based on esp8266 for Arduino](/img/9a/81b0d16572116445d46ba4e34a6e4e.png)
[esp8266 spot welder] Based on esp8266 for Arduino

数据分析思维之从整体出发分析零售行业——全方位多方面细节分析
随机推荐
MapReduce (I)
These 10 kinds of timed tasks have been learned, and you can float directly
【LVGL(1)】LVGL的简单介绍
Write cookies, sessionstorage, localstorage and session at will
sojson jsjiami.com.v6 爬虫js逆向
Special effects - bubble tailing occurs when the mouse moves
一个AI玩41个游戏,谷歌最新多游戏决策Transformer综合表现分是DQN的两倍
JS - calculate the side length and angle of a right triangle
GE口:SGMII模式和serdes模式
Redis data type -string (string type)
[lvgl (2)]
adb交互-干掉难看的默认shell界面
【USB电压电流表】基于STM32F103C8T6 for Arduino
Special effects - cobweb background effects
JSONObject按照key的A——Z顺序排序
JS: why [] = =! [] return true?
广度优先搜索(模板使用)
Getting started with redis
这10种定时任务学会了,直接飘
NFS shared services and experiments