diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp index f76831a5cb9..9dce0197b83 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/BindingsGenerator/IDLGenerators.cpp @@ -2039,7 +2039,6 @@ void generate_constructor_implementation(IDL::Interface const& interface) #include #include #include -#include #if __has_include() # include #elif __has_include() @@ -2141,8 +2140,7 @@ JS::ThrowCompletionOr @constructor_class@::construct(FunctionObject generator.append(R"~~~( auto& vm = this->vm(); - [[maybe_unused]] auto& realm = *vm.current_realm(); - [[maybe_unused]] auto& window = verify_cast(realm.global_object()); + auto& realm = *vm.current_realm(); )~~~"); if (!constructor.parameters.is_empty()) { @@ -2153,29 +2151,14 @@ JS::ThrowCompletionOr @constructor_class@::construct(FunctionObject generator.set(".constructor_arguments", arguments_builder.string_view()); generator.append(R"~~~( - auto construct_impl = [&] () { - if constexpr (requires(T) { T::construct_impl(declval<::JS::Realm&>(), @.constructor_arguments@ ); }) - return T::construct_impl(realm, @.constructor_arguments@); - else if constexpr (requires(T) { T::create_with_global_object(declval<::Web::HTML::Window&>(), @.constructor_arguments@); }) - return T::create_with_global_object(window, @.constructor_arguments@); - else if constexpr (requires(T) { sizeof(T); }) - static_assert(DependentFalse, "Bound type is missing constructor factory"); - }; + auto impl = TRY(throw_dom_exception_if_needed(vm, [&] { return @fully_qualified_name@::construct_impl(realm, @.constructor_arguments@); })); )~~~"); } else { generator.append(R"~~~( - auto construct_impl = [&] () { - if constexpr (requires(T) { T::construct_impl(declval<::JS::Realm&>()); }) - return T::construct_impl(realm); - else if constexpr (requires(T) { T::create_with_global_object(declval<::Web::HTML::Window&>()); }) - return T::create_with_global_object(window); - else if constexpr (requires(T) { sizeof(T); }) - static_assert(DependentFalse, "Bound type is missing constructor factory"); - }; + auto impl = TRY(throw_dom_exception_if_needed(vm, [&] { return @fully_qualified_name@::construct_impl(realm); })); )~~~"); } generator.append(R"~~~( - auto impl = TRY(throw_dom_exception_if_needed(vm, [&] { return construct_impl.operator()<@fully_qualified_name@>(); })); return &(*impl); )~~~"); } else { diff --git a/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.cpp b/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.cpp index ef146e315b1..ae53ec45137 100644 --- a/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/LegacyPlatformObject.cpp @@ -136,7 +136,7 @@ JS::ThrowCompletionOr> LegacyPlatformObject::le // FIXME: Can this throw? if (is_supported_property_index(index)) { - auto value = TRY(throw_dom_exception_if_needed(global_object(), [&] { return item_value(index); })); + auto value = TRY(throw_dom_exception_if_needed(vm(), [&] { return item_value(index); })); // 5. Let desc be a newly created Property Descriptor with no fields. JS::PropertyDescriptor descriptor; diff --git a/Userland/Libraries/LibWeb/Bindings/NavigatorPrototype.h b/Userland/Libraries/LibWeb/Bindings/NavigatorPrototype.h index 3f5242ba222..504b56aaecb 100644 --- a/Userland/Libraries/LibWeb/Bindings/NavigatorPrototype.h +++ b/Userland/Libraries/LibWeb/Bindings/NavigatorPrototype.h @@ -6,11 +6,9 @@ #pragma once -#include #include #include #include -#include namespace Web::Bindings { diff --git a/Userland/Libraries/LibWeb/DOM/AbortSignal.cpp b/Userland/Libraries/LibWeb/DOM/AbortSignal.cpp index 67540ba5fd4..bdee0430788 100644 --- a/Userland/Libraries/LibWeb/DOM/AbortSignal.cpp +++ b/Userland/Libraries/LibWeb/DOM/AbortSignal.cpp @@ -23,11 +23,6 @@ AbortSignal::AbortSignal(JS::Realm& realm) set_prototype(&Bindings::cached_web_prototype(realm, "AbortSignal")); } -AbortSignal::AbortSignal(HTML::Window& window) - : AbortSignal(window.realm()) -{ -} - // https://dom.spec.whatwg.org/#abortsignal-add void AbortSignal::add_abort_algorithm(Function abort_algorithm) { diff --git a/Userland/Libraries/LibWeb/DOM/AbortSignal.h b/Userland/Libraries/LibWeb/DOM/AbortSignal.h index a4fcd8939b1..dab9d78321c 100644 --- a/Userland/Libraries/LibWeb/DOM/AbortSignal.h +++ b/Userland/Libraries/LibWeb/DOM/AbortSignal.h @@ -40,7 +40,6 @@ public: private: explicit AbortSignal(JS::Realm&); - explicit AbortSignal(HTML::Window&); virtual void visit_edges(JS::Cell::Visitor&) override; diff --git a/Userland/Libraries/LibWeb/DOM/CDATASection.cpp b/Userland/Libraries/LibWeb/DOM/CDATASection.cpp index ce465a6de1e..798b364c2a9 100644 --- a/Userland/Libraries/LibWeb/DOM/CDATASection.cpp +++ b/Userland/Libraries/LibWeb/DOM/CDATASection.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::DOM { diff --git a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp index d474d1ccf1d..653215b7465 100644 --- a/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp +++ b/Userland/Libraries/LibWeb/DOM/DOMTokenList.cpp @@ -10,7 +10,6 @@ #include #include #include -#include #include namespace { @@ -55,7 +54,7 @@ namespace Web::DOM { DOMTokenList* DOMTokenList::create(Element const& associated_element, FlyString associated_attribute) { - auto& realm = associated_element.document().window().realm(); + auto& realm = associated_element.realm(); return realm.heap().allocate(realm, associated_element, move(associated_attribute)); } diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 702c8c5ffcf..df64ff4877c 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -288,11 +288,6 @@ JS::NonnullGCPtr Document::create(JS::Realm& realm, AK::URL const& url return *realm.heap().allocate(realm, realm, url); } -JS::NonnullGCPtr Document::create(HTML::Window& window, AK::URL const& url) -{ - return create(window.realm(), url); -} - Document::Document(JS::Realm& realm, const AK::URL& url) : ParentNode(realm, *this, NodeType::DOCUMENT_NODE) , m_style_computer(make(*this)) diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index b18edfba67e..5524a87752a 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -84,7 +84,6 @@ public: static JS::NonnullGCPtr create_and_initialize(Type, String content_type, HTML::NavigationParams); static JS::NonnullGCPtr create(JS::Realm&, AK::URL const& url = "about:blank"sv); - static JS::NonnullGCPtr create(HTML::Window&, AK::URL const& url = "about:blank"sv); static JS::NonnullGCPtr construct_impl(JS::Realm&); virtual ~Document() override; diff --git a/Userland/Libraries/LibWeb/DOM/Event.cpp b/Userland/Libraries/LibWeb/DOM/Event.cpp index a6449f36c90..b862d279938 100644 --- a/Userland/Libraries/LibWeb/DOM/Event.cpp +++ b/Userland/Libraries/LibWeb/DOM/Event.cpp @@ -11,7 +11,6 @@ #include #include #include -#include namespace Web::DOM { @@ -20,11 +19,6 @@ JS::NonnullGCPtr Event::create(JS::Realm& realm, FlyString const& event_n return *realm.heap().allocate(realm, realm, event_name, event_init); } -JS::NonnullGCPtr Event::create(HTML::Window& window, FlyString const& event_name, EventInit const& event_init) -{ - return create(window.realm(), event_name, event_init); -} - JS::NonnullGCPtr Event::construct_impl(JS::Realm& realm, FlyString const& event_name, EventInit const& event_init) { return create(realm, event_name, event_init); @@ -47,16 +41,6 @@ Event::Event(JS::Realm& realm, FlyString const& type, EventInit const& event_ini { } -Event::Event(HTML::Window& window, FlyString const& type, EventInit const& event_init) - : Event(window.realm(), type, event_init) -{ -} - -Event::Event(HTML::Window& window, FlyString const& type) - : Event(window.realm(), type) -{ -} - void Event::visit_edges(Visitor& visitor) { Base::visit_edges(visitor); diff --git a/Userland/Libraries/LibWeb/DOM/Event.h b/Userland/Libraries/LibWeb/DOM/Event.h index 8120749930e..c30e54cf4be 100644 --- a/Userland/Libraries/LibWeb/DOM/Event.h +++ b/Userland/Libraries/LibWeb/DOM/Event.h @@ -46,13 +46,10 @@ public: using Path = Vector; static JS::NonnullGCPtr create(JS::Realm&, FlyString const& event_name, EventInit const& event_init = {}); - static JS::NonnullGCPtr create(HTML::Window&, FlyString const& event_name, EventInit const& event_init = {}); static JS::NonnullGCPtr construct_impl(JS::Realm&, FlyString const& event_name, EventInit const& event_init); Event(JS::Realm&, FlyString const& type); Event(JS::Realm&, FlyString const& type, EventInit const& event_init); - Event(HTML::Window&, FlyString const& type); - Event(HTML::Window&, FlyString const& type, EventInit const& event_init); virtual ~Event() = default; diff --git a/Userland/Libraries/LibWeb/DOM/IDLEventListener.cpp b/Userland/Libraries/LibWeb/DOM/IDLEventListener.cpp index 7356f369240..99550c593d9 100644 --- a/Userland/Libraries/LibWeb/DOM/IDLEventListener.cpp +++ b/Userland/Libraries/LibWeb/DOM/IDLEventListener.cpp @@ -5,7 +5,6 @@ */ #include -#include namespace Web::DOM { diff --git a/Userland/Libraries/LibWeb/DOM/LiveNodeList.cpp b/Userland/Libraries/LibWeb/DOM/LiveNodeList.cpp index 019c918d37c..c0b5ea54783 100644 --- a/Userland/Libraries/LibWeb/DOM/LiveNodeList.cpp +++ b/Userland/Libraries/LibWeb/DOM/LiveNodeList.cpp @@ -7,7 +7,6 @@ #include #include -#include namespace Web::DOM { diff --git a/Userland/Libraries/LibWeb/DOM/NodeFilter.cpp b/Userland/Libraries/LibWeb/DOM/NodeFilter.cpp index 05d7c8f2609..2ab9d174697 100644 --- a/Userland/Libraries/LibWeb/DOM/NodeFilter.cpp +++ b/Userland/Libraries/LibWeb/DOM/NodeFilter.cpp @@ -4,9 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include -#include namespace Web::DOM { diff --git a/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp b/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp index 712786ade64..7324659a86c 100644 --- a/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp +++ b/Userland/Libraries/LibWeb/DOM/NodeIterator.cpp @@ -41,8 +41,8 @@ JS::NonnullGCPtr NodeIterator::create(Node& root, unsigned what_to // 1. Let iterator be a new NodeIterator object. // 2. Set iterator’s root and iterator’s reference to root. // 3. Set iterator’s pointer before reference to true. - auto& window_object = root.document().window(); - auto* iterator = window_object.heap().allocate(window_object.realm(), root); + auto& realm = root.realm(); + auto* iterator = realm.heap().allocate(realm, root); // 4. Set iterator’s whatToShow to whatToShow. iterator->m_what_to_show = what_to_show; diff --git a/Userland/Libraries/LibWeb/DOM/ParentNode.cpp b/Userland/Libraries/LibWeb/DOM/ParentNode.cpp index 02916f82b77..472f284c42d 100644 --- a/Userland/Libraries/LibWeb/DOM/ParentNode.cpp +++ b/Userland/Libraries/LibWeb/DOM/ParentNode.cpp @@ -13,7 +13,6 @@ #include #include #include -#include #include namespace Web::DOM { diff --git a/Userland/Libraries/LibWeb/DOM/Text.h b/Userland/Libraries/LibWeb/DOM/Text.h index 59a43a0cbf2..6f22fbaf47e 100644 --- a/Userland/Libraries/LibWeb/DOM/Text.h +++ b/Userland/Libraries/LibWeb/DOM/Text.h @@ -18,7 +18,7 @@ class Text : public CharacterData { public: virtual ~Text() override = default; - static JS::NonnullGCPtr construct_impl(JS::Realm& window, String const& data); + static JS::NonnullGCPtr construct_impl(JS::Realm& realm, String const& data); // ^Node virtual FlyString node_name() const override { return "#text"; } diff --git a/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp b/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp index 1f7edb50e15..ff51a66f765 100644 --- a/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp +++ b/Userland/Libraries/LibWeb/DOM/TreeWalker.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include #include #include @@ -35,8 +35,8 @@ JS::NonnullGCPtr TreeWalker::create(Node& root, unsigned what_to_sho { // 1. Let walker be a new TreeWalker object. // 2. Set walker’s root and walker’s current to root. - auto& window_object = root.document().window(); - auto* walker = window_object.heap().allocate(window_object.realm(), root); + auto& realm = root.realm(); + auto* walker = realm.heap().allocate(realm, root); // 3. Set walker’s whatToShow to whatToShow. walker->m_what_to_show = what_to_show; diff --git a/Userland/Libraries/LibWeb/Fetch/Body.cpp b/Userland/Libraries/LibWeb/Fetch/Body.cpp index 558753531d6..7e06d75f26c 100644 --- a/Userland/Libraries/LibWeb/Fetch/Body.cpp +++ b/Userland/Libraries/LibWeb/Fetch/Body.cpp @@ -161,7 +161,7 @@ JS::NonnullGCPtr consume_body(JS::Realm& realm, BodyMixin const& ob // 4. Let steps be to return the result of package data with the first argument given, type, and object’s MIME type. auto steps = [&realm, &object, type](JS::Value value) -> WebIDL::ExceptionOr { VERIFY(value.is_string()); - auto bytes = TRY_OR_RETURN_OOM(realm.global_object(), ByteBuffer::copy(value.as_string().string().bytes())); + auto bytes = TRY_OR_RETURN_OOM(realm, ByteBuffer::copy(value.as_string().string().bytes())); return package_data(realm, move(bytes), type, object.mime_type_impl()); }; diff --git a/Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp b/Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp index 7ebbfefb220..b05be1517a3 100644 --- a/Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp +++ b/Userland/Libraries/LibWeb/Geometry/DOMPoint.cpp @@ -6,7 +6,6 @@ #include #include -#include namespace Web::Geometry { diff --git a/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp b/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp index 1c6b8d7de81..80b5ea3d07f 100644 --- a/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/CloseEvent.cpp @@ -6,7 +6,6 @@ #include #include -#include namespace Web::HTML { @@ -15,11 +14,6 @@ CloseEvent* CloseEvent::create(JS::Realm& realm, FlyString const& event_name, Cl return realm.heap().allocate(realm, realm, event_name, event_init); } -CloseEvent* CloseEvent::create(HTML::Window& window, FlyString const& event_name, CloseEventInit const& event_init) -{ - return create(window.realm(), event_name, event_init); -} - CloseEvent* CloseEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, CloseEventInit const& event_init) { return create(realm, event_name, event_init); diff --git a/Userland/Libraries/LibWeb/HTML/CloseEvent.h b/Userland/Libraries/LibWeb/HTML/CloseEvent.h index 2fa57011175..621f1142f04 100644 --- a/Userland/Libraries/LibWeb/HTML/CloseEvent.h +++ b/Userland/Libraries/LibWeb/HTML/CloseEvent.h @@ -22,7 +22,6 @@ class CloseEvent : public 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* construct_impl(JS::Realm&, FlyString const& event_name, CloseEventInit const& event_init); virtual ~CloseEvent() override; diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp index 46c22f721f5..982dfd649fa 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp index 474a1af4c28..60bc4e31df7 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDataListElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp index 1801e692bab..57a416647ae 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDetailsElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp index f6ccac670f0..b63e78faead 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDialogElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp index 3f1ecd1b4ce..7ff717f1e07 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLDivElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp index 4585da81ed9..9e9b8c22119 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLEmbedElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp index ba4ae3da67d..9df7a9e9a47 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFieldSetElement.cpp @@ -4,9 +4,9 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp index 45266b57d4e..89032edfd07 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFontElement.cpp @@ -4,10 +4,10 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp index 707e69f44eb..dd2af513470 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLFrameElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp index 3f9196485ae..73122657579 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHRElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp index 74cbec9612d..e6bc7a47546 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHeadElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp index 46b5efa5d2d..24cbb8d1105 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHeadingElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp index 842055d99e9..d8d0eeff008 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLHtmlElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp index 48ee6eaf00a..c1f5c4fb957 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLLegendElement.cpp @@ -4,9 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp index a112424d68f..43c3dce152a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMapElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp index 798f4d3bba1..ed5b5232971 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMarqueeElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp index fbf1f6c64bf..62476384751 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMediaElement.cpp @@ -5,8 +5,8 @@ */ #include +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp index 7035eac2bdf..1499835d440 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMenuElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp index e57088c8a9b..425f077fb06 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMetaElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp index 9cc97e76159..f299750c9de 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLMeterElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp index 8bf0d433614..50141f521b6 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLModElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp index 2f613b3a6c5..7f4b85e1c51 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOListElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp index 72eb7f8fa42..81cc1c0afe9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptGroupElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp index de27226c664..d577473a572 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOptionElement.cpp @@ -6,13 +6,13 @@ */ #include +#include #include #include #include #include #include #include -#include #include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp index a469069590d..44bdf961317 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLOutputElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp index 1acfdbb3f6a..cfffd942a39 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLParagraphElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp index 390764ad604..aded0af35ba 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLParamElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp index 3dd888e721b..31986daad6f 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLPictureElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp index 76cd022d26f..70e641396a1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLPreElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp index 09d207a0c1a..71f1b5743eb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLQuoteElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index 384f034776b..63d3b15a3e2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -14,7 +15,6 @@ #include #include #include -#include #include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp index c1994c6ad3e..3bec245aac3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSelectElement.cpp @@ -5,11 +5,11 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp index c46cd74158d..49a434777a1 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSlotElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp index 5a470f31871..40f6d0141a0 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSourceElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp index 6e22b262e3c..b7f41ee0c62 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLSpanElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp index c1f31d3f3b4..96b5bba433c 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCaptionElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp index 6eda4d77263..49aafae7f0a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableCellElement.cpp @@ -4,10 +4,10 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp index 1a9773473d4..4055e3bddf4 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableColElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp index 1e20b470d1f..32fa50d1b8d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableElement.cpp @@ -5,6 +5,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include @@ -12,7 +13,6 @@ #include #include #include -#include #include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp index c0d129efed0..9793ac88f72 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableRowElement.cpp @@ -4,12 +4,12 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include #include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp index 9baefaf7d3c..76146bef10a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTableSectionElement.cpp @@ -5,11 +5,11 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include #include -#include #include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp index 93791926651..f803bce0440 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTextAreaElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp index 10283d07a15..27a06c1a6c9 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTimeElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp index 01b2607a875..e02d866cd6a 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLTrackElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp index 54d5c0f0e81..adc74730ce2 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLUListElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp index 9aa404dfa18..aca3da01abb 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLUnknownElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp index 0a6486cfa45..04810b30b50 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLVideoElement.cpp @@ -4,8 +4,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp b/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp index 9bb6f9a67ff..35160737207 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp +++ b/Userland/Libraries/LibWeb/HTML/MessageEvent.cpp @@ -6,7 +6,6 @@ #include #include -#include namespace Web::HTML { @@ -15,11 +14,6 @@ MessageEvent* MessageEvent::create(JS::Realm& realm, FlyString const& event_name return realm.heap().allocate(realm, realm, event_name, event_init); } -MessageEvent* MessageEvent::create(HTML::Window& window, FlyString const& event_name, MessageEventInit const& event_init) -{ - return create(window.realm(), event_name, event_init); -} - MessageEvent* MessageEvent::construct_impl(JS::Realm& realm, FlyString const& event_name, MessageEventInit const& event_init) { return create(realm, event_name, event_init); diff --git a/Userland/Libraries/LibWeb/HTML/MessageEvent.h b/Userland/Libraries/LibWeb/HTML/MessageEvent.h index 282a76b93db..ad4740d33cd 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageEvent.h +++ b/Userland/Libraries/LibWeb/HTML/MessageEvent.h @@ -22,7 +22,6 @@ class MessageEvent : public DOM::Event { public: static MessageEvent* create(JS::Realm&, FlyString const& event_name, MessageEventInit const& event_init = {}); - static MessageEvent* create(HTML::Window&, FlyString const& event_name, MessageEventInit const& event_init = {}); static MessageEvent* construct_impl(JS::Realm&, FlyString const& event_name, MessageEventInit const& event_init); MessageEvent(JS::Realm&, FlyString const& event_name, MessageEventInit const& event_init); diff --git a/Userland/Libraries/LibWeb/Infra/JSON.cpp b/Userland/Libraries/LibWeb/Infra/JSON.cpp index 279e667162c..943fd384f2b 100644 --- a/Userland/Libraries/LibWeb/Infra/JSON.cpp +++ b/Userland/Libraries/LibWeb/Infra/JSON.cpp @@ -53,13 +53,12 @@ WebIDL::ExceptionOr serialize_javascript_value_to_json_string(JS::VM& vm WebIDL::ExceptionOr serialize_javascript_value_to_json_bytes(JS::VM& vm, JS::Value value) { auto& realm = *vm.current_realm(); - auto& global_object = realm.global_object(); // 1. Let string be the result of serializing a JavaScript value to a JSON string given value. auto string = TRY(serialize_javascript_value_to_json_string(vm, value)); // 2. Return the result of running UTF-8 encode on string. [ENCODING] - return TRY_OR_RETURN_OOM(global_object, ByteBuffer::copy(string.bytes())); + return TRY_OR_RETURN_OOM(realm, ByteBuffer::copy(string.bytes())); } } diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index 593636a231f..f26b839eeaa 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -12,7 +12,6 @@ #include #include #include -#include #include #include #include diff --git a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp index fa09f2ba054..34642e5eec0 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGClipPathElement.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include namespace Web::SVG { diff --git a/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp index ba23a7605c8..4d4a8dfaa67 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include namespace Web::SVG { diff --git a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp index d377e549000..82155ad6bb9 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGElement.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include namespace Web::SVG { diff --git a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp index 501d7a8ec70..cc49c2dfd2b 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGGraphicsElement.cpp @@ -5,8 +5,8 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include -#include #include #include #include diff --git a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp index 127c0d3e9d6..a5f0d069d0a 100644 --- a/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp +++ b/Userland/Libraries/LibWeb/SVG/SVGLineElement.cpp @@ -4,7 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ -#include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp index eb8fcbedf34..071e26bb9be 100644 --- a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.cpp @@ -91,11 +91,6 @@ KeyboardEvent* KeyboardEvent::create_from_platform_event(JS::Realm& realm, FlySt return KeyboardEvent::create(realm, event_name, event_init); } -KeyboardEvent* KeyboardEvent::create_from_platform_event(HTML::Window& window, FlyString const& event_name, KeyCode platform_key, unsigned modifiers, u32 code_point) -{ - return create_from_platform_event(window.realm(), event_name, platform_key, modifiers, code_point); -} - bool KeyboardEvent::get_modifier_state(String const& key_arg) { if (key_arg == "Alt") diff --git a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.h b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.h index 22eddfc53d8..954ec91902f 100644 --- a/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/KeyboardEvent.h @@ -31,7 +31,6 @@ public: static KeyboardEvent* create(JS::Realm&, FlyString const& event_name, KeyboardEventInit const& event_init = {}); static KeyboardEvent* construct_impl(JS::Realm&, FlyString const& event_name, KeyboardEventInit const& event_init); static KeyboardEvent* create_from_platform_event(JS::Realm&, FlyString const& event_name, KeyCode, unsigned modifiers, u32 code_point); - static KeyboardEvent* create_from_platform_event(HTML::Window&, FlyString const& event_name, KeyCode, unsigned modifiers, u32 code_point); virtual ~KeyboardEvent() override; diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp index 41ec12a6f64..d033f7263d2 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.cpp @@ -62,11 +62,6 @@ MouseEvent* MouseEvent::create_from_platform_event(JS::Realm& realm, FlyString c return MouseEvent::create(realm, event_name, event_init); } -MouseEvent* MouseEvent::create_from_platform_event(HTML::Window& window, FlyString const& event_name, double offset_x, double offset_y, double client_x, double client_y, unsigned mouse_button) -{ - return create_from_platform_event(window.realm(), event_name, offset_x, offset_y, client_x, client_y, mouse_button); -} - void MouseEvent::set_event_characteristics() { if (type().is_one_of(EventNames::mousedown, EventNames::mousemove, EventNames::mouseout, EventNames::mouseover, EventNames::mouseup, HTML::EventNames::click)) { diff --git a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h index 7a4a623a0d2..70228285665 100644 --- a/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/MouseEvent.h @@ -27,7 +27,6 @@ class MouseEvent final : public UIEvent { public: static MouseEvent* create(JS::Realm&, FlyString const& event_name, MouseEventInit const& event_init = {}); static MouseEvent* create_from_platform_event(JS::Realm&, FlyString const& event_name, double offset_x, double offset_y, double client_x, double client_y, unsigned mouse_button = 1); - static MouseEvent* create_from_platform_event(HTML::Window&, FlyString const& event_name, double offset_x, double offset_y, double client_x, double client_y, unsigned mouse_button = 1); virtual ~MouseEvent() override; diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.h b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.h index 563148fffaf..dafe9db7a51 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.h +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyMemoryPrototype.h @@ -7,11 +7,9 @@ #pragma once #include "WebAssemblyMemoryConstructor.h" -#include #include #include #include -#include namespace Web::Bindings { diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleObject.cpp index 1b3f480e8e9..64be19cab87 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModuleObject.cpp @@ -5,6 +5,7 @@ */ #include "WebAssemblyModulePrototype.h" +#include #include namespace Web::Bindings { diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModulePrototype.h b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModulePrototype.h index a0526edd90e..3f1a7060f8b 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModulePrototype.h +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyModulePrototype.h @@ -7,11 +7,9 @@ #pragma once #include "WebAssemblyModuleConstructor.h" -#include #include #include #include -#include namespace Web::Bindings { diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableObject.cpp b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableObject.cpp index f2c7326de94..7e90fffecf9 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableObject.cpp +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTableObject.cpp @@ -5,6 +5,7 @@ */ #include "WebAssemblyTablePrototype.h" +#include #include namespace Web::Bindings { diff --git a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.h b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.h index 2f2706a856c..d626f30b358 100644 --- a/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.h +++ b/Userland/Libraries/LibWeb/WebAssembly/WebAssemblyTablePrototype.h @@ -7,11 +7,9 @@ #pragma once #include "WebAssemblyTableConstructor.h" -#include #include #include #include -#include namespace Web::Bindings { diff --git a/Userland/Libraries/LibWeb/WebIDL/DOMException.h b/Userland/Libraries/LibWeb/WebIDL/DOMException.h index 4189e93bc1f..878aa1f4603 100644 --- a/Userland/Libraries/LibWeb/WebIDL/DOMException.h +++ b/Userland/Libraries/LibWeb/WebIDL/DOMException.h @@ -123,17 +123,13 @@ private: FlyString m_message; }; -#define __ENUMERATE(ErrorName) \ - class ErrorName final { \ - public: \ - static JS::NonnullGCPtr create(JS::Realm& realm, FlyString const& message) \ - { \ - return DOMException::create(realm, #ErrorName, message); \ - } \ - static JS::NonnullGCPtr create(JS::Object const& global_object, FlyString const& message) \ - { \ - return create(HTML::relevant_realm(global_object), message); \ - } \ +#define __ENUMERATE(ErrorName) \ + class ErrorName final { \ + public: \ + static JS::NonnullGCPtr create(JS::Realm& realm, FlyString const& message) \ + { \ + return DOMException::create(realm, #ErrorName, message); \ + } \ }; ENUMERATE_DOM_EXCEPTION_ERROR_NAMES #undef __ENUMERATE