From f0c5f77f99801441db1d8e99c14dae2ab1357b47 Mon Sep 17 00:00:00 2001 From: Andrew Kaster Date: Sun, 25 Sep 2022 16:38:21 -0600 Subject: LibWeb: Remove unecessary dependence on Window from HTML classes These classes only needed Window to get at its realm. Pass a realm directly to construct HTML classes. --- Userland/Libraries/LibWeb/HTML/Storage.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'Userland/Libraries/LibWeb/HTML/Storage.cpp') diff --git a/Userland/Libraries/LibWeb/HTML/Storage.cpp b/Userland/Libraries/LibWeb/HTML/Storage.cpp index 7db1d4a554..5641331365 100644 --- a/Userland/Libraries/LibWeb/HTML/Storage.cpp +++ b/Userland/Libraries/LibWeb/HTML/Storage.cpp @@ -5,20 +5,20 @@ */ #include +#include #include -#include namespace Web::HTML { -JS::NonnullGCPtr Storage::create(HTML::Window& window) +JS::NonnullGCPtr Storage::create(JS::Realm& realm) { - return *window.heap().allocate(window.realm(), window); + return *realm.heap().allocate(realm, realm); } -Storage::Storage(HTML::Window& window) - : PlatformObject(window.realm()) +Storage::Storage(JS::Realm& realm) + : PlatformObject(realm) { - set_prototype(&window.cached_web_prototype("Storage")); + set_prototype(&Bindings::cached_web_prototype(realm, "Storage")); } Storage::~Storage() = default; -- cgit v1.2.3