Re: [csswg-drafts] [css-grid] Resolution of percentage row tracks and gutters with indefinite height (#5566)

I took [a stab]( at fixing that bug and I found what looks like bug in Chrome, consider:
.grid {
  display: grid;
  grid-template-rows: minmax(0,0.1fr) minmax(0,0.2fr) minmax(0,0.1fr) minmax(0,0.2fr) minmax(0,0.1fr);
  grid-auto-columns: 40px;
  border: 1px solid;

.c1 { grid-column:1; grid-row:1 / span 2; background:pink; }
.c2 { grid-column:2; grid-row:2 / span 3; background:lime; }
.c3 { grid-column:3; grid-row:3 / span 1; background:grey; }

span { height: 100px; }

<div class="grid">
  <span class="c1"></span>
  <span class="c2"></span>
  <span class="c3"></span>

Chrome has: `grid-template-rows 10px 20px 10px 20px 10px` (and the resulting content-box height is 70px).

I get `grid-template-rows: 7px 14px 7px 14px 7px` (also with height 70px), which seems correct to me because when the sum of `fr` sizes <= 1 then they are just a factor of the content-box size, so 0.1 x 70px = 7px etc.

Maybe this is just an over-aggressive optimization in Chrome?

Also, the spec could be a bit clearer about how this block-axis intrinsic sizing pass should be implemented. I'm running it unconditionally "under no constraint" (as opposed to "under a min/max-content constraint" in any situations).  This seems to be what Chrome does too(?)

This would kind of contradict #3684 though, which suggests that e.g. `block-size: min-content` should make this intrinsic sizing step run under a min-content constraint(?) Should `block-size: min-content/max-content/fit-content/stretch` affect this intrinsic sizing step at all?

GitHub Notification of comment by MatsPalmgren
Please view or discuss this issue at using your GitHub account

Sent via github-notify-ml as configured in

Received on Monday, 16 November 2020 16:22:10 UTC