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
{{ message }}
Repository navigation
Table cell vertical alignment impacted by line-height #12531
the child cells of the row are assigned the correct heights (comparing computed cell height values against other browsers). Even so, the text in the cell without a line-height style still appears as if the entire row is the height of the smaller cell.
I found that most of the code to handle this was already there in the previously linked table_row.rs code. The child table-cells' block sizes were updated with the new value. However this stage of table row layout seems to only happen after the table cells have been laid out, which meant the adjusted block size did not affect the visual layout.
The problem could be fixed if the table-cells are reflow'ed after their new block sizes are calculated. However, after talking to @pcwalton and then looking closer at whether double table-cell layout is really necessary, I think it should be possible to simply adjust the position of the cells during the table row layout code.
A quick fix which implements this seems to work for the example above renders correctly. This quick fix also places the centre text in the ycombinator news title bar in the correct alignment. At least one wpt test has regressed, so I will look into this next.
The problem with moving the cell itself is that it causes the border and background of the cell to move as well. The cell itself is not subject to alignment; it's contents are.
A more correct way to go about this would be to have the vertical alignment code that's already in table_cell.rs run after the final cell-height-maximize pass.
Activity
adamncasey commentedon Jul 23, 2016
I found that most of the code to handle this was already there in the previously linked table_row.rs code. The child table-cells' block sizes were updated with the new value. However this stage of table row layout seems to only happen after the table cells have been laid out, which meant the adjusted block size did not affect the visual layout.
The problem could be fixed if the table-cells are reflow'ed after their new block sizes are calculated. However, after talking to @pcwalton and then looking closer at whether double table-cell layout is really necessary, I think it should be possible to simply adjust the position of the cells during the table row layout code.
A quick fix which implements this seems to work for the example above renders correctly. This quick fix also places the centre text in the ycombinator news title bar in the correct alignment. At least one wpt test has regressed, so I will look into this next.
https://github.com/adamncasey/servo/tree/table-row-cell-height
notriddle commentedon Jul 25, 2016
The problem with moving the cell itself is that it causes the border and background of the cell to move as well. The cell itself is not subject to alignment; it's contents are.
A more correct way to go about this would be to have the vertical alignment code that's already in
table_cell.rsrun after the final cell-height-maximize pass.adamncasey commentedon Jul 25, 2016
Good point. Updated the test to catch that.
It'll also be easier to implement vertical-align: baseline from the code in
table_cell.rssometime after thisAuto merge of #12593 - adamncasey:table-row-cell-height, r=pcwalton
Auto merge of #12593 - adamncasey:table-row-cell-height, r=pcwalton
Auto merge of #12593 - adamncasey:table-row-cell-height, r=pcwalton
Auto merge of #12593 - adamncasey:table-row-cell-height, r=pcwalton