diff --git a/components/layout/table/layout.rs b/components/layout/table/layout.rs index a6b23b773ce..9e80f322610 100644 --- a/components/layout/table/layout.rs +++ b/components/layout/table/layout.rs @@ -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::() - - 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 { diff --git a/tests/wpt/meta/MANIFEST.json b/tests/wpt/meta/MANIFEST.json index e6d1c7c264f..69db7787804 100644 --- a/tests/wpt/meta/MANIFEST.json +++ b/tests/wpt/meta/MANIFEST.json @@ -107621,6 +107621,19 @@ {} ] ], + "border-spacing-095.html": [ + "8e5c8f55ccaeb749894a63970ac349cfbce98d53", + [ + null, + [ + [ + "/css/reference/ref-filled-green-100px-square.xht", + "==" + ] + ], + {} + ] + ], "border-spacing-applies-to-016.xht": [ "0536763244237b77645937fe30e4898f1efcbfb5", [ diff --git a/tests/wpt/tests/css/CSS2/tables/border-spacing-095.html b/tests/wpt/tests/css/CSS2/tables/border-spacing-095.html new file mode 100644 index 00000000000..8e5c8f55cca --- /dev/null +++ b/tests/wpt/tests/css/CSS2/tables/border-spacing-095.html @@ -0,0 +1,18 @@ + +CSS Test: Border-spacing: cell spanning multiple columns + + + + + + +

Test passes if there is a filled green square and no red.

+ + + + +
+
+