Re: [csswg-drafts] [css-grid] Applying 'justify-content' content distribution is in the wrong place in the overall grid sizing algo

Hmm, indeed. Case in point:

```html
<style>
.grid { 
 display: grid; 
 grid: 100px 100px auto / auto; 
 align-content: space-between; 
 height: 300px;
}
.ortho {
 grid-row: 1 / span 2;
 font: 50px Ahem;
 writing-mode: vertical-rl;
 background: purple;
}
.content {
 grid-row: 3;
}
</style>
<div class=grid>
  <div class=ortho>É É ÉÉ</div>
  <div class=content>foo</div>
</div>
```

Today, the spec says that the orthogonal item can tell how large its containing block is (200px high, as it spans only rows with fixed max track sizing functions).  The *actual* height of the block might not be 200px, as it depends on how much space is left over in the grid after the content-sized track is sized.

If we move the distribution up in the algorithm, then we have to weaken the condition we're using - the amount of gap, and thus the size of the grid area, is content-sized *if any track in the entire grid is content-sized*. Per the spec, this means we have to assume the grid area is infinite, and we'll get the original bad layout from #2409.

(On that note, we should probably make it clearer that gaps are considered in the calculation of the grid-area size, even if we leave distribution at the end.)

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

Received on Thursday, 17 May 2018 17:18:42 UTC