mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 00:47:36 +00:00
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.
This commit is contained in:
parent
a2ccb00e1d
commit
f0c5f77f99
122 changed files with 334 additions and 317 deletions
|
@ -5,20 +5,20 @@
|
|||
*/
|
||||
|
||||
#include <AK/String.h>
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/HTML/Storage.h>
|
||||
#include <LibWeb/HTML/Window.h>
|
||||
|
||||
namespace Web::HTML {
|
||||
|
||||
JS::NonnullGCPtr<Storage> Storage::create(HTML::Window& window)
|
||||
JS::NonnullGCPtr<Storage> Storage::create(JS::Realm& realm)
|
||||
{
|
||||
return *window.heap().allocate<Storage>(window.realm(), window);
|
||||
return *realm.heap().allocate<Storage>(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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue