diff options
author | MacDue <macdue@dueutil.tech> | 2022-09-23 23:15:28 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-24 00:38:10 +0200 |
commit | f5052e5017e9aa6b37c5e0ece82dc782c52c4b2f (patch) | |
tree | 0f7d73c9cf8a5dbf0b012bb34c1b7a272a2fc9b0 /Userland | |
parent | 29260d148095f83ece011a5011aaa33e04c38269 (diff) | |
download | serenity-f5052e5017e9aa6b37c5e0ece82dc782c52c4b2f.zip |
LibWeb: Don't trigger page_did_layout() on non-active documents
PageHost assumes page_did_layout() to be called when the layout
of the active document changes, however, it seems that sometimes
the layout can change on another document before the layout of
the active document has been calculated. This leads to a VERIFY()
being hit.
This commit now makes it so page_did_layout() is only called when
the document is the active document.
Fixes #15328
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/Document.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 121056bddb..6c383f7959 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -816,7 +816,7 @@ void Document::update_layout() browsing_context()->set_needs_display(); - if (browsing_context()->is_top_level()) { + if (browsing_context()->is_top_level() && browsing_context()->active_document() == this) { if (auto* page = this->page()) page->client().page_did_layout(); } |