bi-15 step 01 — Traces 1–3: classList.add, getBoundingClientRect, DOM insertion
Goal
Three traces whose lesson is what is skipped.
Tasks
Trace 1 — classList.add('active') (after bi-07)
- Case where no rule mentions
.active: show that nothing is invalidated. - Case where a colour-only rule matches: style + paint, no layout.
- Case where a width-affecting rule matches: full pipeline.
- Cite
css_properties.json5invalidate:for each property involved. - Construct a variant where the same visual change invalidates ~100× more elements.
Trace 2 — getBoundingClientRect() (after bi-08)
- Cost when nothing is dirty vs everything.
- Build the read/write loop; measure at n = 100/1000/5000; state the complexity class.
- Find where the trace attributes the forced layout.
Trace 3 — appendChild (after bi-04)
- Enumerate everything that happens before the pointer update.
- When are custom element reactions and mutation records delivered?
- Compare inserting into a detached tree vs the live document.
Done when
- Each trace names process, thread, and deferred-vs-immediate at every step
- Each has a constructed variant that changes which layers run
- Evidence type (source / trace / debugger) recorded per layer