mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
LibWeb: Scroll viewport to (0, 0) after loading a new document
This fixes a long-standing bug where the view wouldn't update when navigating to a new page after looking at the ACID2 test. This happened because ACID2 actually scrolls the viewport far down. We didn't reset the scroll position upon navigation, and so the new page thought that we were still scrolled very far down, and this broke the invalidation rect calculations.
This commit is contained in:
parent
e91edcaa28
commit
52ed43d139
1 changed files with 2 additions and 0 deletions
|
@ -299,6 +299,8 @@ void FrameLoader::resource_did_load()
|
|||
|
||||
if (!url.fragment().is_empty())
|
||||
browsing_context().scroll_to_anchor(url.fragment());
|
||||
else
|
||||
browsing_context().set_viewport_scroll_offset({ 0, 0 });
|
||||
|
||||
if (auto* host_element = browsing_context().host_element()) {
|
||||
// FIXME: Perhaps in the future we'll have a better common base class for <frame> and <iframe>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue