1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

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
parent 1b2e1c19e1
commit 4708a65160

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;