bi-08 step 03 — Forced synchronous layout and scroll geometry

Goal

Produce the canonical performance bug, quantify it, and connect it to the browser's own scroll behaviour.

Tasks

  1. Build the read/write loop. Measure at n = 100/1000/5000 and plot. Batch reads then writes; re-measure. Name the complexity class of each and explain why laziness is defeated.
  2. Find it in a trace. In DevTools, confirm the layout event count matches your iteration count.
  3. Locate the flush in Blink. Find where a geometry read forces style and layout to be current. Write down what "update style and layout" actually does when called mid-task.
  4. Scroll geometry. Read the coordinate-spaces and scroll sections of core/layout/README.md. Explain the difference between scroll origin, offset, and position, and construct an RTL case where they diverge.
  5. Scroll anchoring. Recall that 13 properties declare ["layout","scroll-anchor"]. Explain what the browser is doing for you, and note that fw-10 will make you implement it by hand.

Done when

  • Plot of forced-layout cost vs n, before and after batching
  • Layout event count in a trace matches the loop
  • Scroll origin/offset/position distinction written in your own words