From 15524b97b60a104ace71c24a2009603ca4cc1a78 Mon Sep 17 00:00:00 2001 From: Aliaksandr Kalenik Date: Sun, 17 Mar 2024 09:48:03 +0100 Subject: [PATCH] LibWeb: Update paint-only props only when needed in get_client_rects() There is no need to unconditionally resolve them whenever the function is called. --- Userland/Libraries/LibWeb/DOM/Element.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Element.cpp b/Userland/Libraries/LibWeb/DOM/Element.cpp index 857bde12c45..07af809d500 100644 --- a/Userland/Libraries/LibWeb/DOM/Element.cpp +++ b/Userland/Libraries/LibWeb/DOM/Element.cpp @@ -926,10 +926,8 @@ JS::NonnullGCPtr Element::get_client_rects() const VERIFY(navigable); auto viewport_offset = navigable->viewport_scroll_offset(); - if (document().paintable()) { - // NOTE: Make sure CSS transforms are resolved before it is used to calculate the rect position. - const_cast(document().paintable())->resolve_paint_only_properties(); - } + // NOTE: Make sure CSS transforms are resolved before it is used to calculate the rect position. + const_cast(document()).update_paint_and_hit_testing_properties_if_needed(); Gfx::AffineTransform transform; for (auto const* containing_block = this->paintable_box(); containing_block; containing_block = containing_block->containing_block()) {