cc::LayerTreeHostImpl (Input Handler & Scroll Logic)
Blink28623 Syys 2025

cc::LayerTreeHostImpl (Input Handler & Scroll Logic)

Scroll processing and overscroll detection in the compositor. The LayerTreeHostImpl in cc implements the compositor-thread InputHandler that processes gesture scroll updates and flings. It manages the scroll state of all scroll nodes (via the ScrollTree) and determines when a scroll has hit the extent of an element. Currently, this is where overscroll is detected and reported – but only for the root/viewport. For example, the InputHandler sets did_overscroll_root in the scroll result when the root scroll node reaches its boundary , triggering the elastic effect on the root. To support elastic overscroll on non-root elements, this logic in LayerTreeHostImpl (and its ScrollTree/ScrollNode handling) needs to be generalized: it must detect overscroll on any scrollable node and initiate the overscroll animation (via the helper/controller) for that node instead of chaining upward. Understanding LayerTreeHostImpl and how it yields overscroll information (e.g. populating InputHandlerScrollResult.unused_scroll_delta, accumulated overscroll, and overscroll_behavior flags ) is key, as changes here will route overscroll into the ElasticOverscrollController for the right element rather than exclusively the root.