Rendering converts computed styles and document content into pixels through three stages: layout, paint, and composite. section 16.3.1
The pipeline proceeds as follows:
- Layout calculates each element’s size and position, including the effects of document flow and DOM changes. section 16.3.1
- Paint draws text, images, borders, and shadows into memory-based layers. section 16.3.1
- Composite combines painted layers; suitable layers may be sent to the GPU for hardware acceleration. section 16.3.1
Changing size versus color
Changing an element’s width or height requires layout recalculation and may reflow surrounding content. Changing its background color requires repainting but does not require layout recalculation, making it less computationally intensive. section 16.3.1
Figure 16.12 The three stages of the rendering pipeline
Use the pipeline diagram to trace how computed styles become displayed pixels. section 16.3.1



