You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Follow-up to #177102 (colSpan / rowSpan support in TableCell), tracking the TODO(hm21) in the baseline case of RenderTable.performLayout. Agreed as a follow-up in the review: #177102 (comment)
Build a baseline-aligned Table in which a TableCell(rowSpan: 2) is taller than the row it starts in (code sample below).
Compare the row heights.
Expected results
A spanning cell is sized like the other alignments: it does not add its height to the row it starts in, and the rows it covers only grow if the cell needs more room than they provide. For baseline alignment, close to HTML's vertical-align: baseline on a rowspan cell, that means:
the cell aligns its baseline with the baseline of the first row, so only its ascent counts toward that row's beforeBaselineDistance;
its descent is not added to the first row. Once the first row's baseline is known, the height the cell needs from the top of that row is recorded for the last row it covers, the same way top, middle and bottom rowSpan cells are handled.
In the sample, row 0 is 50 tall (ascent 45 of T, descent 5 of A) and row 1 is 20 tall. T reaches from 0 to 60, into row 1. The table is 70 tall.
Actual results
The baseline case never looks at rowSpan, so the whole height of the cell goes into the row it starts in:
Framework at 664fb94 (branch of #177102, based on master 3829a94). Not reproducible on master yet, since rowSpan only exists on that branch. The test font (FlutterTest) makes a 60 pixel line 60 tall with its baseline at 45.
Follow-up to #177102 (
colSpan/rowSpansupport inTableCell), tracking theTODO(hm21)in the baseline case ofRenderTable.performLayout. Agreed as a follow-up in the review: #177102 (comment)Steps to reproduce
Tablein which aTableCell(rowSpan: 2)is taller than the row it starts in (code sample below).Expected results
A spanning cell is sized like the other alignments: it does not add its height to the row it starts in, and the rows it covers only grow if the cell needs more room than they provide. For baseline alignment, close to HTML's
vertical-align: baselineon arowspancell, that means:beforeBaselineDistance;top,middleandbottomrowSpan cells are handled.In the sample, row 0 is 50 tall (ascent 45 of
T, descent 5 ofA) and row 1 is 20 tall.Treaches from 0 to 60, into row 1. The table is 70 tall.Actual results
The baseline case never looks at
rowSpan, so the whole height of the cell goes into the row it starts in:The same applies to a baseline-aligned cell without a real baseline (it is top-aligned, but its height also goes into its first row).
Code sample
Code sample
Flutter Doctor output
Framework at 664fb94 (branch of #177102, based on master 3829a94). Not reproducible on master yet, since
rowSpanonly exists on that branch. The test font (FlutterTest) makes a 60 pixel line 60 tall with its baseline at 45.