LibWeb: Only propagate overflow from document element when it exists

This commit is contained in:
Andreas Kling 2023-08-17 18:34:27 +02:00
parent e9a718ff88
commit 4bb907aa22
Notes: sideshowbarker 2024-07-17 00:59:43 +09:00

View File

@ -974,7 +974,9 @@ void Document::update_layout()
m_layout_root = verify_cast<Layout::Viewport>(*tree_builder.build(*this));
}
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;