1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 11:28:11 +00:00

LibWeb: Store Layout::Box overflow data in Optional instead of OwnPtr

This commit is contained in:
Andreas Kling 2022-02-27 10:55:39 +01:00
parent 916bbf5910
commit 1d05823810
2 changed files with 7 additions and 7 deletions

View file

@ -54,12 +54,12 @@ struct FormattingState {
float border_box_width() const { return border_box_left() + content_width + border_box_right(); }
float border_box_height() const { return border_box_top() + content_height + border_box_bottom(); }
OwnPtr<Layout::Box::OverflowData> overflow_data;
Optional<Layout::Box::OverflowData> overflow_data;
Layout::Box::OverflowData& ensure_overflow_data()
{
if (!overflow_data)
overflow_data = make<Layout::Box::OverflowData>();
if (!overflow_data.has_value())
overflow_data = Layout::Box::OverflowData {};
return *overflow_data;
}
};