[css-flexbox][css-align] Need clarification on `auto` margins for abspos flex children (do they collapse or expand) #665
The CSS Alignment & CSS Flexbox specs are unclear on the effects of
WHAT DO BROWSERS CURRENTLY DO:
TESTCASE (comparing normal flex items to abspos flex items, with "auto" margins):
Here's most relevant css-flexbox spec quote I could find:
This doesn't mention margins at all, and it leaves the implication that (a) the margin-box is what's aligned (just as with normal flex items) and (b)
Here's the most relevant css-align spec quote I could find:
This, too, doesn't make it clear that there would be any distinction between the handling of auto margins for abspos flex children vs. "real" flex items. (I suppose it depends on whether "laying out the element" includes "resolving auto margins", and (if so) what's expected to happen there.)
The text was updated successfully, but these errors were encountered:
Here's a version of my testcase with a block instead of a flexbox for the container: https://jsfiddle.net/yyayrn3n/
Based on this testcase, it looks like browsers interoperably collapse "auto" margins on abspos children of CSS blocks. So, I suspect Chrome/Edge's analogous flexbox behavior is sensible (in that it's consistent with the traditional special-zeroing of auto margins on abspos elements in other contexts).
So, I think the alignment spec just needs a bit of clarification to make this more explicit, since IMO it's not at all clear (from the spec) that this behavior is correct right now.
I was very confused by this topic, because the margins aren't "collapsing" in the sense of the technical term "collapsing margins". ^_^
Anyway, margins are indeed part of "laying out", but if browsers are interoperable with something else, and they do the same with other layout modes, then, uh, sure, might as well define that
Fix error introduced in earlier commit. w3c/csswg-drafts@d09288f 464962a3fe6 Define main size/cross size for flex containers. (Curre… w3c/csswg-drafts@0c8e129 c108da74e59 While the intrinsic sizing steps here guarantee that we… w3c/csswg-drafts@e65d3f6 4b0960a2711 Per w3c/csswg-drafts#665 , specify that auto margins are treated as zero… w3c/csswg-drafts@4fae49a 7107d447f4d Make propdef table more useful. w3c/csswg-drafts@25a917b 794ecdd1be0 Restore accidentally-deleted text about table wrapper b… w3c/csswg-drafts@277d9d3 3a6582f26f9 Fix w3c/csswg-drafts#436 w3c/csswg-drafts@e377000 0eea2daade6 Fix main/cross mixup. #792 w3c/csswg-drafts@16d913f 260279f52b1 変更点の節を別ページに分離
…lculating static position. #665