Re: [csswg-drafts] [css-flexbox] Multi-line column flexbox fragmentation (#6855)

@tabatkins and I were looking into how to make these edits, and on further thought aren't convinced that what's described in the minutes is actually desirable.

[Here's a testcase](https://www.software.hixie.ch/utilities/js/live-dom-viewer/?saved=10229) showing off a multiline column flexbox being fragmented by a multicol. The desired behavior is, of course, that content is properly fragmented and not overflowing its container.

Chrome behavior (content is not properly fragmented; it instead just visually slices):
![Each flex item is laid out normally, as one piece, then visually sliced if it splits across a column.](https://user-images.githubusercontent.com/682840/164062708-79cf241c-e9e5-46fb-abbe-132f2c549850.png)

Firefox behavior (content properly fragments, but overlaps because the flex item fragments aren't resized to accommodate their contents, which therefore overflow):
![The flex items lay out normally, then the item *itself* is visually sliced, but its contents are properly fragmented, so lines of text that would half-overflow the column are moved to the second item fragment, taking up more space than is available.](https://user-images.githubusercontent.com/682840/164062724-f7e3c51f-e7c2-4144-bc29-a1dadb1db891.png)

Properly breaking a multiline column flex container in the way described in the minutes requires laying out each line across all of the fragmentainers one by one, so that the increase in size due to fragmentation is accounted for during that line's layout. This is possible to do, but is fairly complicated and requires passing layout information back and forth across fragmentainers. If we want to do that while honoring alignment and flexing across fragments, that requires cycling the layout while we try various combinations of sizing/positioning and fragmentation breaks. Is this what we want specced? Is this something we believe can be implemented properly?

(Fwiw, the approach outlined in the spec follows the multi-col paradigm of laying out content in "rows" of columns, each fit into the "page". This has the disadvantage of laying out the contents in a different visual order than when the container is not fragmented, but has the advantage of the first items in the container being visible on the first page, and of laying out the entire contents of each fragmentainer before moving on to the next.)

-- 
GitHub Notification of comment by fantasai
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/6855#issuecomment-1102928864 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Tuesday, 19 April 2022 17:54:15 UTC