Module layout_2020::flow
source ยท Expand description
Flow layout, also known as block-and-inline layout.
Modulesยง
Structsยง
- FlowLayout ๐
- 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ยง
- 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.
- This is supposed to handle โjustify-selfโ, but no browser supports it on block boxes. Instead,
<center>
and<div align>
are implemented via internal โtext-alignโ values. 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 - Lay out a normal flow non-replaced block that does not establish a new formatting context.
- 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
- A block-level element that establishes an independent formatting context (or is replaced) must not overlap floats. This can be achieved by adding clearance (to adjust the position in the block axis) and/or modifying the margins in the inline axis. This function takes care of calculating them.
- 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.
- 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
- 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.