Skip to content
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-sizing] fill-available sizing should be clearer about margin collapsing #923

Open
dbaron opened this issue Jan 13, 2017 · 4 comments
Open

Comments

@dbaron
Copy link
Member

dbaron commented Jan 13, 2017

The section of css-sizing on fill-available sizing should be clearer about margin collapsing. Margin collapsing is quite complicated, and it's not clear what "less the box’s inline-axis margins (after any margin collapsing, and treating auto margins as zero)" means. In other words, what is a margin of the box after margin collapsing? Which margins are associated with which boxes, etc.? (Remember that this definition recurses to the containing block, and you thus need to be careful not to consider the same margin twice.)

Also, note that this prose is all actually important not for the case as written, but for "The fill-available block size of a box is defined analogously, but in the other dimension."

@dbaron dbaron added the css-sizing-3 Current Work label Jan 13, 2017
@dbaron dbaron changed the title [css-sizing] fill-available sizing should be clearer about margin collaapsing [css-sizing] fill-available sizing should be clearer about margin collapsing Jan 13, 2017
@tabatkins
Copy link
Member

After discussion, fantasai and I think we can get away with just making the text simpler, and saying that for this purpose you should treat the margins as non-collapsing. It's much simpler, has no effect in many layout modes (flex and grid items never collapse margins), and tho it can sometimes cause issues in block layout, they're usually avoidable.

An alternative is to assume that the element is definitely collapsing its margin with its parent (if the parent allows that); in other words, ignoring any possible intervening siblings.

Thoughts?

@tabatkins
Copy link
Member

Actually, tracking this algorithm backwards, we find that the "accounting for collapsing margins" concept comes from your original algorithm, back in 2009.

If you could remember what you meant by that 8 years ago, we can just amend the spec accordingly. ^_^

@dbaron
Copy link
Member Author

dbaron commented Feb 18, 2017

The other possibility is that it causes margins to not collapse. That's already sometimes the case (at the block-end edge... even though it might cause things to line up perfectly so the margins are "touching" even though they're not officially "adjacent"), so maybe it would make sense to make it true all the time?

@fantasai fantasai added css-sizing-4 and removed css-sizing-3 Current Work labels Nov 5, 2017
@fantasai
Copy link
Collaborator

I think this issue is solved now... See related discussion in #1614

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants