diff --git a/Userland/Libraries/LibWeb/Layout/FormattingState.h b/Userland/Libraries/LibWeb/Layout/FormattingState.h index 1ed6071cd4..1d2dfa0be2 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingState.h +++ b/Userland/Libraries/LibWeb/Layout/FormattingState.h @@ -66,6 +66,15 @@ struct FormattingState { void commit(); + FormattingState clone() const + { + FormattingState new_state; + for (auto& it : nodes) { + new_state.nodes.set(it.key, make(*it.value)); + } + return new_state; + } + NodeState& get_mutable(NodeWithStyleAndBoxModelMetrics const& box) { return *nodes.ensure(&box, [] { return make(); });