Expand description
Layout context — shared state for a layout pass.
Chrome equivalent: the combination of LayoutView (document-level state)
and NGLayoutAlgorithmParams (per-algorithm context).
LayoutContext is created once per layout pass and threaded through
every algorithm call. It carries dependencies that algorithms need
but should NOT hardcode (text measurement, font system, etc.).
§Why a struct, not individual parameters?
- Adding a new dependency (e.g., image loader) doesn’t change every function signature in the call chain.
- Algorithms can’t accidentally create their own measurer — they MUST use the one provided.
- Mirrors Chrome: algorithms receive context, not individual services.
Structs§
- Layout
Context - Shared context for a layout pass.