-
Notifications
You must be signed in to change notification settings - Fork 711
[css-break] what happens to block margins that aren't between block-level boxes? #3073
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
Note that you're only allowed to break there if there's a gap: https://www.w3.org/TR/css-break-3/#possible-breaks |
Wrt sibling boxes, I think the multicol balancing case wasn't really thought through on this point... Probably the margin should be truncated to zero both before and after an unforced break. I'm uncertain what should happen with a forced break though... Probably the margin should count as content on the earlier fragmentainer for the purpose of balancing, but should be allowed to truncate if the fragmentainer height is too short to include the margin. |
Proposal: treat these margins exactly like margins between siblings, i.e. margins before/after an unforced break are truncated to zero, margins after a forced break are preserved, and margins before a forced break are truncated. @dbaron Does that make sense to you? |
(@dauwhe says this makes sense to him, fwiw.) |
It's not entirely clear to me what will happen in all the balancing cases; it might produce some surprising results. I guess truncation is at least well-defined in that moving content from one column to another will not cause the column losing content to grow or cause the column gaining content to shrink... at least as long as there aren't negative margins. (I think the author of this testcase wasn't expecting any truncation, though, and was expecting margins to continue across multiple columns. I guess my original concern wasn't really a fundamental problem, but rather the violation of expectations.) |
I think web authors probably won't expect truncation, however I think @fantasai's proposal will give the most pleasing results ultimately, and if the behaviour is well defined and can be explained (and is consistent cross-browser) then I think it works. |
@dbaron Wrt the author of the testcase not expecting truncation... truncation is what currently happens if you break between siblings, so I think it would be more surprising if it didn't happen after the last child? |
The CSS Working Group just discussed
The full IRC log of that discussion<dael> Topic: what happens to block margins that aren't between block-level boxes?<dael> github: https://github.com//issues/3073 <dael> fantasai: This was the one issue open on fragmentation. dbaron suggested we can resolve <dael> fantasai: What happens to margins...we have def when breaking between siblings, but not if you break before the first sibling or after the last. <dael> fantasai: Typically you don't break there, you break before or after parent. You're only allowed to break there if there's a gap. If there's just extra space after layout you can break <dael> fantasai: Proposed is do same as break at siblings. Truncate margins if forced, don't if unforced. <dael> fantasai: Where that shows up is if you are in a multicol and you hae a much of stuff that breaks. You can tell if you truncated margin b/c height of multicol will be different if margin is there <dael> Rossen_: Behavior sounds reasonable. This is what dbaron is proposing. <dael> Rossen_: Other opinions? <dbaron> yeah, sounds good to me... though not sure that it's what I was proposing <dael> fantasai: He jsut wanted a definition. not sure if he wanted a specific one <dael> dbaron: I don't think I was proposing something. sgtm <dael> Rossen_: Objections to define that margin collapsing between first or last child behaves same as between sibling children ? <dael> RESOLVED: define that margin collapsing between first or last child behaves same as between sibling children <dael> fantasai: That's in L4, I'll edit into L3 then republish with that <dael> Rossen_: Yes <dael> florian: L3 is CR <dael> fantasai: We resolved to publish already. There's just this one issue made sense to close it <dael> Rossen_: Obj to republish CR of Break L3 with this change? <dael> RESOLVED: republish CR of Break L3 with this change |
cc me |
@fantasai Looking good! |
There's a section of the spec that defines what happens to block margins that are between block level boxes:
But what about margins that aren't between block level boxes, such as a
margin-block-start
of the first child of a block formatting context (BFC), or amargin-block-end
of the last child of a BFC?Also see bug 1487927 about how this relates to column-balancing inside of a multicol... in interesting ways.
The text was updated successfully, but these errors were encountered: