Skip to content

Commit 00b13a6

Browse files
authored
Host images on repo
To avoid link rot (well, it already happened, but it is now recovered)
1 parent c69eda9 commit 00b13a6

11 files changed

+280
-10
lines changed

README.md

+10-10
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ The browser tries to figure out the IP address for the entered domain. The DNS l
8080
Here is a diagram of what a recursive DNS search looks like:
8181

8282
<p align="center">
83-
<img src="http://igoro.com/wordpress/wp-content/uploads/2010/02/500pxAn_example_of_theoretical_DNS_recursion_svg.png" alt="Recursive DNS search"/>
83+
<img src="img/Example_of_an_iterative_DNS_resolver.svg" alt="Recursive DNS search"/>
8484
</p>
8585

8686
One worrying thing about DNS is that the entire domain like wikipedia.org or facebook.com seems to map to a single IP address. Fortunately, there are ways of mitigating the bottleneck:
@@ -234,7 +234,7 @@ Once the server supplies the resources (HTML, CSS, JS, images, etc.) to the brow
234234
7. **Data Storage:** This is a persistence layer. The browser may need to save data locally, such as cookies. Browsers also support storage mechanisms such as [localStorage](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage), [IndexedDB](https://developer.mozilla.org/en-US/docs/Web/API/IndexedDB_API/Using_IndexedDB) and [FileSystem](https://developer.chrome.com/apps/fileSystem).
235235

236236
<p align="center">
237-
<img src="http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/layers.png" alt="Browser Components"/>
237+
<img src="img/layers.png" alt="Browser Components"/>
238238
</p>
239239

240240
Let’s start, with the simplest possible case: a plain HTML page with some text and a single image. What does the browser need to do to process this simple page?
@@ -248,15 +248,15 @@ Let’s start, with the simplest possible case: a plain HTML page with some text
248248
4. **DOM construction:** Finally, because the HTML markup defines relationships between different tags (some tags are contained within tags) the created objects are linked in a tree data structure that also captures the parent-child relationships defined in the original markup: HTML object is a parent of the body object, the body is a parent of the paragraph object, and so on.
249249

250250
<p align="center">
251-
<img src="https://developers.google.com/web/fundamentals/performance/critical-rendering-path/images/full-process.png" alt="DOM Construction Process"/>
251+
<img src="img/full-process.png" alt="DOM Construction Process"/>
252252
</p>
253253

254254
The final output of this entire process is the Document Object Model, or the “DOM” of our simple page, which the browser uses for all further processing of the page.
255255

256256
Every time the browser has to process HTML markup it has to step through all of the steps above: convert bytes to characters, identify tokens, convert tokens to nodes, and build the DOM tree. This entire process can take some time, especially if we have a large amount of HTML to process.
257257

258258
<p align="center">
259-
<img src="https://developers.google.com/web/fundamentals/performance/critical-rendering-path/images/dom-timeline.png" alt="Tracing DOM construction in DevTools"/>
259+
<img src="img/dom-timeline.png" alt="Tracing DOM construction in DevTools"/>
260260
</p>
261261

262262
If you open up Chrome DevTools and record a timeline while the page is loaded, you can see the actual time taken to perform this step — in the example above, it took us ~5ms to convert a chunk of HTML bytes into a DOM tree. Of course, if the page was larger, as most pages are, this process might take significantly longer. You will see in our future sections on creating smooth animations that this can easily become your bottleneck if the browser has to process large amounts of HTML.
@@ -290,7 +290,7 @@ The rendering engine will start getting the contents of the requested document f
290290
After that the basic flow of the rendering engine is:
291291

292292
<p align="center">
293-
<img src="http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/flow.png" alt="Rendering engine basic flow"/>
293+
<img src="img/flow.png" alt="Rendering engine basic flow"/>
294294
</p>
295295

296296
The rendering engine will start parsing the HTML document and convert elements to [DOM](http://domenlightenment.com/) nodes in a tree called the **"content tree"**.
@@ -307,7 +307,7 @@ It's important to understand that this is a gradual process. For better user exp
307307
Given below is Webkit's flow:
308308

309309
<p align="center">
310-
<img src="http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/webkitflow.png" alt="Webkit main flow"/>
310+
<img src="img/webkitflow.png" alt="Webkit main flow"/>
311311
</p>
312312

313313
## Parsing Basics
@@ -325,7 +325,7 @@ Parsing can be separated into two sub processes: lexical analysis and syntax ana
325325
Parsers usually divide the work between two components: the lexer (sometimes called tokenizer) that is responsible for breaking the input into valid tokens, and the parser that is responsible for constructing the parse tree by analyzing the document structure according to the language syntax rules. The lexer knows how to strip irrelevant characters like white spaces and line breaks.
326326

327327
<p align="center">
328-
<img src="http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/image011.png" alt="Source document to parse tree"/>
328+
<img src="img/image011.png" alt="Source document to parse tree"/>
329329
</p>
330330

331331
The parsing process is iterative. The parser will usually ask the lexer for a new token and try to match the token with one of the syntax rules. If a rule is matched, a node corresponding to the token will be added to the parse tree and the parser will ask for another token.
@@ -339,7 +339,7 @@ HTML parsing algorithm consists of two stages: tokenization and tree constructio
339339
**Tokenization** is the lexical analysis, parsing the input into tokens. Among HTML tokens are start tags, end tags, attribute names and attribute values. The tokenizer recognizes the token, gives it to the tree constructor, and consumes the next character for recognizing the next token, and so on until the end of the input.
340340

341341
<p align="center">
342-
<img src="http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/image017.png" alt="HTML parsing flow"/>
342+
<img src="img/image017.png" alt="HTML parsing flow"/>
343343
</p>
344344

345345
## DOM Tree
@@ -362,7 +362,7 @@ The DOM has an almost one-to-one relation to the markup. For example:
362362
This markup would be translated to the following DOM tree:
363363

364364
<p align="center">
365-
<img src="http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/image015.png" alt="DOM Tree"/>
365+
<img src="img/image015.png" alt="DOM Tree"/>
366366
</p>
367367

368368
### Why is the DOM slow?
@@ -391,7 +391,7 @@ There are DOM elements which correspond to several visual objects. These are usu
391391
Some render objects correspond to a DOM node but not in the same place in the tree. Floats and absolutely positioned elements are out of flow, placed in a different part of the tree, and mapped to the real frame. A placeholder frame is where they should have been.
392392

393393
<p align="center">
394-
<img src="http://www.html5rocks.com/en/tutorials/internals/howbrowserswork/image025.png" alt="The render tree and the corresponding DOM tree"/>
394+
<img src="img/image025.png" alt="The render tree and the corresponding DOM tree"/>
395395
</p>
396396

397397
In WebKit the process of resolving the style and creating a renderer is called "attachment". Every DOM node has an "attach" method. Attachment is synchronous, node insertion to the DOM tree calls the new node "attach" method.

0 commit comments

Comments
 (0)