LibWeb: Force a relayout when scrolling to anchor

This ensures that the layout information is current, even when the
scroll request happens immediately upon page load.

This fixes an issue where reloading ACID2 wouldn't scroll down to the
"#top" anchor point.
This commit is contained in:
Andreas Kling 2022-02-15 14:12:23 +01:00
commit 4708a65160
Notes: sideshowbarker 2024-07-17 18:45:56 +09:00

View file

@ -164,7 +164,7 @@ void BrowsingContext::scroll_to_anchor(String const& fragment)
}
}
active_document()->update_layout();
active_document()->force_layout();
if (!element || !element->layout_node())
return;