summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-03-24 18:06:45 +0100
committerAndreas Kling <kling@serenityos.org>2022-03-24 18:14:01 +0100
commit40af665a4929db2c387a047964025c89b6ef9016 (patch)
treee244c38fe4de5e11bb45fc737e7f08ad110b7f6a
parent329f06d59a8713b644fad120460b6509be09ac53 (diff)
downloadserenity-40af665a4929db2c387a047964025c89b6ef9016.zip
LibWeb: Add margin box helpers to Layout::FormattingState
-rw-r--r--Userland/Libraries/LibWeb/Layout/FormattingState.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/FormattingState.h b/Userland/Libraries/LibWeb/Layout/FormattingState.h
index 523d69c98d..99789b93e1 100644
--- a/Userland/Libraries/LibWeb/Layout/FormattingState.h
+++ b/Userland/Libraries/LibWeb/Layout/FormattingState.h
@@ -66,6 +66,9 @@ struct FormattingState {
float margin_box_top() const { return margin_top + border_top + padding_top; }
float margin_box_bottom() const { return margin_bottom + border_bottom + padding_bottom; }
+ float margin_box_width() const { return margin_box_left() + content_width + margin_box_right(); }
+ float margin_box_height() const { return margin_box_top() + content_height + margin_box_bottom(); }
+
float border_box_left() const { return border_left + padding_left; }
float border_box_right() const { return border_right + padding_right; }
float border_box_top() const { return border_top + padding_top; }