diff --git a/Tests/LibWeb/Layout/expected/table/colspan-width-distribution.txt b/Tests/LibWeb/Layout/expected/table/colspan-width-distribution.txt new file mode 100644 index 0000000000..4ceb0e61c2 --- /dev/null +++ b/Tests/LibWeb/Layout/expected/table/colspan-width-distribution.txt @@ -0,0 +1,45 @@ +Viewport <#document> at (0,0) content-size 800x600 children: not-inline + BlockContainer at (0,0) content-size 800x60.9375 [BFC] children: not-inline + BlockContainer <(anonymous)> at (0,0) content-size 800x0 children: inline + TextNode <#text> + BlockContainer at (8,8) content-size 784x44.9375 children: not-inline + BlockContainer <(anonymous)> at (8,8) content-size 784x0 children: inline + TextNode <#text> + TableWrapper <(anonymous)> at (8,8) content-size 32.904952x44.9375 [BFC] children: not-inline + Box at (9,9) content-size 32.904952x42.9375 table-box [TFC] children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box at (9,9) content-size 34.904952x42.9375 table-row-group children: not-inline + Box at (9,9) content-size 34.904952x21.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (9,30.46875) content-size 34.904952x21.46875 table-row children: not-inline + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer
at (11,11) content-size 17.561202x17.46875 table-cell [BFC] children: inline + line 0 width: 14.265625, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [13,11 14.265625x17.46875] + "A" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer at (32.561202,11) content-size 9.34375x17.46875 table-cell [BFC] children: inline + line 0 width: 9.34375, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 1, rect: [32.561202,11 9.34375x17.46875] + "B" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + Box
at (11,32.46875) content-size 30.904952x17.46875 table-cell [BFC] children: inline + line 0 width: 33.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125 + frag 0 from TextNode start: 0, length: 3, rect: [11,32.46875 33.3125x17.46875] + "CDE" + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> (not painted) children: inline + TextNode <#text> + BlockContainer <(anonymous)> at (8,52.9375) content-size 784x0 children: inline + TextNode <#text> diff --git a/Tests/LibWeb/Layout/input/table/colspan-width-distribution.html b/Tests/LibWeb/Layout/input/table/colspan-width-distribution.html new file mode 100644 index 0000000000..6b32682ec9 --- /dev/null +++ b/Tests/LibWeb/Layout/input/table/colspan-width-distribution.html @@ -0,0 +1,27 @@ + + + + + Computing column measures + + + + + + + + + + + + +
AB
CDE
+ + + \ No newline at end of file diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp index c9c1301c6d..c6562dc0df 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp @@ -201,7 +201,7 @@ void TableFormattingContext::compute_table_measures() } } - for (size_t current_column_span = 2; current_column_span < max_cell_column_span; current_column_span++) { + for (size_t current_column_span = 2; current_column_span <= max_cell_column_span; current_column_span++) { // https://www.w3.org/TR/css-tables-3/#min-content-width-of-a-column-based-on-cells-of-span-up-to-n-n--1 Vector> cell_min_contributions_by_column_index; cell_min_contributions_by_column_index.resize(m_columns.size());