Web browsers perform two main tasks: parsing and rendering. During parsing, it converts bytecode into nodes, and organise them as DOM. Then it renders DOM, ie. each presentational node is displayed on screen
Rendering Waterfall CSSOM → Layout → Paint → Composite
3 types of UI change
Reflow
: trigger layout re-creation. Expensive process.Repaint
: only pixels are updatedRecompose
: seperate layer is changed. e.g. opacity
, transform
. Cheapest, uses GPU and run in seperate thread from mainLayer creations happen for
3D
stuff ; <canvas>
with 3D (WebGL)<video>
with accelerated video decodingfilters