Listen

Description

The provided sources offer an extensive, line-by-line analysis of Blink’s rendering function, FragmentPaintPropertyTreeBuilder::UpdateScrollAndScrollTranslation(), which is critical for implementing scrolling behavior in Chrome. This function manages the creation and updating of two primary data structures: the Scroll Property Node (which defines the logical scroll container, including its viewport, content size, and CSS properties like overscroll behavior and scroll snapping) and the Scroll Translation Transform Node (which applies the negative scroll offset as a geometric translation to descendant content). The process is part of RenderingNG, which uses separate property trees (Transform, Clip, Effect, Scroll) to achieve efficient, incremental updates. The method ensures that only scrollable objects receive these nodes, updates related scrollbar Effect Nodes, and implements optimizations like directly updating the compositor's transform for simple scroll offset changes without rebuilding the entire paint artifact.