Class Hierarchy
Overview
DOM elements & Renderers
- Document elements create RenderView.
- HTMLHtmlElement, HTMLBodyElement, HTMLDivElement etc elements create
RenderBlockFlow (for the default CSS display value).
- HTMLIFrameElement elements create RenderIFrame.
Scrollable Areas
- A MainFrame is created for each document.
- A Frame is created for each HTMLIFrameElement.
- A RenderLayer is created for each RenderLayerModelObject when
RenderLayerModelObject::requiresLayer() returns true.
Scrolling Nodes
A RenderLayer creates a RenderLayerBacking if RenderLayerCompositor::needsToBeComposited(layer) returns true. This relies on RenderLayerCompositor::requiresCompositingLayer and (for iframe) on RenderLayerCompositor::requiresCompositingForFrame.
The following backtrace is executed to make a layer scrollable:
RenderLayerCompositor::updateScrollCoordinatedLayer(RenderLayer& layer, LayerScrollCoordinationRoles reasons)
RenderLayerCompositor::updateScrollCoordinatedStatus(RenderLayer& layer)
RenderLayerCompositor::didAddScrollingLayer(RenderLayer& layer)
RenderLayerBacking::updateScrollingLayers(bool needsScrollingLayers)
RenderLayerBacking::updateConfiguration()
The conditions for requiring a scrolling layer is:
- On iOS, RenderLayer::hasTouchScrollOverflow().
- Otherwise, RenderLayer::needsCompositedScrolling() which is updated
in RenderLayer::updateNeedsCompositedScrolling(). It is always false if
associated FrameView does not contain any ScrollableArea child.
The reasons to update the scroll coordinated layer include:
- ViewportConstrained:
- "display: sticky" layers creates StickyNode.
- "display: fixed" layers creates FixedNode.
- Scrolling:
- The root layer (owning the RenderView) creates a FrameScrollingNode.
- Other layers creates OverflowScrollingNode.