Module flow

Source
Expand description

Flow layout, also known as block-and-inline layout.

ModulesΒ§

construct πŸ”’
float
Float layout.
inline
Inline Formatting Context Layout
root πŸ”’

StructsΒ§

BlockFormattingContext πŸ”’
CollapsibleWithParentStartMargin πŸ”’
ContainingBlockPaddingAndBorder πŸ”’
IndependentFloatOrAtomicLayoutResult πŸ”’
OutsideMarker πŸ”’
The contentes of a BlockContainer created to render a list marker for a list that has list-style-position: outside.
PlacementState πŸ”’
State that we maintain when placing blocks.
ResolvedMargins πŸ”’

EnumsΒ§

BlockContainer πŸ”’
BlockLevelBox πŸ”’

FunctionsΒ§

automatic_inline_size πŸ”’
Determines the automatic size for the inline axis of a block-level box. https://drafts.csswg.org/css-sizing-3/#automatic-size
block_size_is_zero_or_intrinsic πŸ”’
compute_inline_content_sizes_for_block_level_boxes πŸ”’
Finds the min/max-content inline size of the block-level children of a block container. The in-flow boxes will stack vertically, so we only need to consider the maximum size. But floats can flow horizontally depending on β€˜clear’, so we may need to sum their sizes. CSS 2 does not define the exact algorithm, this logic is based on the behavior observed on Gecko and Blink.
justify_self_alignment πŸ”’
Justifies a block-level box, distributing the free space according to justify-self. Note <center> and <div align> are implemented via internal β€˜text-align’ values, which are also handled here. The provided free space should already take margins into account. In particular, it should be zero if there is an auto margin. https://drafts.csswg.org/css-align/#justify-block
layout_block_level_children πŸ”’
layout_block_level_children_in_parallel πŸ”’
layout_block_level_children_sequentially πŸ”’
layout_in_flow_non_replaced_block_level_same_formatting_context πŸ”’
Lay out a normal flow non-replaced block that does not establish a new formatting context.
resolve_justify_self πŸ”’
Resolves the justify-self value, preserving flags.
solve_block_margins_for_in_flow_block_level πŸ”’
Resolves β€˜auto’ margins of an in-flow block-level box in the block axis. https://drafts.csswg.org/css2/#normal-block https://drafts.csswg.org/css2/#block-root-margin
solve_containing_block_padding_and_border_for_in_flow_box πŸ”’
Given the style for an in-flow box and its containing block, determine the containing block for its children. Note that in the presence of floats, this shouldn’t be used for a block-level box that establishes an independent formatting context (or is replaced), since the inline size could then be incorrect.
solve_inline_margins_avoiding_floats πŸ”’
Resolves β€˜auto’ margins of an in-flow block-level box in the inline axis similarly to |solve_inline_margins_for_in_flow_block_level|. However, they align within the provided rect (instead of the containing block), to avoid overlapping floats. In addition to the used margins, it also returns the effective margin-inline-start (see ContainingBlockPaddingAndBorder). It may differ from the used inline-start margin if the computed value wasn’t β€˜auto’ and there are floats to avoid or the box is justified. See https://github.com/w3c/csswg-drafts/issues/9174
solve_inline_margins_for_in_flow_block_level πŸ”’
Resolves β€˜auto’ margins of an in-flow block-level box in the inline axis, distributing the free space in the containing block.
solve_margins πŸ”’
Given the containing block and size of an in-flow box, determine the margins. Note that in the presence of floats, this shouldn’t be used for a block-level box that establishes an independent formatting context (or is replaced), since the margins could then be incorrect.