1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 04:47:34 +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:
Andrew Kaster 2022-09-25 16:38:21 -06:00 committed by Linus Groh
parent a2ccb00e1d
commit f0c5f77f99
122 changed files with 334 additions and 317 deletions

View file

@ -21,10 +21,9 @@ class CloseEvent : public DOM::Event {
WEB_PLATFORM_OBJECT(CloseEvent, DOM::Event);
public:
static CloseEvent* create(JS::Realm&, FlyString const& event_name, CloseEventInit const& event_init = {});
static CloseEvent* create(HTML::Window&, FlyString const& event_name, CloseEventInit const& event_init = {});
static CloseEvent* create_with_global_object(HTML::Window&, FlyString const& event_name, CloseEventInit const& event_init);
CloseEvent(HTML::Window&, FlyString const& event_name, CloseEventInit const& event_init);
static CloseEvent* construct_impl(JS::Realm&, FlyString const& event_name, CloseEventInit const& event_init);
virtual ~CloseEvent() override;
@ -33,6 +32,8 @@ public:
String reason() const { return m_reason; }
private:
CloseEvent(JS::Realm&, FlyString const& event_name, CloseEventInit const& event_init);
bool m_was_clean { false };
u16 m_code { 0 };
String m_reason;