mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 20:15:17 +00:00
LibHTML: Tear down the layout tree before changing the Frame's document
We don't want to deal with document().frame() being null inside layout tree code, so this makes sure we tear it down before the frame has a chance to get nulled out.
This commit is contained in:
parent
a259832266
commit
c458327429
Notes:
sideshowbarker
2024-07-19 11:44:30 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/c4583274292
1 changed files with 3 additions and 3 deletions
|
@ -52,11 +52,11 @@ void HtmlView::set_document(Document* document)
|
|||
};
|
||||
}
|
||||
|
||||
m_layout_root = nullptr;
|
||||
|
||||
main_frame().set_document(document);
|
||||
|
||||
if (document == nullptr)
|
||||
m_layout_root = nullptr;
|
||||
else
|
||||
if (document)
|
||||
m_layout_root = document->create_layout_tree(document->style_resolver(), nullptr);
|
||||
|
||||
#ifdef HTML_DEBUG
|
||||
|
|
Loading…
Add table
Reference in a new issue