- From: Manuel Rego Casasnovas via GitHub <sysbot+gh@w3.org>
- Date: Tue, 30 Jan 2018 12:18:21 +0000
- To: public-css-archive@w3.org
We've added support for multi-column `column-gap` percentages in both Blink and WebKit, but we're not using the last resolution where they should resolve to zero for content-based containers.
We're treating them as zero to compute intrinsic size and then resolving during layout.
That's working the same in all browsers that have `column-gap` percentage support for multi-column (Chromium, Safari and Edge).
There's a new WPT test that verifies those cases: http://w3c-test.org/css/css-multicol/multicol-gap-percentage-001.html
Why we're not following the last text in the spec?
Because in Blink/WebKit it's not possible for us right now to know during layout that a multicol container is content-based or not. We could try to implement that, but I believe it'll be quite complex and could bring performance penalties, e.g. if you have `width: auto` you'll need to look through all your parents to check if any of them has `width: min-content` and you'll be content-based sized then (and many other different scenarios).
At the same time I realized that resolving the percentages gaps in grid containers doesn't imply that you have overflow.
Overflow happens in some cases like:
```html
<div style="display: inline-grid; border: thick dotted;
grid-template-columns: auto auto; grid-column-gap: 20%;">
<div style="grid-column: 1; background: magenta;">Hello</div>
<div style="grid-column: 2; background: cyan;">World!</div>
</div>
```

But if you have more text, then the overflow is gone:
```html
<div style="display: inline-grid; border: thick dotted;
grid-template-columns: auto auto; grid-column-gap: 20%;">
<div style="grid-column: 1; background: magenta;">Hello World!</div>
<div style="grid-column: 2; background: cyan;">This is just an example.</div>
</div>
```

With the last resolution, the gap should be zero and you won't have overflow in any case.

--
GitHub Notification of comment by mrego
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/509#issuecomment-361576494 using your GitHub account
Received on Tuesday, 30 January 2018 12:18:55 UTC