- From: Hoch via GitHub <noreply@w3.org>
- Date: Thu, 04 Dec 2025 17:20:22 +0000
- To: public-css-archive@w3.org
A problem with ignoring dense packing (i.e. always using the last order-modified document order element) is that it could make a very simple dense packing usage produce an unintuitive baseline result. Take an example where the web dev feeds a collection of elements in an arbitrary order, all of the same style, into a 3 column Masonry. If the order of items ends up being 2x1 (red), 1x1 (blue), 3x1 (green) we get a last-baseline that also visually matches the lowest item (green 3x1). If, however, the order of items ends up being 2x1 (red), 3x1 (green), 1x1 (blue), we get the same visual result, but a last-baseline that is unintuitively higher (blue 1x1). <img width="823" height="559" alt="Image" src="https://github.com/user-attachments/assets/588c23f9-022b-4404-a10f-42a828c2173f" /> If we accept that this means we should not be ignoring dense packing (eliminating Approach 1), we are still left with (at least) 2 options for how to proceed. * Option 1 - Decide based on the item's visually rendered location * Option 2 - Establish a "track order" similar to the "[grid order](https://www.w3.org/TR/css3-grid-layout/#grid-order)" - defined as the visual order elements would be in if dense packing was enabled, but negative margins were ignored. In the above example, the "track order" for column 3 would be the 1x1 item, followed by the 3x1 item, independent of which order they appeared in the document. The first/last item would then be chosen based on this "track order", and the baseline determined from that item. @yanlingwang23 - This Option 1 matches your Approach 2 - Option 1 above, but I'm not clear on what your above Approach 2 - Option 2 is proposing, so am not sure if this is just rephrasing your Option 2, or if that is an additional option I should be considering. Both of these options would produce intuitive results for all the reasonable cases I have come up with, so I don't have a strong argument between them. I lean slightly towards the "track order" option, as it feels more consistent with how Grids currently behave - choosing the element to use based on an established "order", rather than based on rendered position. -- GitHub Notification of comment by mhochk Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/13165#issuecomment-3613376111 using your GitHub account -- Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Thursday, 4 December 2025 17:20:23 UTC