Chrome Modern Web Browser Device (Part 3/4)

This is part 3 of 4 on how browsers work. Earlier we looked at multiprocessor architecture and navigation. In this post, we'll take a look at what happens inside the * renderer process.





Part 1

Part 2

Part 3 (current)

Part 4



About translation features
  • , , .. () . β€” , - . : *-, *-. , , , , , .
  • , , , , . "" , .


*- . *- , . , "" Web Fundamentals .



*- -



*- , . *- , . JavaScript , web worker *- (service worker). *- (compositor threads) *- (raster threads) *- .



*- β€” HTML, CSS JavaScript -, .



image



1: *- , worker , *-, *-





= DOM



HTML-, (HTML) Document Object Model (DOM).



DOM β€” , API, - JavaScript.



HTML- DOM HTML. , HTML . , </p> HTML. , Hi! <b>I'm <i>Chrome</b>!</i> ( b i) , Hi! <b> <i></i></b><i>!</i>. , HTML . , , " " HTML.



=



- , , CSS JavaScript. . , , DOM, "preload scanner ". HTML- , <img> <link>, preload scanner , HTML-, *- *-.



image

2: HTML DOM



= JavaScript



HTML- <script>, HTML , JavaScript . ? JavaScript , , document.write(), DOM ( HTML ). HTML , JavaScript, HTML-. , JavaScript, V8 .





, - , . JavaScript document.write(), async defer <script>. JavaScript . JavaScript , . <link rel="preload"> β€” , , . Resource Prioritization – Getting the Browser to Help You.





DOM , , , CSS. CSS DOM. , CSS-. CSS DevTools.



image

3: CSS



CSS, DOM . <h1> , <h2>, . , . , CSS Chrome, .



(Layout)



*- , . , . " " β€” , , .



. DOM *- (layout tree), , x y . *- DOM, , , . display: none, *- (, visibility: hidden *-). , - p::before{content: "Hi!"}, *-, DOM-.



image



4:



image



5: DOM *-



β€” . , , , , ; , .



CSS , . , . Chrome . , BlinkOn Conference .



image

6: -





DOM, . , . , , , .



, z-index, HTML, .



image



7: , ,



image



8: HTML, z-index



, *- (*-, Paint Records). *- β€” " , , ". <canvas> JavaScript, .



image



9: *- *-



=



, , , . , - *-, .



image



10: DOM+, *- *-



, . 60 ; , . , , "" ("janky").



image

11:



, , , , JavaScript.



image



12: , - JavaScript



requestAnimationFrame() JavaScript () . JavaScript. JavaScript Web Workers, .



image



13: JavaScript



* (Compositing)



= ?



image



14.



, , , , ? (rasterizing).



, viewport. , . Chrome , . , * (compositing).



= *



* β€” , , "-" (*-, compositor thread). , , , β€” . , .



, DevTools Layers.



image



15. *



=



, , *- *- ( "Update Layer Tree" Performance DevTools). , (, -), , , will-change CSS.



image



16. *- (layout tree) *- (layer tree)



, * , , . , , . Stick to Compositor-Only Properties and Manage Layer Count.



=



*- *-. *- . , , *- *- (raster threads). *- GPU.



image



17. *- GPU



*- *-, viewport ( ) . , , .



, *- , *- (draw quads), *- (compositor frame).



*- (draw quads)



, .



*- (compositor frame)



*-, .



IPC- *- *-. *UI- *- *- . *- GPU . , *- *- GPU.



image



18. *- *-. *- GPU



, . *- JavaScript. . , .





*. , .



*- , , , , .



Part 1

Part 2

Part 3 (current)

Part 4




All Articles