mirror of
https://github.com/RGBCube/serenity
synced 2025-06-01 03:18:11 +00:00
LibWeb: Ensure DocumentObserver document_completely_loaded() is called
This stopped being called for anything without a navigable container
after 76a97d8
, due to the early return. This broke SVG <use> elements
that reference elements defined later in the document.
This commit is contained in:
parent
785c9d5c2b
commit
daecf741d4
3 changed files with 31 additions and 6 deletions
|
@ -1974,6 +1974,14 @@ void Document::completely_finish_loading()
|
|||
if (!navigable())
|
||||
return;
|
||||
|
||||
ScopeGuard notify_observers = [this] {
|
||||
auto observers_to_notify = m_document_observers.values();
|
||||
for (auto& document_observer : observers_to_notify) {
|
||||
if (document_observer->document_completely_loaded())
|
||||
document_observer->document_completely_loaded()->function()();
|
||||
}
|
||||
};
|
||||
|
||||
// 1. Assert: document's browsing context is non-null.
|
||||
VERIFY(browsing_context());
|
||||
|
||||
|
@ -2002,12 +2010,6 @@ void Document::completely_finish_loading()
|
|||
container->dispatch_event(DOM::Event::create(container->realm(), HTML::EventNames::load));
|
||||
});
|
||||
}
|
||||
|
||||
auto observers_to_notify = m_document_observers.values();
|
||||
for (auto& document_observer : observers_to_notify) {
|
||||
if (document_observer->document_completely_loaded())
|
||||
document_observer->document_completely_loaded()->function()();
|
||||
}
|
||||
}
|
||||
|
||||
String Document::cookie(Cookie::Source source)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue