Update intrinsic sizing of flex containers (e.g. container max-content width) to new spec text
Categories
(Core :: Layout: Flexbox, defect)
Tracking
()
People
(Reporter: dholbert, Unassigned)
References
(Blocks 3 open bugs)
Details
Per http://lists.w3.org/Archives/Public/www-style/2014Aug/0308.html , there's been a change to the algorithm for getting the intrinsic sizes of a flex containers. The old text was something like "add up the hypothetical main sizes of the flex items". The new text is a bit more complex, and starts out: "For each flex item, subtract its flex basis from its max-content contribution size, then divide by its flex grow factor, floored at 1." The new algorithm is currently available here: http://dev.w3.org/csswg/css-flexbox-1/#intrinsic-sizes
Reporter | ||
Updated•10 years ago
|
Reporter | ||
Updated•9 years ago
|
Note the thread at https://lists.w3.org/Archives/Public/www-style/2015Apr/0049.html
Reporter | ||
Comment 4•9 years ago
|
||
fantasai suggested some further tweaks (to the max-content contribution of a flex item) here: https://lists.w3.org/Archives/Public/www-style/2015Jul/0429.html
Comment 5•9 years ago
|
||
see https://groups.google.com/a/chromium.org/forum/#!topic/blink-dev/qBqeSQeyVXc
Reporter | ||
Comment 7•7 years ago
|
||
This spec text is changing a bit further in https://github.com/w3c/csswg-drafts/issues/1735 , BTW.
Updated•3 years ago
|
Comment 9•3 years ago
|
||
Chrome's bug for this is https://crbug.com/240765. I think FF and Chrome currently use the same intrinsic sizing algorithm. It leads to some bad behavior, like https://codepen.io/anon/pen/wBJQap (the new better algorithm, used by EdgeHTML, would make the red border surround the grey rectangle).
I want to fix that broken behavior for authors, but the compat situation for changing to the new algorithm is terrifying. And the chrome layout team (well, Ian K, biesi, and I) hasn't figured out a way to accurately measure the compat impact, aside from ship the new algorithm and gauge the resultant screaming :(
If we (including the Firefox layout engineers) decide to implement the new algorithm, I think we should sync up on releasing it so that author-pain is minimized. Hopefully we can release within a few weeks of each other.
Thoughts on any of this?
Reporter | ||
Comment 11•3 years ago
|
||
Sure, that sounds like a good idea. This wasn't on my radar to implement soon, but we could plan to prioritize it if/when you're actively working on it as well.
Comment 12•3 years ago
|
||
Oh, yeah, we're not planning to implement soon either, especially after not finding a way to judge the negative impact, I was mostly just checking in. Great to hear that syncing up is a good possibility :)
Comment 13•3 years ago
|
||
(In reply to dgrogan(chrome) from comment #9)
If we (including the Firefox layout engineers) decide to implement the new algorithm, I think we should sync up on releasing it so that author-pain is minimized. Hopefully we can release within a few weeks of each other.
Yes. Each time such a thing can be planned and coordinated with browsers simultaneously releasing a change, it will have better chance to be applied. We should also involve Apple WebKit engineers into this.
Comment 14•3 years ago
|
||
On the webcompat side, we (the webcompat team) will be seeing the breakage quickly on webcompat.com as if it has any impact these bugs will likely be reported.
Comment 15•3 years ago
|
||
@karlcow, just FYI, I think you and I are using the term "compat" differently. I mean compatibility between existing sites and new browser behavior. I think you mean compatibility between browsers.
Maybe the Blink community tends to use "compat" to mean breaking existing sites while the Firefox community uses it to mean compatibility between browsers? (Blink uses "interop[erability]" to describe the latter situation.)
To be clear, both are important and I think we are still in agreement here!
Reporter | ||
Comment 16•3 years ago
•
|
||
Yeah, Mozilla's use of "webcompat" covers both of those ideas (and we do see issues reported at webcompat.com for both types of issues - both regressions and interop-issues-that-users-are-actually-hitting-in-the-wild).
It's kind of two sides of the same coin (that coin being: "the web-as-it-exists depends on certain browser behavior").
Comment 17•2 years ago
|
||
I landed the first bit of this (the row nowrap
case, with some new tests) over at https://crbug.com/240765.
It'd be great if we could launch ~together, as discussed above, but what might be a reasonable timetable for you?
I just Agenda+'d https://github.com/w3c/csswg-drafts/issues/6777, which is about a pretty big (IMO) issue with the specified behavior for the column wrap
case.
Comment 18•2 years ago
|
||
P.S. I think we could launch the non-column wrap
cases, or at least the row cases, even when we're still in spec discussion about the column wrap
case.
Reporter | ||
Comment 19•2 years ago
|
||
(In reply to dgrogan(chrome) from comment #17)
It'd be great if we could launch ~together, as discussed above, but what might be a reasonable timetable for you?
Hmm, let me get back to you; this wasn't on my roadmap for the near future, but I agree it'd be nice to ship this change around the same time.
Comment 20•2 years ago
|
||
Any updates? After a few revisions, the spec is in better shape now. Blink will probably be ready to ship in the next 4 weeks, but we can delay a few months if that allows the engines to ship together. (Also, when Gecko implements, you will almost certainly root out a few bugs in our implementation that we don't want to ship!)
Comment 21•2 years ago
|
||
I just filed a WebKit bug for the new algorithm https://bugs.webkit.org/show_bug.cgi?id=243173
Reporter | ||
Comment 22•2 years ago
|
||
Thanks - glad to hear that the spec has progressed and that the Blink impl is looking close to ready!
I'm happy to look into implementing this ~soon, in the interests of averting interop issues and uncovering potential disagreements-with-the-Chromium-impl sooner rather than later. Not yet sure what the complexity/ETA will be, but I can plan to get started at least in the next week or two. (Realistically I probably won't get to this next week, due to the CSSWG meetings Mon-Weds and due to next Friday being a Mozilla "wellness day" general-holiday; but I'll make this a priority for the week after.)
Comment 23•2 years ago
|
||
🎉🎉🎉
Comment 24•2 years ago
|
||
Need to clarify something I said in comment 20. "Ready to ship in 4 weeks" meant first ship to Canary and Dev channel, not Stable. We'll see how bad the fallout is in Dev channel before promoting to Beta.
Comment 25•2 years ago
|
||
Also to note, we are only implementing inline intrinsic sizes at this time. So we aren't implementing the "Flex Container Intrinsic Main Sizes" algorithm for column containers, for example.
Reporter | ||
Comment 26•2 years ago
•
|
||
Good to know, thank you. I was wondering, did your implementation (the behavior-change) cause any substantial test-failures or known webcompat issues at this point?
Comment 27•2 years ago
|
||
There are ~10 changes to existing tests, but none seem scary.
We've only checked compat by browsing around in canary ourselves. We found one issue, but still haven't figured out if it's a bug in our implementation or intended behavior change.
Updated•2 years ago
|
Comment 28•2 years ago
|
||
The severity field for this bug is relatively low, S3. However, the bug has 3 duplicates.
:dholbert, could you consider increasing the bug severity?
For more information, please visit auto_nag documentation.
Comment 29•2 years ago
|
||
The last needinfo from me was triggered in error by recent activity on the bug. I'm clearing the needinfo since this is a very old bug and I don't know if it's still relevant.
Reporter | ||
Updated•1 year ago
|
Reporter | ||
Comment 31•9 months ago
|
||
Update here: the spec algorithm didn't turn out to be web-compatible, but the Chrome folks have a new proposed algorithm discussed in https://github.com/w3c/csswg-drafts/issues/8884 which is hopefully more-web-compatible.
Description
•