From 108de5dea032664e9f8e2278096a5021efd81884 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Sat, 4 Dec 2021 14:47:24 +0100 Subject: [PATCH] LibWeb: Stop sending "load" event twice to iframes The "completely finish loading" algorithm (from the HTML spec) is responsible for sending a "load" event to nested browsing context containers (iframes). This patch removes the old mechanism for sending "load" events, which we had mistakenly kept around, causing two events to be sent instead of one. :^) --- Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp | 5 ----- Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h | 2 -- Userland/Libraries/LibWeb/Loader/FrameLoader.cpp | 3 --- 3 files changed, 10 deletions(-) diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp index 24e372943b..ac89d3b789 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.cpp @@ -56,9 +56,4 @@ const DOM::Document* BrowsingContextContainer::content_document() const return m_nested_browsing_context ? m_nested_browsing_context->active_document() : nullptr; } -void BrowsingContextContainer::nested_browsing_context_did_load(Badge) -{ - dispatch_event(DOM::Event::create(EventNames::load)); -} - } diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h index 3d0c2db372..bde9bc394c 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContextContainer.h @@ -23,8 +23,6 @@ public: Origin content_origin() const; bool may_access_from_origin(const Origin&) const; - void nested_browsing_context_did_load(Badge); - virtual void inserted() override; protected: diff --git a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp index 8620462bd1..e0c2d559f9 100644 --- a/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp +++ b/Userland/Libraries/LibWeb/Loader/FrameLoader.cpp @@ -309,9 +309,6 @@ void FrameLoader::resource_did_load() else browsing_context().set_viewport_scroll_offset({ 0, 0 }); - if (auto* container = browsing_context().container()) - container->nested_browsing_context_did_load({}); - if (auto* page = browsing_context().page()) page->client().page_did_finish_loading(url); }