How the browser draws the page · mid
Style, layout, paint and composite
Changing layout properties (width, top) re-runs layout and paint; changing paint-only properties (color) re-runs paint; changing transform or opacity can skip both and only composite, which is why smooth animations use them.
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceThe notes
What you must know
- Reflow (layout) = recompute geometry; repaint = redraw pixels; composite = combine layers on the GPU.
- Layout triggers: width, height, margin, top/left, font-size, adding nodes. Paint only: color, background, box-shadow.
- Composite only: transform and opacity (on a promoted layer). will-change: transform hints a layer; overusing it costs memory.
- contain and content-visibility: auto can limit how much layout work a change causes.
The red pen
Common traps: mistake → fix
Mistake: "reflow and repaint are the same"
Fix: layout is the expensive geometry step; repaint can happen without it.
Mistake: "animating left is as smooth as transform"
Fix: left triggers layout every frame.
Easy to hard
Questions interviewers ask, easy to hard
- Reflow vs repaint?
- Why animate transform instead of top?
- What is a compositor layer?
Explain it out loud
Explain it out loud to an AI interviewer that follows up, and see where your answer is thin.
Practise by voiceYour first interview is free
Sign up and start with a 15-minute interview with the full report, and an English conversation. No card needed.