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.
This commit is contained in:
Aliaksandr Kalenik 2024-03-17 09:48:03 +01:00 committed by Andreas Kling
parent e9383b9c86
commit 15524b97b6
Notes: sideshowbarker 2024-07-17 10:16:43 +09:00

View File

@ -926,10 +926,8 @@ JS::NonnullGCPtr<Geometry::DOMRectList> 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<Painting::ViewportPaintable*>(document().paintable())->resolve_paint_only_properties();
}
const_cast<Document&>(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()) {