Module layout_2020::flow
source ยท Expand description
Flow layout, also known as block-and-inline layout.
Modulesยง
Structsยง
- Flow
Layout ๐ - Outside
Marker ๐The contentes of a BlockContainer created to render a list marker for a list that haslist-style-position: outside
. - Placement
State ๐State that we maintain when placing blocks. - Resolved
Margins ๐
Enumsยง
- Block
Container ๐ - Block
Level ๐Box
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
- 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.