Skip to content

[css-inline-3] [css-display-3] Root inline box description conflicts with "Inline Layout Box Model" diagram #5555

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
twilco opened this issue Sep 28, 2020 · 4 comments
Labels
css-inline-3 Current Work

Comments

@twilco
Copy link
Contributor

twilco commented Sep 28, 2020

Quoting https://drafts.csswg.org/css-inline-3/#model:

The block container also generates a root inline box, which is an anonymous inline box that holds all of its inline-level contents. (Thus, all text in an inline formatting context is directly contained by an inline box, whether the root inline box or one of its descendants.)

And quoting https://drafts.csswg.org/css-display-3/#block-container:

A block container that contains only inline-level content establishes a new inline formatting context. The element then also generates a root inline box which wraps all of its inline content. Note, this root inline box concept effectively replaces the "anonymous inline element" concept introduced in CSS2§9.2.2.1.

These passages imply that each block container only generates a singular root inline box, and that this root inline box wraps all inline-level content present in the block container. However, that immediately conflicts with the "Inline Layout Box Model" diagram that is also in https://drafts.csswg.org/css-inline-3/#model, which shows multiple root inline boxes each wrapping separate pieces of inline-level content within the block container:

CSS Inline Layout Box Model, shows three root inline boxes nested within separate line boxes

This notion of multiple root inline boxes also seems to be well established outside the spec — see #1477 (comment) and #1477 (comment), both of which layout the given example with multiple root inline boxes.

What is correct — multiple root inline boxes per block container, or one?

@Loirooriol
Copy link
Contributor

I think there is a singe root inline box, which can have multiple fragments. And the diagram is pointing to some of these fragments.

@fantasai
Copy link
Collaborator

Exactly as @Loirooriol explains, the diagram is pointing to the various fragments of the root inline box. Perhaps it would be better to place the diagram after the section describing fragmentation into line boxes.

fantasai added a commit that referenced this issue Sep 28, 2020
@fantasai fantasai added the css-inline-3 Current Work label Sep 28, 2020
@fantasai
Copy link
Collaborator

@twilco Moved the diagram. Let me know if this is adequate or if there's some other clarification that would help?

Note that #1477 is about block-in-inline splits, which is a bit of a different case. (For one thing, it involves inlines being split across multiple block containers.)

@twilco
Copy link
Contributor Author

twilco commented Sep 29, 2020

Thanks, that spot looks better. This makes sense to me now, so closing this out.

@twilco twilco closed this as completed Sep 29, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-inline-3 Current Work
Projects
None yet
Development

No branches or pull requests

3 participants