From d24667a1b62850bc1ad699055f163f7bfcbff51f Mon Sep 17 00:00:00 2001 From: Sebastian Zaha Date: Wed, 12 Jul 2023 11:19:08 +0200 Subject: [PATCH] LibWeb: Rename loaded observer event to match spec The `document_fully_loaded` event should use the adjective "completely" so as to match the spec and code convention. See `Document::is_completely_loaded` and `m_completely_loaded_time`. --- Userland/Libraries/LibWeb/DOM/Document.cpp | 4 ++-- Userland/Libraries/LibWeb/DOM/DocumentObserver.h | 2 +- Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 0cb778d95b..99809e8ae6 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -1774,8 +1774,8 @@ void Document::completely_finish_loading() auto observers_to_notify = m_document_observers.values(); for (auto& document_observer : observers_to_notify) { - if (document_observer->document_fully_loaded) - document_observer->document_fully_loaded(); + if (document_observer->document_completely_loaded) + document_observer->document_completely_loaded(); } } diff --git a/Userland/Libraries/LibWeb/DOM/DocumentObserver.h b/Userland/Libraries/LibWeb/DOM/DocumentObserver.h index 4b52847927..d41be84aac 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentObserver.h +++ b/Userland/Libraries/LibWeb/DOM/DocumentObserver.h @@ -18,7 +18,7 @@ class DocumentObserver final : public Bindings::PlatformObject { public: JS::SafeFunction document_became_inactive; - JS::SafeFunction document_fully_loaded; + JS::SafeFunction document_completely_loaded; private: explicit DocumentObserver(JS::Realm&, DOM::Document&); diff --git a/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp index 556baf0f84..b309e6c8f1 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGUseElement.cpp @@ -33,7 +33,7 @@ JS::ThrowCompletionOr SVGUseElement::initialize(JS::Realm& realm) set_shadow_root(shadow_root); m_document_observer = TRY(realm.heap().allocate(realm, realm, document())); - m_document_observer->document_fully_loaded = [this]() { + m_document_observer->document_completely_loaded = [this]() { clone_element_tree_as_our_shadow_tree(referenced_element()); };