How a webpage is loaded and displayed

References

[1] https://varvy.com/pagespeed/display.html

Steps of a webpage being displayed

1. Request: A request is made when a link is clicked

2. Response: The page and its resources (files) are downloaded

3. Build: Te web browser uses the page resources to build the page

4. Render: The page then is rendered (displayed) to the user

Request

1) Link is clicked

2) Page is refreshed

3) Navigation bar is used

(Html) files will be requested via HTTP

Response

The web server then provides the file to the web browser (html, javascript, css, images)

Parsing

When a computer reads a file looking for something, it is called parsing.

Web browser reads (html) file to find resources and requests found resources from server.

The web browser looks at the entire HTML document and looks for any css, javascript and images that are referenced by the page. If resources are found in the HTML the web browser then requests each of those resource files from the webserver. The images, css, and javascript that the HTML file references will be downloaded by the browser.

The Build

Once the web browser has the required resources it can start building the page.

The way a web browser builds the page is by combining the information found in the document (the original HTML file) and the information found in the resources.

There are basically three steps that the browser takes to build a page.

  • Build the DOM
  • Build the CSSOM
  • Build the Render Tree

Building the DOM

DOM stands for "Document Object Map". It is basically a map of where things are displayed on a page according to the HTML. The DOM represents what the HTML is saying by mapping out the page in a relational manner.

Building the CSSOM

CSSOM stands for "CSS Object Map". It is basically a map of what styles should be applied to different parts of the page according to the CSS. The CSSOM maps out the way things should be presented using styles.

Building the render tree

The render tree essentially takes the DOM and the CSSOM and combines them to create a full map of how the page will actually be laid out and painted.

The Render

After all of the above steps have been performed the browser can now finally put something up on the screen.

There are two main things that happen here...

  • Layout / Reflow
  • Paint

Layout/Reflow

The browser at this point knows what it should display (the DOM) and in what manner to display it (the CSSOM) and the relationship between those two (the render tree).

What it does not know is the size in which to display everything and where everything will end up on a screen.

This part is called the layout or the reflow, and it is basically where the browser determines how big a screen is and how that will affect the way the page is displayed.

Paint

Now that all the calculations are done, the browser can actually display something on the screen.

In this final stage the browser will convert each node in the render tree to actual pixels on the screen.

时间: 2024-11-11 16:27:15

How a webpage is loaded and displayed的相关文章

alertjs Documentation

原文地址:https://github.com/PaulNieuwelaar/alertjs/wiki/Documentation#alertshow For version 3.0 documentation, click here. Installation & Usage Download and install the unmanaged solution (recommended), or download the source files from other downloads,

AngularJS: An Overview

AngularJS: An Overview By Paras Babbar on Apr 21, 2015 Introduction Angular JS is a very powerful JavaScript library or we can say open-source web application framework maintained by Google. It is used in Single Page Application (SPA) projects. It ex

processing学习整理---Image

1.Load and Display(加载与显示) Images can be loaded and displayed to the screen at their actual size or any other size. 图像可以按照其实际尺寸或任何其他尺寸加载并显示到屏幕. PImage img; // Declare variable "a" of type PImage void setup() { size(640, 360); // The image file mu

win7 64位系统 PB连接oracle数据库出现“oracle library oci.dll could not be loaded”问题的解决方法

今天与大家分享一个自己的学习笔记,希望能给遇到同样问题的人带来帮助. 不知道大家在win7 64位系统下用 PB连接oracle数据库时,是否遇到过“oracle library oci.dll could not be loaded”问题. 今天,在win7 64位系统下用 PB连接oracle数据库时,一直出现上述错误,在百度上找了很久,都没有找到一个完整的解决方案,咨询了很多人,(他们都说是我的PB和oracle没装好,但我装的时候没出现任何问题,一切都很顺利,而且PB和oracle都能正

无解了吗Zabbix server is not running:the information displayed may not be current

Zabbix server is not running:the information displayed may not be current 安装版本2.4.5 php5.5 mysql5.5 debian7.7 注:网上说要开启php支持openssl扩展,已经开启了呀 方法如下: 1.php.ini文件中查找 allow_url_fopen = On: 让你的php支持 opensll扩展. 2.默认,是没有openssl扩展的,只能重新编译安装. cd /data/php-5.5.2

WPF 中的 loaded 事件和 Initialized 事件

在 WPF 中, 控件有 Loaded 和 Initialized 两种事件. 初始化和加载控件几乎同时发生, 因此这两个事件也几乎同时触发. 但是他们之间有微妙且重要的区别. 这些区别很容易让人误解. 这里介绍我们设计这些事件的背景. (不仅适用于 Control 类, 同样在通用类如 FrameworkElement 和 FrameworkContentElement 类也适用.) 下面是个小故事: Initialized 事件只说: 这个元素已经被构建出来,并且它的属性值都被设置好了,所以

apache添加模块时报错:module status_module is built-in and can't be loaded

在使用cacti监控linux主机上的apache时,apache需要加载 mod_status.so 模块. 编辑httpd.conf,手动添加下行: LoadModule status_module modules/mod_status.so 在重启apache时报错如下: httpd: Syntax error on line 58 of /etc/httpd/httpd.conf: module status_module is built-in and can't be loaded

ASP.Net随笔:webpage布局

通过 Web Pages,可以高效地实现: 每页拥有相同的页眉 每页拥有相同的页脚 每页拥有相同的样式和布局 使用内容块 通过WebPage,可以使用@RenderPage()方法从不同的文件中导入内容. HtmlPage.cshtml文件 <!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8&qu

VMware ESXi启动卡在 vmkibft loaded successfully

VMware ESXi 启动卡在 vmkibft loaded successfully 这里 前一段时间有一台测试VMware ESXi6.0 主机突然失去连接,去现场查看,系统已死机. 重启机器卡在vmkibft loaded successfully这里,百度了一下果断换Google. 发现了蛛丝马迹,有人说是磁盘坏了,有人说将系统装在USB上面尝试一下.. . 因为觉得磁盘不应该影响系统启动,折腾一番USB无果,尝试排查磁盘问题. 但是磁盘灯都是正常的,只好采取笨办法,卸载全部磁盘,一块