From 046d1169dee777b026c351dc2ede39d4f32b66c0 Mon Sep 17 00:00:00 2001 From: Jelle Raaijmakers Date: Mon, 16 Jun 2025 16:55:44 +0200 Subject: [PATCH] LibWeb: Only calculate enclosing rect for fragments if we use it This would show up in profiles for pages with lots of fragments. No functional changes. --- Libraries/LibWeb/Painting/PaintableBox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Libraries/LibWeb/Painting/PaintableBox.cpp b/Libraries/LibWeb/Painting/PaintableBox.cpp index d974a37cf51..7371a94bb51 100644 --- a/Libraries/LibWeb/Painting/PaintableBox.cpp +++ b/Libraries/LibWeb/Painting/PaintableBox.cpp @@ -888,8 +888,8 @@ void PaintableWithLines::paint(PaintContext& context, PaintPhase phase) const for (auto const& fragment : m_fragments) { auto fragment_absolute_rect = fragment.absolute_rect(); - auto fragment_absolute_device_rect = context.enclosing_device_rect(fragment_absolute_rect); if (context.should_show_line_box_borders()) { + auto fragment_absolute_device_rect = context.enclosing_device_rect(fragment_absolute_rect); context.display_list_recorder().draw_rect(fragment_absolute_device_rect.to_type(), Color::Green); context.display_list_recorder().draw_line( context.rounded_device_point(fragment_absolute_rect.top_left().translated(0, fragment.baseline())).to_type(),