1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 03:37:35 +00:00

LibWeb: Only forward scroll requests for the top-level browsing context

We don't want to scroll the whole web view just because some iframe is
asking to be scrolled.
This commit is contained in:
Andreas Kling 2023-05-27 17:07:08 +02:00
parent 58d3322b0e
commit fdbdc4d5ff
3 changed files with 22 additions and 12 deletions

View file

@ -621,7 +621,7 @@ void BrowsingContext::scroll_to(CSSPixelPoint position)
active_document()->update_layout();
}
if (m_page)
if (m_page && this == &m_page->top_level_browsing_context())
m_page->client().page_did_request_scroll_to(position);
}
@ -659,7 +659,7 @@ void BrowsingContext::scroll_to_anchor(DeprecatedString const& fragment)
target_rect.translate_by(-padding_box.left, -padding_box.top);
}
if (m_page)
if (m_page && this == &m_page->top_level_browsing_context())
m_page->client().page_did_request_scroll_into_view(target_rect);
}