Hit Testing Architecture in Blink and Chromium
Blink2862 Helmi

Hit Testing Architecture in Blink and Chromium

This document explores the technical architecture of hit testing within the Chromium and Blink engines, the process used to link user input to specific interface elements. The system operates across multiple processes and threads, using the Viz compositor to route events correctly, especially when dealing with out-of-process iframes. While the Blink main thread performs the final, precise mapping using the layout tree and paint order, the compositor thread handles high-speed tasks like scrolling to minimize latency. Special mechanisms are also described for accessibility hit testing, which prioritizes immediate responsiveness through asynchronous tree updates. To maintain high performance, the engine employs caching strategies and coordinate translations that account for CSS transforms and device scaling. Overall, the text highlights how Chromium balances accuracy and speed by coordinating various rendering layers and hardware-accelerated components.

Jaksot(389)

gpu::SkiaOutputSurfaceImplOnGpu / gpu::CommandBuffer

gpu::SkiaOutputSurfaceImplOnGpu / gpu::CommandBuffer

Bridges Skia’s recorded commands to the GPU command buffer; submits and SwapBuffers to present. (Backend: GL/Vulkan/Metal via GPU process.)

23 Syys 202532min

viz::SkiaRenderer

viz::SkiaRenderer

Renderer that turns quads into Skia operations (recording DDLs / drawing to the output surface).

23 Syys 202552min

viz::Display

viz::Display

The display compositor that walks the aggregated render passes and issues draw commands for the final output.

23 Syys 202538min

cc::LayerTreeHostImpl (Input Handler & Scroll Logic)

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...

23 Syys 202527min

blink::EventHandler (Blink core input handling)

blink::EventHandler (Blink core input handling)

Scroll chain builder and overscroll chaining logic. Blink’s EventHandler is responsible for building the scroll chain (the sequence of nested scrollable ancestors) when the user scrolls an element . I...

23 Syys 202526min

blink::ElasticOverscrollController

blink::ElasticOverscrollController

Overscroll orchestration and animation. This Blink-side controller manages the rubber-banding (elastic stretch and rebound) effect when a scrollable area is overscrolled. It observes gesture scroll ev...

23 Syys 202526min

viz::Surface / SurfaceAggregator

viz::Surface / SurfaceAggregator

Receives frames from one or more surfaces (main page and OOPIFs), aggregates them into a single display frame.

23 Syys 202535min

viz::CompositorFrameSink (client side)

viz::CompositorFrameSink (client side)

The submission interface used by cc to hand the frame to viz.

23 Syys 202531min