mirror of
https://github.com/servo/servo.git
synced 2025-08-06 14:10:11 +01:00
layout: Include spanned gutters when laying out contents of table cell (#38290)
If a cell would e.g. span 2 columns, each 50px wide, separated by a 10px gutter, then we used to lay out the contents of the cell with a 100px wide containing block. Now we will include the size of the gutter. Testing: Adding new test Fixes: #38277 Signed-off-by: Oriol Brufau <obrufau@igalia.com>
This commit is contained in:
parent
61273a4321
commit
7ce5de4e2d
3 changed files with 35 additions and 1 deletions
|
@ -1091,11 +1091,14 @@ impl<'a> TableLayout<'a> {
|
|||
.padding(containing_block_for_table.style.writing_mode)
|
||||
.percentages_relative_to(self.basis_for_cell_padding_percentage);
|
||||
let inline_border_padding_sum = border.inline_sum() + padding.inline_sum();
|
||||
let border_spacing_spanned =
|
||||
self.table.border_spacing().inline * (cell.colspan - 1) as i32;
|
||||
|
||||
let mut total_cell_width: Au = (coordinate.x..coordinate.x + cell.colspan)
|
||||
.map(|column_index| self.distributed_column_widths[column_index])
|
||||
.sum::<Au>() -
|
||||
inline_border_padding_sum;
|
||||
inline_border_padding_sum +
|
||||
border_spacing_spanned;
|
||||
total_cell_width = total_cell_width.max(Au::zero());
|
||||
|
||||
let containing_block_for_children = ContainingBlock {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue