diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index c11c5bb1ca..d6899a790c 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -22,7 +22,7 @@ namespace Web::Layout { FormattingContext::FormattingContext(Type type, Box& context_box, FormattingContext* parent) : m_type(type) , m_parent(parent) - , m_context_box(&context_box) + , m_context_box(context_box) { } diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.h b/Userland/Libraries/LibWeb/Layout/FormattingContext.h index d88163b4bd..895bd9ddff 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.h +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.h @@ -25,8 +25,8 @@ public: virtual void run(Box&, LayoutMode) = 0; - Box& context_box() { return *m_context_box; } - const Box& context_box() const { return *m_context_box; } + Box& context_box() { return m_context_box; } + const Box& context_box() const { return m_context_box; } FormattingContext* parent() { return m_parent; } const FormattingContext* parent() const { return m_parent; } @@ -69,7 +69,7 @@ protected: Type m_type {}; FormattingContext* m_parent { nullptr }; - Box* m_context_box { nullptr }; + Box& m_context_box; }; }