1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 06:17:35 +00:00

LibWeb: Complete table border conflict resolution

Add the element type and grid position to the algorithm and change the
table borders painting to apply the new criteria to corners as well.
This commit is contained in:
Andi Gallo 2023-07-12 04:20:37 +00:00 committed by Andreas Kling
parent 849cf894d8
commit a7166eb103
6 changed files with 317 additions and 127 deletions

View file

@ -130,8 +130,31 @@ public:
bool is_out_of_view(PaintContext&) const;
void set_override_borders_data(BordersData const& override_borders_data) { m_override_borders_data = override_borders_data; }
Optional<BordersData> const& override_borders_data() const { return m_override_borders_data; }
enum class ConflictingElementKind {
Cell,
Row,
RowGroup,
Column,
ColumnGroup,
Table,
};
struct BorderDataWithElementKind {
CSS::BorderData border_data;
ConflictingElementKind element_kind;
};
struct BordersDataWithElementKind {
BorderDataWithElementKind top;
BorderDataWithElementKind right;
BorderDataWithElementKind bottom;
BorderDataWithElementKind left;
};
void set_override_borders_data(BordersDataWithElementKind const& override_borders_data) { m_override_borders_data = override_borders_data; }
Optional<BordersDataWithElementKind> const& override_borders_data() const { return m_override_borders_data; }
static BordersData remove_element_kind_from_borders_data(PaintableBox::BordersDataWithElementKind borders_data);
struct TableCellCoordinates {
size_t row_index;
@ -182,7 +205,7 @@ private:
mutable bool m_clipping_overflow { false };
Optional<BorderRadiusCornerClipper> mutable m_overflow_corner_radius_clipper;
Optional<BordersData> m_override_borders_data;
Optional<BordersDataWithElementKind> m_override_borders_data;
Optional<TableCellCoordinates> m_table_cell_coordinates;
};