Re: [csswg-drafts] [css-grid] What if base sizes of both auto/min-content and max-content minimums are being handled? (#3621)

> When distributing the 300px, the base sizes have already reached the growth limits

Hmm, yeah, that's a good point. I'll have to run this in a debugger later to see exactly what we're doing...

> Here we are handling a track with an auto minimum (the 2nd row) and another one with a max-content minimum. Both conditions apply, so it's not clear among which tracks the 300px should be distributed.

"For intrinsic minimums" says "First increase the base size of tracks with an intrinsic min track sizing function". Since both rows have an _intrinsic_ min sizing function, both are included in the set of tracks we should run ["distributing extra space"](https://drafts.csswg.org/css-grid/#algo-spanning-items) over. The second bullet applies to row 1, and the first bullet applies to row 2 (since the "For intrinsic minimums" step handles _base sizes_). So it seems to me we should distribute to both rows in this section:

2.1. `extra-space` should be 300 - 18 - 18
2.2. "Distribute space to base sizes up to growth limits" should do nothing, since as you pointed out, _base_ is equal to _limit_ at this point
2.3. Then we're distributing space **beyond growth limits**. I don't think any _limit_ applies here and thus not any clamp on the _limit_ either. So this should set the _item-incurred increase_ to half the  `extra-space`  for each track.
2.4. ... which then becomes the _planned increase_
3. ... which then updates the _affected sizes_ (i.e. is added to the _base_ sizes)

>And about fit-content it seems neither Firefox nor Chromium are obeying this:
>> For this purpose, fit-content() tracks are treated as max-content until they reach the limit specified as the fit-content() argument, after which they are treated as having a fixed sizing function of that argument.

Yeah, I'm not sure what that paragraph is trying to say really. Maybe that any `fit-content()` track that reached its limit in step 2.2 should be excluded from 2.3? (In which case you'd get Chrome's layout I guess)

> In fact this is not completely related to `fit-content`, you can replace it with `auto` and you will get the same non-interoperability between Firefox and Chromium.

For the `auto` case it seems clear to me that Gecko is correct.  I'm less sure about the `fit-content` case now...

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

Received on Tuesday, 7 May 2019 21:43:14 UTC