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
commit fdbdc4d5ff
Notes: sideshowbarker 2024-07-17 17:38:29 +09:00
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);
}