|
@@ -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)
|