diff options
author | Andreas Kling <kling@serenityos.org> | 2022-02-20 15:51:24 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-02-21 18:35:12 +0100 |
commit | c9700e100e1cfe463b837b7a1337a5a7b7df63d9 (patch) | |
tree | be46a34022d858f05089a68ed01057737db6d10b /Userland/Libraries/LibWeb/Layout/TableFormattingContext.h | |
parent | 561612f2192adf4c0cecfe7a19df5804fc1960ff (diff) | |
download | serenity-c9700e100e1cfe463b837b7a1337a5a7b7df63d9.zip |
LibWeb: Start making our layout system "transactional"
This patch adds a map of Layout::Node to FormattingState::NodeState.
Instead of updating layout nodes incrementally as layout progresses
through the formatting contexts, all updates are now written to the
corresponding NodeState instead.
At the end of layout, FormattingState::commit() is called, which
transfers all the values from the NodeState objects to the Node.
This will soon allow us to perform completely non-destructive layouts
which don't affect the tree.
Note that there are many imperfections here, and still many places
where we assign to the NodeState, but later read directly from the Node
instead. I'm just committing at this stage to make subsequent diffs
easier to understand.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/TableFormattingContext.h')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/TableFormattingContext.h | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h index bf9576001c..39955ad0b9 100644 --- a/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/TableFormattingContext.h @@ -13,14 +13,14 @@ namespace Web::Layout { class TableFormattingContext final : public BlockFormattingContext { public: - explicit TableFormattingContext(FormattingState&, BlockContainer&, FormattingContext* parent); + explicit TableFormattingContext(FormattingState&, BlockContainer const&, FormattingContext* parent); ~TableFormattingContext(); - virtual void run(Box&, LayoutMode) override; + virtual void run(Box const&, LayoutMode) override; private: - void calculate_column_widths(Box& row, Vector<float>& column_widths); - void layout_row(Box& row, Vector<float>& column_widths); + void calculate_column_widths(Box const& row, Vector<float>& column_widths); + void layout_row(Box const& row, Vector<float>& column_widths); }; } |