**Contact emails**
re...@igalia.com
**Summary**
The CSS Working Group (CSSWG) has been discussing for a long time
about the behavior of percentage row tracks and gutters
when the grid container's height is indefinite.
There have been resolutions on different meetings about these topics
and it seems things are now settle down.
The relevant GitHub issues are:
* Percentage row tracks:
https://github.com/w3c/csswg-drafts/issues/1921
* Percentage row gutters:
https://github.com/w3c/csswg-drafts/issues/509
The current spec texts for each of these topics are:
*
https://drafts.csswg.org/css-grid/#valdef-grid-template-columns-length-percentage
*
https://drafts.csswg.org/css-align-3/#propdef-row-gap
So far percentage rows (both tracks and gutters) were behaving
like percentage heights in regular blocks when the container's height
is indefinite. So they were basically treated like an "auto" height
(for gutters that means 0px gap).
The intention of the CSSWG is to make Grid Layout as symmetric
as possible, for that reason they resolved to change the behavior
of percentage row tracks and gutters, to work similar to
percentage column tracks and gutters.
For columns the percentage is ignored during intrinsic widths
computation, and later it's resolved against that intrinsic width
during layout.
The idea is to do something similar for rows, but we don't have
an intrinsic heights computation phase. So we'd need to layout the grid
ignoring percentages to calculate the intrinsic height,
and use that height we have just computed to resolve
the percentages rows later (this could lead to a double-pass
in the track sizing algorithm to get proper results).
**Motivation**
It seems web authors prefer to have this kind of symmetric behavior
for percentages in both columns and rows in CSS Grid Layout.
Also the CSSWG has had long discussions about the topic
and it seems everyone is now on the same page regarding this topic.
In addition, Firefox has already implemented this change
for row gutters. So we'd start to have interoperability issues
if we don't do it too. Note that Firefox hasn't implemented it
for row tracks yet, but they seem to align with the current resolution.
**Risks**
**Interoperability and Compatibility**
We have a use counter for percentage row tracks in grid containers
with indefinite heights. These cases would be the ones
that will change their behavior.
The use counter
(
https://www.chromestatus.com/metrics/feature/timeline/popularity/2248)
right now shows that a 0.0318% of websites
would be affected, the number is increasing as Grid Layout
is being adopted.
If we check the usage of CSS Grid Layout
(
https://www.chromestatus.com/metrics/feature/timeline/popularity/1693)
we see that 0.9019%
of websites use it right now.
Doing a simple calculation we can say that 3.53% of websites
using Grid Layout would be affected by this change.
The plan would be to land this at the beginning of the cycle
after the branch for M69 (during next weeks) and then we'd have time
to revert if many of these sites report issues with the new behavior.
BTW, we don't have a use counter for percentage row gutters.
* Edge: Public support. Rossen Atanassov was always supporting
the idea of making CSS Grid Layout as symmetric as possible.
He mentioned in some of the CSSWG discussions that Microsoft
would update their implementation once Chromium does it.
* Firefox: Shipped/Public support. As mentioned previously Firefox
has already implemented this change for percentage row gutters,
as part of that work they modified some WPT tests that are now failing
on Blink. Regarding percentage row tracks Mats Palmgren
seems happy with the resolution although he is asking
for some clarifications on the spec, but not behavior changes.
As a related note it's important to highlight that Firefox
is adding gutters support for Flexbox and they'll be following
this new behavior in that case too.
* Safari: No signals. As Igalia is maintaining CSS Grid Layout in WebKit
we'd take care of updating the implementation there (once this is done
in Chromium).
* Web developers: Jen Simmons and Rachel Andrew have been following
the CSSWG issues and they both seem to be fine with
the current resolutions.
All these can be checked in the two Github issues linked before.
**Ergonomics**
Nothing to highlight here.
**Activation**
We don't think anything special it's needed here.
**Debuggability**
Again nothing special, the percentage would be resolved to some
different amount of pixels, that's all.
**Will this feature be supported on all six Blink platforms (Windows,
Mac, Linux, Chrome OS, Android, and Android WebView)?**
Yes.
**Is this feature fully tested by web-platform-tests?**
As part of the CL that implements this we'll be adding the required
web platform tests to ensure compatibility with other implementations.
Regarding percentage row gutters there are already WPT tests that
we're currently failing (since Firefox implemented the new behavior):
*
http://w3c-test.org/css/css-grid/alignment/grid-gutters-009.html
*
http://w3c-test.org/css/css-grid/alignment/grid-gutters-010.html
For percentage row tracks we're adding two tests covering the cases
where a 2nd pass of the track sizing algorithm is required too.
Check the new WPT tests in the CL implementing this change:
https://chromium-review.googlesource.com/c/chromium/src/+/1142409
**Link to entry on the feature dashboard**
https://www.chromestatus.com/feature/6708326821789696
**Requesting approval to ship?**
Yes.