-
Notifications
You must be signed in to change notification settings - Fork 756
Description
I find the definition of formatting context in the spec a bit unclear.
A formatting context is the environment into which a set of related boxes are laid out.
What is an "environment"? This is one of those typical blanket words. Without giving a definition of environment, this sentence is not saying much. I'll take for now FC as synonym with "box layout", where layout is a visual arrangement.
A box either establishes a new independent formatting context or continues the formatting context of its containing block.
So each box establishes a formatting context (defines a layout) for its descendant boxes. This makes sense, since its descendant subtree must be laid out somehow. But what does "continue a formatting context" mean here? How can one box nested inside another can continue in the identical layout the other is in? After all the nested box is visually "inside" the other box. Does "continue" rather mean the box establishes a new formatting context of the same type as the one of its containing block?
Also I'm not sure if "containing block" is correct here. It's defined in the specific layout "Positioned Layout" which is one type of layout of many (Flow / Block-Inline, Grid, Flex, Table), so using it as part of the definition of layouts in general is kind of circular.
The type of formatting context established by the box is determined by its inner display type
An inner display type is defined for an element, not for a box. The inner display type may even generate multiple boxes with each different formatting contexts, like for display: table.
As an aside, there are more definitions that are circular, like for example of "inline box"
A non-replaced inline-level box [box that participates in inline formatting context] whose inner display type is
flow.
Ok, same problem to above, a box doesn't have a display type, the associated element does. But let's read on what inner display type flow does.
If its outer display type is inline [..], and it is participating in a block or inline formatting context, then it generates an inline box.
Ugh. Am I the only one that has a hard time making sense of the current spec?