1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 06:57:46 +00:00

LibWeb: Only propagate CSS overflow to the viewport once per tree build

Before this change, we were doing it after every layout, which meant
that already-propagated overflow could be propagated again, which led to
incorrect scrolling behavior.
This commit is contained in:
Andreas Kling 2023-11-02 20:08:02 +01:00
parent bc6f19da0e
commit f9cab320e6
5 changed files with 13 additions and 6 deletions

View file

@ -984,10 +984,10 @@ void Document::update_layout()
if (!m_layout_root) {
Layout::TreeBuilder tree_builder;
m_layout_root = verify_cast<Layout::Viewport>(*tree_builder.build(*this));
}
if (auto* document_element = this->document_element()) {
propagate_overflow_to_viewport(*document_element, *m_layout_root);
if (auto* document_element = this->document_element()) {
propagate_overflow_to_viewport(*document_element, *m_layout_root);
}
}
Layout::LayoutState layout_state;