From d18bc9ccd21d9bc03d67fca444886b5b18b9acd2 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 18 Jan 2021 17:33:16 +0100 Subject: [PATCH] LibWeb: Add Layout::Box::margin_box_width() --- Userland/Libraries/LibWeb/Layout/Box.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Userland/Libraries/LibWeb/Layout/Box.h b/Userland/Libraries/LibWeb/Layout/Box.h index fbc4850eae..5387ab07ec 100644 --- a/Userland/Libraries/LibWeb/Layout/Box.h +++ b/Userland/Libraries/LibWeb/Layout/Box.h @@ -52,6 +52,12 @@ public: float width() const { return m_size.width(); } float height() const { return m_size.height(); } + float margin_box_width() const + { + auto margin_box = box_model().margin_box(); + return width() + margin_box.left + margin_box.right; + } + float border_box_width() const { auto border_box = box_model().border_box();