The grid items in the example are empty block containers. The css-align spec says: "If there is no such line box or child, then the block container has no baseline set." https://drafts.csswg.org/css-align/#baseline-export So it's clear that these grid items **have no baseline set**. So should we synthesize a baseline and participate in the baseline alignment, or should they not participate in baseline alignment and instead use their [fallback alignment](https://drafts.csswg.org/css-align-3/#valdef-justify-self-first-baseline)? Looking at the code, it appears we do the latter. Presumably because the css-grid/css-align specs said so at one point. But yeah, Grid baseline alignment has been pretty heavily rewritten to match Chrome's implementation since that point (all the stuff about "baseline shims" in CSS Grid was added after we implemented the original spec for example). So our implementation might be out-of-date with these changes. > What's the baseline of an empty block? The css-align spec is clear that **if** we were to synthesize a baseline for an empty block container grid item, then the border-box should be used. But that's not the relevant question. The question is whether the item should participate in the first place. If the item doesn't participate in baseline alignment then its synthesized baseline is irrelevant. Is there any spec text that says we should synthesize baselines for grid items that don't have a baseline set? Interestingly, the section on Grid *container* baselines, says: "If the item has no alignment baseline..." https://drafts.csswg.org/css-grid/#grid-baselines Which states that some items don't have an alignment baseline, which seems to contradict any assumption that grid items always synthesize a baseline when they don't have a natural baseline set.
Bug 1609403 Comment 6 Edit History
Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.
The grid items in the example are empty block containers. The css-align spec says: "If there is no such line box or child, then the block container has no baseline set." https://drafts.csswg.org/css-align/#baseline-export So it's clear that these grid items **have no baseline set**. So should we synthesize a baseline and participate in the baseline alignment, or should they not participate in baseline alignment and instead use their [fallback alignment](https://drafts.csswg.org/css-align-3/#valdef-justify-self-first-baseline)? Looking at the code, it appears we do the latter. Presumably because the css-grid/css-align specs said so at one point. But yeah, Grid baseline alignment has been pretty heavily rewritten to match Chrome's implementation since that point (all the stuff about "baseline shims" in CSS Grid was added after we implemented the original spec for example). So our implementation might be out-of-date with these changes. > What's the baseline of an empty block? The css-align spec is clear that **if** we were to synthesize a baseline for an empty block container grid item, then the border-box should be used. But that's not the relevant question. The question is whether the item should participate in the first place. If the item doesn't participate in baseline alignment then its synthesized baseline is irrelevant. Is there any spec text that says that grid items without a baseline set should participate in baseline alignment using a synthesized baseline? Interestingly, the section on Grid *container* baselines, says: "If the item has no alignment baseline..." https://drafts.csswg.org/css-grid/#grid-baselines Which states that some items don't have an alignment baseline, which seems to contradict any assumption that grid items always synthesize a baseline when they don't have a natural baseline set.