at (8,8) content-size 114.8125x43.46875 table-row children: not-inline
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
+ BlockContainer at (31,21) content-size 14.265625x17.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: [31,21 14.265625x17.46875]
+ "A"
+ TextNode <#text>
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
+ BlockContainer | at (87.265625,21) content-size 12.546875x17.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: [87.265625,21 9.34375x17.46875]
+ "B"
+ TextNode <#text>
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
+ Box | at (8,51.46875) content-size 114.8125x43.46875 table-row children: not-inline
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
+ BlockContainer at (29,64.46875) content-size 16.265625x17.46875 table-cell [BFC] children: inline
+ line 0 width: 10.3125, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [29,64.46875 10.3125x17.46875]
+ "C"
+ TextNode <#text>
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
+ BlockContainer | at (87.265625,64.46875) content-size 14.546875x17.46875 table-cell [BFC] children: inline
+ line 0 width: 11.140625, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [87.265625,64.46875 11.140625x17.46875]
+ "D"
+ TextNode <#text>
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
+ Box |
at (8,94.9375) content-size 114.8125x43.46875 table-row children: not-inline
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
+ BlockContainer at (31,107.9375) content-size 14.265625x17.46875 table-cell [BFC] children: inline
+ line 0 width: 11.859375, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [31,107.9375 11.859375x17.46875]
+ "E"
+ TextNode <#text>
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
+ BlockContainer | at (87.265625,107.9375) content-size 12.546875x17.46875 table-cell [BFC] children: inline
+ line 0 width: 12.546875, height: 17.46875, bottom: 17.46875, baseline: 13.53125
+ frag 0 from TextNode start: 0, length: 1, rect: [87.265625,107.9375 12.546875x17.46875]
+ "F"
+ TextNode <#text>
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
+ BlockContainer <(anonymous)> (not painted) children: inline
+ TextNode <#text>
diff --git a/Tests/LibWeb/Layout/input/table/border-conflict-resolution-with-row.html b/Tests/LibWeb/Layout/input/table/border-conflict-resolution-with-row.html
new file mode 100644
index 0000000000..8047f06d70
--- /dev/null
+++ b/Tests/LibWeb/Layout/input/table/border-conflict-resolution-with-row.html
@@ -0,0 +1,31 @@
+
+
+
+
+
+ A |
+ B |
+
+
+ C |
+ D |
+
+
+ E |
+ F |
+
+
+
\ No newline at end of file
diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
index 9d25cb0276..be5ccc384c 100644
--- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
+++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.cpp
@@ -1051,7 +1051,7 @@ Vector TableFormattingContext::BorderCo
Cell const& cell, TableFormattingContext::ConflictingSide edge) const
{
// FIXME: Conflicting elements can be cells, rows, row groups, columns, column groups, and the table itself,
- // but we only consider cells, 'col' elements in a 'colgroup' and the table itself for now.
+ // but we only consider cells, rows, 'col' elements in a 'colgroup' and the table itself for now.
Vector result = {};
if (cell.column_index >= cell.column_span && edge == ConflictingSide::Left) {
auto maybe_cell_to_left = m_context->m_cells_by_coordinate[cell.row_index][cell.column_index - cell.column_span];
@@ -1077,6 +1077,18 @@ Vector TableFormattingContext::BorderCo
result.append({ maybe_cell_below->box, ConflictingSide::Top });
}
}
+ if (edge == ConflictingSide::Top) {
+ result.append({ m_context->m_rows[cell.row_index].box, ConflictingSide::Top });
+ }
+ if (edge == ConflictingSide::Bottom) {
+ result.append({ m_context->m_rows[cell.row_index].box, ConflictingSide::Bottom });
+ }
+ if (cell.row_index >= cell.row_span && edge == ConflictingSide::Top) {
+ result.append({ m_context->m_rows[cell.row_index - cell.row_span].box, ConflictingSide::Bottom });
+ }
+ if (cell.row_index + cell.row_span < m_context->m_rows.size() && edge == ConflictingSide::Bottom) {
+ result.append({ m_context->m_rows[cell.row_index + cell.row_span].box, ConflictingSide::Top });
+ }
if (m_col_elements_by_index[cell.column_index] && edge == ConflictingSide::Left) {
result.append({ m_col_elements_by_index[cell.column_index], ConflictingSide::Left });
}
@@ -1102,9 +1114,11 @@ Vector TableFormattingContext::BorderCo
result.append({ &m_context->table_box(), ConflictingSide::Bottom });
}
if (cell.column_index == 0 && edge == ConflictingSide::Left) {
+ result.append({ m_context->m_rows[cell.row_index].box, ConflictingSide::Left });
result.append({ &m_context->table_box(), ConflictingSide::Left });
}
if (cell.column_index == m_context->m_columns.size() - 1 && edge == ConflictingSide::Right) {
+ result.append({ m_context->m_rows[cell.row_index].box, ConflictingSide::Right });
result.append({ &m_context->table_box(), ConflictingSide::Right });
}
return result;
|