Skip to main content

layout_oof_box

Function layout_oof_box 

Source
pub(crate) fn layout_oof_box<Tree: LayoutContainingBlock>(
    tree: &mut Tree,
    candidate: OofCandidate,
    area_size: Size<f32>,
    area_offset: Point<f32>,
    direction: Direction,
    container_overflow: Point<Overflow>,
    grid_owner: Option<NodeId>,
    before_layout: impl FnOnce(&mut Tree, &LayoutInput),
) -> OofBoxLayout
Expand description

Size and position a single out-of-flow box against its containing block, and store its layout.

  • area_size/area_offset describe the inset-resolution area of the containing block (border box minus borders and scrollbar gutters), relative to the containing block’s border box.
  • container_overflow is the overflow style of the containing block, which determines whether overflowing boxes may be aligned into its scrollable overflow area.
  • grid_owner is the node whose detailed layout info is consulted for grid placement: if it is a grid container, the box is positioned relative to the grid area determined by its grid-placement properties rather than the passed area.
  • before_layout is called with the inputs of the final layout pass just before it runs, which allows the caller to inspect the layout cache for the box.