The Fragment Tree Spine: Blink's Immutable Layout Reconstruction
from Blink286 Hosted by Free Debreuil
The provided sources describe the fragment tree spine in Blink, which is the architectural "backbone" of cached ancestor fragments that must be updated following a localized subtree relayout. Because Blink’s modern LayoutNG framework treats the fragment tree as an immutable output used for painting and hit-testing, isolated changes to a descendant subtree leave older ancestor fragments pointing at stale data. To resolve this, the spine repair mechanism climbs the containing box chain, shallow-cloning each cached LayoutResult and PhysicalBoxFragment to re-stitch them to the latest post-layout children. This process ensures structural consistency throughout the fragment tree without requiring a full, expensive relayout of the entire document. The system is tightly integrated with relayout boundaries, fragmentation rules, and pre-paint invalidation to maintain performance and safety during incremental updates. Ultimately, the spine serves as the essential link that reconciles localized layout changes with a durable, read-only rendering hierarchy.
Embed this episode
No transcript yet.