Re: [csswg-drafts] [css-grid-3] [masonry] Should items with a definite row/column be placed first? (#12393)

Yes, the spec doesn't say anything about doing definite items first because it doesn't intend for you to: all items are done in the order they're encountered.

Grid *has to* do definite items first, because otherwise it might run out of space in the track the item wants to go into. We don't want to either cause overflow (from forcing the item into a full track) or violate the authors' explicit constraint (by moving it somewhere else), so the only option is to do the definite items *first*, so they can take up the space they need before auto-placed items fill in the rest of the space.

Masonry has no such constraint, so we can do the more natural thing and just take things in the order they're specified (with `order` letting authors rearrange things explicitly when they desire).'

Blink's behavior is correct in this example. The ref behavior is just relying on non-dense Grid auto-flow, which isn't correct for Masonry; that is, the test is wrong and should match Blink. (If you set `grid-auto-flow: dense` in the ref, it gives the correct behavior.)

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


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

Received on Thursday, 26 June 2025 20:37:11 UTC