Re: [csswg-drafts] Alternative masonry path forward (#9041)

@nmn Right, as @Loirooriol points out, we do indeed have a substantially different track sizing algorithm between the two modes. Masonry ends up *eventually* invoking the Grid Layout algorithm in a specific, restricted way, and only after doing some collection/massaging of the items. The biggest difference is that we pretend that each masonry item is placed in *every possible track* that it could go in, since we can't actually tell what track it *will* end up in until layout time, after we've already sized the tracks.

One of the side effects of this is that Masonry can reasonably define a behavior for `repeat(auto-fill, auto)` (or any other combination of intrinsically-sized tracks with the `auto-fill`/`auto-fit` keyword). It's somewhat heuristic in complex cases, but for simple cases gives an accurate sizing result for the tracks, and thus an accurate repetition count. Grid can't reasonably do the same, because Grid Layout makes different assumptions about how its grid items work; it's theoretically possible to define *something* for it, but it would produce results substantially further away than what Grid would normally produce.

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


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

Received on Tuesday, 24 September 2024 23:08:52 UTC