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.
- OofBox
Layout 🔒 - The result of laying out a single out-of-flow box with
layout_oof_box. - OofLayout
Result - 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 (
Startis the logical start edge of the containing block).
Functions§
- align_
in_ 🔒line - Position a box of
sizewithincontainerso that it is aligned to the given physical edge - compute_
oof_ layout - Run the out-of-flow positioning pass for
node_idafter its layout algorithm has producedoutput: lay out the out-of-flow candidates inoutput.oof_candidatesfor which the node is the containing block, record them as the node’s hoisted children, and replaceoutput.oof_candidateswith the unclaimed remainder (which bubble further up the tree). The scrollable overflow contributed by the claimed boxes is merged intooutput.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
unclaimedfor 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