LibWeb: Only update layout if actually needed when scrolling to anchor

This commit is contained in:
Andreas Kling 2021-10-18 10:17:01 +02:00
commit f9e814826f
Notes: sideshowbarker 2024-07-18 02:11:55 +09:00

View file

@ -158,8 +158,7 @@ void BrowsingContext::scroll_to_anchor(String const& fragment)
}
}
// FIXME: This is overly aggressive and should be something more like a "update_layout_if_needed()"
active_document()->force_layout();
active_document()->update_layout();
if (!element || !element->layout_node())
return;