1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:38:11 +00:00

LibWeb: More work on table layout

Table row layout is now split into two phases:

1. Compute all the column widths (even taking colspan into account!)
2. Place all cells at the correct x,y offsets based on column widths.

Both phases visit all rows and all cells.
This commit is contained in:
Andreas Kling 2020-06-13 00:12:23 +02:00
parent 365703e3f3
commit 62893a54cc
4 changed files with 53 additions and 7 deletions

View file

@ -37,7 +37,7 @@ public:
LayoutTableRow(const Element&, NonnullRefPtr<StyleProperties>);
virtual ~LayoutTableRow() override;
virtual void layout(LayoutMode = LayoutMode::Default) override;
LayoutTableCell* first_cell();
const LayoutTableCell* first_cell() const;
@ -45,7 +45,11 @@ public:
LayoutTableRow* next_row();
const LayoutTableRow* next_row() const;
void layout_row(const Vector<float>& column_widths);
void calculate_column_widths(Vector<float>& column_widths);
private:
virtual void layout(LayoutMode) override;
virtual bool is_table_row() const override { return true; }
virtual const char* class_name() const override { return "LayoutTableRow"; }
};