diff options
author | Andrew Kaster <akaster@serenityos.org> | 2022-09-25 16:15:49 -0600 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2022-10-01 21:05:32 +0100 |
commit | 8de7e49a5648cdf084689a6b6cb49715f8ccad02 (patch) | |
tree | 24620bc96e781ac58ff091341de488717699822b /Userland/Libraries/LibWeb/DOM/MutationObserver.h | |
parent | 8407bf60c56bc41d6f450bb21495c8591b9271bd (diff) | |
download | serenity-8de7e49a5648cdf084689a6b6cb49715f8ccad02.zip |
LibWeb: Remove unecessary dependence on Window from DOM and WebIDL
These classes only needed Window to get at its realm. Pass a realm
directly to construct DOM and WebIDL classes.
This change importantly removes the guarantee that a Document will
always have a non-null Window object. Only Documents created by a
BrowsingContext will have a non-null Window object. Documents created by
for example, DocumentFragment, will not have a Window (soon).
This incremental commit leaves some workarounds in place to keep other
parts of the code building.
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/MutationObserver.h')
-rw-r--r-- | Userland/Libraries/LibWeb/DOM/MutationObserver.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/MutationObserver.h b/Userland/Libraries/LibWeb/DOM/MutationObserver.h index b6f86d7b61..3bc7a85d84 100644 --- a/Userland/Libraries/LibWeb/DOM/MutationObserver.h +++ b/Userland/Libraries/LibWeb/DOM/MutationObserver.h @@ -32,7 +32,7 @@ class MutationObserver final : public Bindings::PlatformObject { WEB_PLATFORM_OBJECT(MutationObserver, Bindings::PlatformObject); public: - static JS::NonnullGCPtr<MutationObserver> create_with_global_object(HTML::Window&, JS::GCPtr<WebIDL::CallbackType>); + static JS::NonnullGCPtr<MutationObserver> construct_impl(JS::Realm&, JS::GCPtr<WebIDL::CallbackType>); virtual ~MutationObserver() override; WebIDL::ExceptionOr<void> observe(Node& target, MutationObserverInit options = {}); @@ -50,7 +50,7 @@ public: } private: - MutationObserver(HTML::Window&, JS::GCPtr<WebIDL::CallbackType>); + MutationObserver(JS::Realm&, JS::GCPtr<WebIDL::CallbackType>); virtual void visit_edges(Cell::Visitor&) override; |