Skip to main content

Module oof

Module oof 

Source
Expand description

Shared positioning pass for out-of-flow (position: absolute / position: fixed) boxes.

Layout algorithms do not lay out their out-of-flow children directly (unless they are the child’s containing block). Instead they emit OofCandidate records which bubble up the tree via LayoutOutput::oof_candidates until they reach the box’s containing block, which lays the box out using the routine in this module.

Structs§

OofAxis 🔒
The inputs to the absolute positioning layout model (https://www.w3.org/TR/css-position-3/#abspos-layout) in a single axis. All coordinates are physical (left-to-right / top-to-bottom) and relative to the start of the containing block’s inset-resolution area.
OofBoxLayout 🔒
The result of laying out a single out-of-flow box with layout_oof_box.
OofLayoutResult
The result of laying out out-of-flow candidates against an explicit positioning area.

Enums§

OofAlignment 🔒
The self-alignment of an out-of-flow box in one axis, resolved relative to the writing mode of its containing block (Start is the logical start edge of the containing block).

Functions§

align_in_line 🔒
Position a box of size within container so that it is aligned to the given physical edge
compute_oof_layout
Run the out-of-flow positioning pass for node_id after its layout algorithm has produced output: lay out the out-of-flow candidates in output.oof_candidates for which the node is the containing block, record them as the node’s hoisted children, and replace output.oof_candidates with the unclaimed remainder (which bubble further up the tree). The scrollable overflow contributed by the claimed boxes is merged into output.scrollable_overflow_rect.
compute_oof_layout_for_area
Lay out out-of-flow candidates against an explicit positioning area.
layout_oof_box 🔒
Size and position a single out-of-flow box against its containing block, and store its layout.
perform_oof_layout 🔒
Perform final layout on the out-of-flow candidates for which the current node is the containing block, and collect the remainder into unclaimed for further bubbling.
resolve_static_offset
Resolve the final static offset of an out-of-flow box from its static position, given the box’s final size and resolved margins.
resolve_static_offset_axis 🔒
Single-axis version of resolve_static_offset