Software / Browser
The render pipeline
A change becomes pixels in stages. Some stages can be skipped. Knowing which one you touched is the performance question.
Browser Render Pipeline
Which pipeline stages a CSS property triggers determines its cost. Properties like transform and opacity on composited layers skip layout and paint entirely — the GPU reassembles pre-rasterized layers. Properties like width invalidate all stages.
Document Object Model
Live tree of nodes. Script mutations trigger style recalc. documentFragment batches insertions off-tree. TreeWalker traverses efficiently. Range works across arbitrary node boundaries. MutationObserver callbacks fire as microtasks.
- Node
- Element
- DocumentFragment
- TreeWalker
- Range
- MutationObserver
CSSOM + Cascade
Style resolution order: origin → cascade layers → specificity → source order. getComputedStyle returns resolved values (forces style flush). @layer adds an explicit origin tier — which rule wins, not which file is requested. Delivery is a separate schedule. @property enables typed custom properties with registered syntax.
- @layer
- specificity
- @property
- :is() :where()
- custom properties
Layout (Reflow)
Computes box geometry. Reading layout properties (offsetWidth, getBoundingClientRect) after mutations forces a synchronous reflow. contain: layout limits reflow scope. ResizeObserver fires before paint after each reflow.
- contain: layout
- will-change
- ResizeObserver
- intrinsic sizing
Compositing Layers
transform, opacity, and filter on a promoted layer skip layout and paint — the GPU reassembles pre-rasterized bitmaps. will-change: transform promotes eagerly (memory cost). content-visibility: auto skips layout/paint for off-screen content.
- will-change
- GPU layer
- content-visibility
- isolation: isolate