[css-grid] Track sizing algorithm and gutters · Issue #2201 · w3c/csswg-drafts (original) (raw)

There's some text about this in gutters definition:

For the purpose of track sizing, each gutter is treated as an extra, empty track of the specified size.

And the track sizing algorithm has a note about gutters:

Note: Gutters are treated as empty fixed-size tracks for the purpose of the track sizing algorithm.

But they're not mentioned in the rest of the algorithm.

I believe the text in the spec is correct, but it has lead to confusion in 2 implementations (Blink/WebKit and Firefox), so probably it can be clarified to avoid this kind of mistakes.
The problem is detailed in the following Chromium bug, but basically if you have a content based grid container (e.g. a floated grid container for columns or one with height: auto for rows) both implementations were wrongly calculating the size of a flexible track.
The text on the spec says:

  1. Let leftover space be the space to fill minus the base sizes of the non-flexible grid tracks.

Implementations were subtracting non-flexible tracks, but forgetting about gutters (which should be considered non-flexible tracks too for this step.
@MatsPalmgren suggested I open this issue to try to clarify things if possible.

FWIW, Edge is right on this, and their behavior is the expected one.