-
Notifications
You must be signed in to change notification settings - Fork 682
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
[css-break] "break adjoining margin" needs clarification #6763
Comments
FYI, "adjoining" is described in some detail here: https://www.w3.org/TR/CSS22/box.html#collapsing-margins |
That's what we thought. However, that specifies the "adjoining" condition for two margins of two boxes. So should we consider the break to be a "pseudo-margin" and, if so, where in the box tree should it be? Also, as an additional help for us to understand the expected result, could you have a look at the following pseudo-document and let us know which of the elements 1 - 12 have their margin-bottom actually influence the layout (i.e. not truncated to 0 or otherwise eliminated)?
|
That's impossible to say without knowing which elements contain content, or are empty, and which ones have non-zero padding/border etc. But there are a few things we can say: for example, flex container’s margins do not collapse with the margins of its contents so you know that any flex containers won't propagate any of its descendants' margins (ditto for grid containers btw). The margin-bottom of flex-09 may collapse with its ancestors (block-08, block-07) but that depends on if there's any padding/border in the way. (Note also that the margin-top of item-04, block-06, block-07, block-08, flex-09 may also propagate all the way through, but that only happens if it's actually "adjoining", which only occurs when all the intervening boxes have zero height, no padding/border etc. (i.e. the top/bottom margin of a box collapse when there is zero space between them, aka adjoining). I'm guessing that's not your problem here.) It would help if you could describe what the actual problem is you are trying to solve, and provide an URL to a fully working testcase that demonstrates that problem. Otherwise, we're very likely to talk past each other because the details matters.
I think you can think of it like this: any margin that propagates out from the end of block-07, or at the start of block-13, is treated as if it doesn't exist. |
Thanks for the detailed response. We don't have a specific problem case but are generally unsure about how to interpret the wording of the specification. Though we think we now have understood it and can correct our implementation. Our current implementation eliminates bottom margins of boxes that are in the last branch of a fragment container in the box tree, but only if that bottom margin collapses with all bottom margins of its parent chain up to the child of the root of the fragment container. The correction, as we understand now, would be to only check for collapsing up to the last ancestor that is not fragmented across the following break. (The fragmented ancestors have the bottom margin truncated anyway.) We'd appreciate confirmation of this. Also, we hope that our misunderstanding can help you improve the wording of the specification. |
https://www.w3.org/TR/css-break-3/#break-margins specifies "When an unforced break occurs before or after a block-level box, any margins adjoining the break are truncated to zero. When a forced break occurs there, adjoining margins before the break are truncated..."
We think it should be clarified what "margins adjoining the break" and "adjoining margins" mean exactly.
We have assumptions, but don't agree entirely.
The text was updated successfully, but these errors were encountered: