W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2020

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

From: Mats Palmgren via GitHub <sysbot+gh@w3.org>
Date: Mon, 16 Nov 2020 16:22:08 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-728168200-1605543726-sysbot+gh@w3.org>
I took [a stab](https://hg.mozilla.org/try/rev/bf21485b5a5157dc361b46da7ba32d0ce52acf4c) at fixing that bug and I found what looks like bug in Chrome, consider:
```html
<!DOCTYPE HTML>
<style>
.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; }
</style>

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

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 https://github.com/w3c/csswg-drafts/issues/5566#issuecomment-728168200 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config
Received on Monday, 16 November 2020 16:22:10 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:42:22 UTC