From f122e1f78ac36f8acf2bc9e51e3788c8c0ca5706 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Fri, 29 Aug 2025 10:30:55 +0200 Subject: [PATCH] LibWeb: Let PaintableBox be const for longer in LayoutState Makes it clearer where we're modifying it. No functional changes. --- Libraries/LibWeb/Layout/LayoutState.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Libraries/LibWeb/Layout/LayoutState.cpp b/Libraries/LibWeb/Layout/LayoutState.cpp index b19d24056bb..a3eb6fe8c79 100644 --- a/Libraries/LibWeb/Layout/LayoutState.cpp +++ b/Libraries/LibWeb/Layout/LayoutState.cpp @@ -56,7 +56,7 @@ static CSSPixelRect measure_scrollable_overflow(Box const& box) if (!box.paintable_box()) return {}; - auto& paintable_box = const_cast(*box.paintable_box()); + auto const& paintable_box = *box.paintable_box(); if (paintable_box.scrollable_overflow_rect().has_value()) return paintable_box.scrollable_overflow_rect().value(); @@ -151,7 +151,7 @@ static CSSPixelRect measure_scrollable_overflow(Box const& box) has_scrollable_overflow = !paintable_absolute_padding_box.contains(scrollable_overflow_rect); } - paintable_box.set_overflow_data(Painting::PaintableBox::OverflowData { + const_cast(paintable_box).set_overflow_data({ .scrollable_overflow_rect = scrollable_overflow_rect, .has_scrollable_overflow = has_scrollable_overflow, });