-
Notifications
You must be signed in to change notification settings - Fork 707
[css-display] BFC roots may not be block boxes #1471
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
Comments
That quote is about informal use of the abbreviation, and it's usually in sutuations where you need to distinquish the two kind of block boxes — those that don't contain floats and margins of their descendants and those that do. It's rarely used for inline-blocks, tables etc., since they always contain these things. But I agree that this note can be understood as a definition of the block formatting context root, so it's worth to correct it as you suggested. |
Alright, the new prose now says BFC
Let me know if there needs to be any further edits. Note that this term does not appear in specs, only in discussions about CSS outside of specs. |
I disagree with some things:
|
Regarding the last point, flex/grid items and table cells/captions do establish the BFC for their content, so table wrappers and flex/grid containers effectively fit the definition of block-level boxes that "contain internal floats, exclude external floats and suppress margin collapsing" (though are not BFC roots themselves). Maybe it should be mentioned as a separate note after the BFC definition (not as its part)? Also, although the terms "BFC" or "BFC root" aren't used in the spec, definitions like "an element in the normal flow that establishes a new block formatting context" are used in CSS2.x. Wouldn't it make sense to make the term normative and use it there instead, for brevity and readability? |
@Loirooriol It's important to note the purpose of this definition - it's not to provide spec prose, it's to give a helpful search-friendly term that hopefully people will land on when they see the term "BFC" thrown around on Stack Overflow or something. Thus why it's referring to "informal" definitions.
Informally, it often refers to the box itself as well. We use that a lot when discussing the spec, and people throw it around when discussing hacks - things like "you need to make the div a BFC so it'll contain the floats".
Because they're different and don't repeat themselves. "Block container" includes inline-blocks, which we do indeed sometimes include when talking about BFCs. But sometimes it's used to refer solely to block-level ones; for example, when we discuss the four flow values, we often refer to
Again, we're talking about informal definitions. If you're, for example, trying to understand how a flex container with a preceding sibling float behaves, it's not uncommon to call the flex container a "BFC" informally, because this term is already heavily used when describing the "overflow:hidden" hack for blocks, and similar tricks to trigger the creation of a block formatting context.
No, they establish formatting contexts. Only flow-layout stuff establishes block formatting contexts.
Not particularly. The term isn't used all that often anyway, and we're often referring to the more generic notion of formatting contexts. Normatively using an acronym would just make it more jargon-y. |
I prefer "BFC root", but I guess it's OK when being informal.
OK, I didn't get the points represent different possible definitions. I thought it was a single definition. Maybe say "and may refer specifically to one of: ..."
I have never seen this, and I think including it in the spec will cause much more confusion than what you are attempting to address by being informal. I do think there should be some term to refer to formatting contexts other than inline and ruby, maybe "strong FC", "real FC" or similar. |
Could you please clarify this a bit?
Second, both Flexbox and Grid specs say that
Doesn't it mean that, if the item has |
Commits on Jul 6, 2017 Note that 'display: contents' does not affect property inheritance. Fixes w3c/csswg-drafts#1473 w3c/csswg-drafts@356b3296d5b20e00bedbfa8d1db59 d005a73bfc9 Normatively define what was in the previous note: that run-in fixup occurs before first line determination. w3c/csswg-drafts@37c01a4ef94aec7c352c3dc7c5cfc 31f8898ed4d Move computed value bullet before box generation bullet. w3c/csswg-drafts@5d10db8d8665f52994530304f2ddc 88236d37ccb Clarify that run-in fixup occurs before block/inline fixup. w3c/csswg-drafts@6f6913e20851f50ad81ca3cb43a49 9c01e8b2186 Expand out informal definitions of BFC. Also fixes w3c/csswg-drafts#1471 . w3c/csswg-drafts@388b1fb3bfa7dbe2ed112581322d2 a10787c9121 Refer to 'flow layout' directly, rather than just mentioning the types of boxes that flow layout can produce. Fixes w3c/csswg-drafts#1470 . w3c/csswg-drafts@09212af80e10e4e3e57965bb27b2d e3fdcd86e06 Make the run-in recursion explicit, so it's clear the second step doesn't recurse. Fixes w3c/csswg-drafts#1460 . w3c/csswg-drafts@c9f1bb16d0e5077b9bca7027a7d72 52eeff5abf1 Be a little looser about what counts as abspos, because css-lists defines as out-of-flow. Fixes w3c/csswg-drafts#1458 w3c/csswg-drafts@f7ff60660c3b5e1b31000ffa0f729 ba04f13a2f8 Remove the w3c/csswg-drafts#1390 inline issue. w3c/csswg-drafts@4514b3e7f2f0aa8ef95a84c107fb9 90fc2def209 Add note about the two categories of box-tree fixup, and their relative ordering. Fixes w3c/csswg-drafts#1355 . w3c/csswg-drafts@f5b79e99bb8fc9ebea4ed956ed342 0bc69b90786 Apply diff, per resolution. Fixes w3c/csswg-drafts#1118 . w3c/csswg-drafts@dbb7042481d132efcb6869ecbdf44 f338d8ad944
@SelenIT I think Tab meant that a flex item does not necessarily establish a BFC, e.g. if it has |
After ffc79e4 it's much more clear, thanks. |
The definition of BFC in the glossary says
Correct me if I'm wrong, but I think a BFC root is just a box that establishes a BFC. It's not necessary block-level, so it may not be a block box. For example an inline-block is an inline-level BFC root.
Instead of "block box" I would say "block container" or just "box".
The text was updated successfully, but these errors were encountered: