From 1422bd45ebda117238c452b4cf2ba7d1b54ce453 Mon Sep 17 00:00:00 2001 From: Linus Groh Date: Mon, 7 Mar 2022 23:08:26 +0100 Subject: [PATCH] LibWeb: Move Window from DOM directory & namespace to HTML The Window object is part of the HTML spec. :^) https://html.spec.whatwg.org/multipage/window-object.html --- .../LibWeb/WrapperGenerator/IDLGenerators.cpp | 2 +- Tests/LibWeb/test-web.cpp | 2 +- .../LibWeb/Bindings/AudioConstructor.cpp | 2 +- .../LibWeb/Bindings/ImageConstructor.cpp | 2 +- .../LibWeb/Bindings/LocationObject.cpp | 2 +- .../LibWeb/Bindings/MainThreadVM.cpp | 2 +- .../LibWeb/Bindings/WindowObject.cpp | 6 ++--- .../Libraries/LibWeb/Bindings/WindowObject.h | 8 +++--- Userland/Libraries/LibWeb/CMakeLists.txt | 2 +- Userland/Libraries/LibWeb/CSS/CSSMediaRule.h | 2 +- Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSRuleList.h | 2 +- .../Libraries/LibWeb/CSS/CSSStyleSheet.cpp | 2 +- Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h | 2 +- Userland/Libraries/LibWeb/CSS/MediaList.cpp | 2 +- Userland/Libraries/LibWeb/CSS/MediaList.h | 2 +- Userland/Libraries/LibWeb/CSS/MediaQuery.cpp | 10 +++---- Userland/Libraries/LibWeb/CSS/MediaQuery.h | 8 +++--- Userland/Libraries/LibWeb/CSS/Screen.cpp | 2 +- Userland/Libraries/LibWeb/CSS/Screen.h | 10 +++---- .../Libraries/LibWeb/DOM/AbortController.h | 2 +- Userland/Libraries/LibWeb/DOM/AbortSignal.h | 2 +- Userland/Libraries/LibWeb/DOM/Comment.cpp | 2 +- Userland/Libraries/LibWeb/DOM/Document.cpp | 4 +-- Userland/Libraries/LibWeb/DOM/Document.h | 6 ++--- Userland/Libraries/LibWeb/DOM/Document.idl | 2 +- .../Libraries/LibWeb/DOM/DocumentFragment.cpp | 2 +- .../Libraries/LibWeb/DOM/EventDispatcher.cpp | 6 ++--- Userland/Libraries/LibWeb/DOM/EventTarget.cpp | 16 ++++++------ Userland/Libraries/LibWeb/DOM/Range.cpp | 4 +-- Userland/Libraries/LibWeb/DOM/Range.h | 2 +- Userland/Libraries/LibWeb/DOM/Text.cpp | 2 +- Userland/Libraries/LibWeb/DOM/Timer.cpp | 6 ++--- Userland/Libraries/LibWeb/DOM/Timer.h | 6 ++--- Userland/Libraries/LibWeb/Forward.h | 2 +- .../Libraries/LibWeb/HTML/BrowsingContext.cpp | 2 +- .../LibWeb/HTML/CanvasRenderingContext2D.cpp | 2 +- Userland/Libraries/LibWeb/HTML/CloseEvent.h | 2 +- .../LibWeb/HTML/EventLoop/EventLoop.cpp | 2 +- .../Libraries/LibWeb/HTML/HTMLBodyElement.cpp | 2 +- .../Libraries/LibWeb/HTML/HTMLElement.cpp | 2 +- Userland/Libraries/LibWeb/HTML/HTMLElement.h | 2 +- .../LibWeb/HTML/HTMLScriptElement.cpp | 2 +- .../Libraries/LibWeb/HTML/MessageChannel.h | 2 +- .../LibWeb/HTML/Parser/HTMLParser.cpp | 4 +-- .../LibWeb/HTML/Scripting/Environments.cpp | 2 +- .../WindowEnvironmentSettingsObject.cpp | 2 +- .../WindowEnvironmentSettingsObject.h | 6 ++--- .../WorkerEnvironmentSettingsObject.h | 2 +- .../Libraries/LibWeb/{DOM => HTML}/Window.cpp | 18 ++++++------- .../Libraries/LibWeb/{DOM => HTML}/Window.h | 26 +++++++++---------- .../LibWeb/HighResolutionTime/Performance.cpp | 4 +-- .../LibWeb/HighResolutionTime/Performance.h | 4 +-- .../NavigationTiming/PerformanceTiming.cpp | 2 +- .../NavigationTiming/PerformanceTiming.h | 6 ++--- .../Libraries/LibWeb/Page/EventHandler.cpp | 2 +- Userland/Libraries/LibWeb/UIEvents/UIEvent.h | 10 +++---- .../Libraries/LibWeb/WebSockets/WebSocket.cpp | 4 +-- .../Libraries/LibWeb/WebSockets/WebSocket.h | 6 ++--- .../Libraries/LibWeb/XHR/XMLHttpRequest.cpp | 4 +-- .../Libraries/LibWeb/XHR/XMLHttpRequest.h | 6 ++--- .../WebContent/ConnectionFromClient.cpp | 2 +- .../WebContent/ConsoleGlobalObject.cpp | 2 +- 63 files changed, 133 insertions(+), 133 deletions(-) rename Userland/Libraries/LibWeb/{DOM => HTML}/Window.cpp (97%) rename Userland/Libraries/LibWeb/{DOM => HTML}/Window.h (85%) diff --git a/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp index bddc83e74d..2d979e28c6 100644 --- a/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp +++ b/Meta/Lagom/Tools/CodeGenerators/LibWeb/WrapperGenerator/IDLGenerators.cpp @@ -2804,8 +2804,8 @@ void generate_prototype_implementation(IDL::Interface const& interface) #include #include #include -#include #include +#include #include #if __has_include() diff --git a/Tests/LibWeb/test-web.cpp b/Tests/LibWeb/test-web.cpp index a7d9913d3d..5c250c97c7 100644 --- a/Tests/LibWeb/test-web.cpp +++ b/Tests/LibWeb/test-web.cpp @@ -45,7 +45,7 @@ struct TestWebGlobalObject : public Web::Bindings::WindowObject { JS_OBJECT(TestWebGlobalObject, Web::Bindings::WindowObject); public: - TestWebGlobalObject(Web::DOM::Window& window) + TestWebGlobalObject(Web::HTML::Window& window) : Web::Bindings::WindowObject(window) { } diff --git a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp index 4a9d5d5c05..53656f0d55 100644 --- a/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/AudioConstructor.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include namespace Web::Bindings { diff --git a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp index 9acff1182c..6456ac1b35 100644 --- a/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp +++ b/Userland/Libraries/LibWeb/Bindings/ImageConstructor.cpp @@ -9,7 +9,7 @@ #include #include #include -#include +#include #include namespace Web::Bindings { diff --git a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp index 52f0cef934..3e0c063c10 100644 --- a/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/LocationObject.cpp @@ -17,7 +17,7 @@ #include #include #include -#include +#include namespace Web::Bindings { diff --git a/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp b/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp index 0586bbf471..b74a8d0fa8 100644 --- a/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp +++ b/Userland/Libraries/LibWeb/Bindings/MainThreadVM.cpp @@ -12,11 +12,11 @@ #include #include #include -#include #include #include #include #include +#include namespace Web::Bindings { diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp index bb2fd96f10..fb9079eb21 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp +++ b/Userland/Libraries/LibWeb/Bindings/WindowObject.cpp @@ -38,18 +38,18 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include namespace Web::Bindings { -WindowObject::WindowObject(DOM::Window& impl) +WindowObject::WindowObject(HTML::Window& impl) : m_impl(impl) { impl.set_wrapper({}, *this); @@ -164,7 +164,7 @@ JS::ThrowCompletionOr WindowObject::internal_set_prototype_of(JS::Object* return set_immutable_prototype(prototype); } -static JS::ThrowCompletionOr impl_from(JS::VM& vm, JS::GlobalObject& global_object) +static JS::ThrowCompletionOr impl_from(JS::VM& vm, JS::GlobalObject& global_object) { // Since this is a non built-in function we must treat it as non-strict mode // this means that a nullish this_value should be converted to the diff --git a/Userland/Libraries/LibWeb/Bindings/WindowObject.h b/Userland/Libraries/LibWeb/Bindings/WindowObject.h index 8efc18177e..2e35d12bef 100644 --- a/Userland/Libraries/LibWeb/Bindings/WindowObject.h +++ b/Userland/Libraries/LibWeb/Bindings/WindowObject.h @@ -30,12 +30,12 @@ class WindowObject JS_OBJECT(WindowObject, JS::GlobalObject); public: - explicit WindowObject(DOM::Window&); + explicit WindowObject(HTML::Window&); virtual void initialize_global_object() override; virtual ~WindowObject() override; - DOM::Window& impl() { return *m_impl; } - const DOM::Window& impl() const { return *m_impl; } + HTML::Window& impl() { return *m_impl; } + const HTML::Window& impl() const { return *m_impl; } Origin origin() const; @@ -135,7 +135,7 @@ private: ENUMERATE_GLOBAL_EVENT_HANDLERS(__ENUMERATE); #undef __ENUMERATE - NonnullRefPtr m_impl; + NonnullRefPtr m_impl; LocationObject* m_location_object { nullptr }; diff --git a/Userland/Libraries/LibWeb/CMakeLists.txt b/Userland/Libraries/LibWeb/CMakeLists.txt index 0862d85a98..ee93c33b23 100644 --- a/Userland/Libraries/LibWeb/CMakeLists.txt +++ b/Userland/Libraries/LibWeb/CMakeLists.txt @@ -99,7 +99,6 @@ set(SOURCES DOM/Text.cpp DOM/Text.idl DOM/Timer.cpp - DOM/Window.cpp DOMParsing/InnerHTML.cpp DOMTreeModel.cpp Dump.cpp @@ -214,6 +213,7 @@ set(SOURCES HTML/SyntaxHighlighter/SyntaxHighlighter.cpp HTML/TagNames.cpp HTML/TextMetrics.cpp + HTML/Window.cpp HTML/Worker.cpp HTML/WorkerDebugConsoleClient.cpp HTML/WorkerGlobalScope.cpp diff --git a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.h b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.h index b4833b31a6..43f475824b 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSMediaRule.h +++ b/Userland/Libraries/LibWeb/CSS/CSSMediaRule.h @@ -34,7 +34,7 @@ public: NonnullRefPtr const& media() const { return m_media; } - bool evaluate(DOM::Window const& window) { return m_media->evaluate(window); } + bool evaluate(HTML::Window const& window) { return m_media->evaluate(window); } private: explicit CSSMediaRule(NonnullRefPtr&&, NonnullRefPtrVector&&); diff --git a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp index 9ceed93f82..1f4e40447c 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSRuleList.cpp @@ -103,7 +103,7 @@ void CSSRuleList::for_each_effective_style_rule(Function const& callback) const; // Returns whether the match state of any media queries changed after evaluation. - bool evaluate_media_queries(DOM::Window const&); + bool evaluate_media_queries(HTML::Window const&); private: explicit CSSRuleList(NonnullRefPtrVector&&); diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp index 5aa5a03bd3..36dc0b9df8 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.cpp @@ -62,7 +62,7 @@ void CSSStyleSheet::for_each_effective_style_rule(Functionfor_each_effective_style_rule(callback); } -bool CSSStyleSheet::evaluate_media_queries(DOM::Window const& window) +bool CSSStyleSheet::evaluate_media_queries(HTML::Window const& window) { return m_rules->evaluate_media_queries(window); } diff --git a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h index 30d38337e5..45e255d029 100644 --- a/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h +++ b/Userland/Libraries/LibWeb/CSS/CSSStyleSheet.h @@ -48,7 +48,7 @@ public: void for_each_effective_style_rule(Function const& callback) const; // Returns whether the match state of any media queries changed after evaluation. - bool evaluate_media_queries(DOM::Window const&); + bool evaluate_media_queries(HTML::Window const&); private: explicit CSSStyleSheet(NonnullRefPtrVector); diff --git a/Userland/Libraries/LibWeb/CSS/MediaList.cpp b/Userland/Libraries/LibWeb/CSS/MediaList.cpp index 17b81c95f1..4d98ca7241 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaList.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaList.cpp @@ -65,7 +65,7 @@ void MediaList::delete_medium(String medium) // FIXME: If nothing was removed, then throw a NotFoundError exception. } -bool MediaList::evaluate(DOM::Window const& window) +bool MediaList::evaluate(HTML::Window const& window) { for (auto& media : m_media) media.evaluate(window); diff --git a/Userland/Libraries/LibWeb/CSS/MediaList.h b/Userland/Libraries/LibWeb/CSS/MediaList.h index d264654316..adee044916 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaList.h +++ b/Userland/Libraries/LibWeb/CSS/MediaList.h @@ -29,7 +29,7 @@ public: void append_medium(String); void delete_medium(String); - bool evaluate(DOM::Window const&); + bool evaluate(HTML::Window const&); bool matches() const; private: diff --git a/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp b/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp index b16c4fa335..2253fcf535 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp +++ b/Userland/Libraries/LibWeb/CSS/MediaQuery.cpp @@ -7,7 +7,7 @@ #include #include #include -#include +#include namespace Web::CSS { @@ -77,7 +77,7 @@ String MediaFeature::to_string() const VERIFY_NOT_REACHED(); } -bool MediaFeature::evaluate(DOM::Window const& window) const +bool MediaFeature::evaluate(HTML::Window const& window) const { auto maybe_queried_value = window.query_media_feature(m_name); if (!maybe_queried_value.has_value()) @@ -122,7 +122,7 @@ bool MediaFeature::evaluate(DOM::Window const& window) const VERIFY_NOT_REACHED(); } -bool MediaFeature::compare(DOM::Window const& window, MediaFeatureValue left, Comparison comparison, MediaFeatureValue right) +bool MediaFeature::compare(HTML::Window const& window, MediaFeatureValue left, Comparison comparison, MediaFeatureValue right) { if (!left.is_same_type(right)) return false; @@ -298,7 +298,7 @@ String MediaCondition::to_string() const return builder.to_string(); } -MatchResult MediaCondition::evaluate(DOM::Window const& window) const +MatchResult MediaCondition::evaluate(HTML::Window const& window) const { switch (type) { case Type::Single: @@ -369,7 +369,7 @@ String MediaQuery::to_string() const return builder.to_string(); } -bool MediaQuery::evaluate(DOM::Window const& window) +bool MediaQuery::evaluate(HTML::Window const& window) { auto matches_media = [](MediaType media) -> MatchResult { switch (media) { diff --git a/Userland/Libraries/LibWeb/CSS/MediaQuery.h b/Userland/Libraries/LibWeb/CSS/MediaQuery.h index 60871335d2..9cf0357b67 100644 --- a/Userland/Libraries/LibWeb/CSS/MediaQuery.h +++ b/Userland/Libraries/LibWeb/CSS/MediaQuery.h @@ -140,7 +140,7 @@ public: return feature; } - bool evaluate(DOM::Window const&) const; + bool evaluate(HTML::Window const&) const; String to_string() const; private: @@ -159,7 +159,7 @@ private: { } - static bool compare(DOM::Window const& window, MediaFeatureValue left, Comparison comparison, MediaFeatureValue right); + static bool compare(HTML::Window const& window, MediaFeatureValue left, Comparison comparison, MediaFeatureValue right); struct Range { MediaFeatureValue left_value; @@ -196,7 +196,7 @@ struct MediaCondition { static NonnullOwnPtr from_and_list(NonnullOwnPtrVector&&); static NonnullOwnPtr from_or_list(NonnullOwnPtrVector&&); - MatchResult evaluate(DOM::Window const&) const; + MatchResult evaluate(HTML::Window const&) const; String to_string() const; private: @@ -234,7 +234,7 @@ public: static NonnullRefPtr create() { return adopt_ref(*new MediaQuery); } bool matches() const { return m_matches; } - bool evaluate(DOM::Window const&); + bool evaluate(HTML::Window const&); String to_string() const; private: diff --git a/Userland/Libraries/LibWeb/CSS/Screen.cpp b/Userland/Libraries/LibWeb/CSS/Screen.cpp index c4610b7f28..42ec725602 100644 --- a/Userland/Libraries/LibWeb/CSS/Screen.cpp +++ b/Userland/Libraries/LibWeb/CSS/Screen.cpp @@ -11,7 +11,7 @@ namespace Web::CSS { -Screen::Screen(DOM::Window& window) +Screen::Screen(HTML::Window& window) : RefCountForwarder(window) { } diff --git a/Userland/Libraries/LibWeb/CSS/Screen.h b/Userland/Libraries/LibWeb/CSS/Screen.h index d76a5c0620..ea6de94951 100644 --- a/Userland/Libraries/LibWeb/CSS/Screen.h +++ b/Userland/Libraries/LibWeb/CSS/Screen.h @@ -9,20 +9,20 @@ #include #include #include -#include #include +#include namespace Web::CSS { class Screen final - : public RefCountForwarder + : public RefCountForwarder , public Bindings::Wrappable { public: using WrapperType = Bindings::ScreenWrapper; using AllowOwnPtr = TrueType; - static NonnullOwnPtr create(Badge, DOM::Window& window) + static NonnullOwnPtr create(Badge, HTML::Window& window) { return adopt_own(*new Screen(window)); } @@ -35,9 +35,9 @@ public: u32 pixel_depth() const { return 24; } private: - explicit Screen(DOM::Window&); + explicit Screen(HTML::Window&); - DOM::Window const& window() const { return ref_count_target(); } + HTML::Window const& window() const { return ref_count_target(); } Gfx::IntRect screen_rect() const; }; diff --git a/Userland/Libraries/LibWeb/DOM/AbortController.h b/Userland/Libraries/LibWeb/DOM/AbortController.h index 1e6119eb73..a084fbe044 100644 --- a/Userland/Libraries/LibWeb/DOM/AbortController.h +++ b/Userland/Libraries/LibWeb/DOM/AbortController.h @@ -11,8 +11,8 @@ #include #include #include -#include #include +#include namespace Web::DOM { diff --git a/Userland/Libraries/LibWeb/DOM/AbortSignal.h b/Userland/Libraries/LibWeb/DOM/AbortSignal.h index 2f91984ff8..180270ee34 100644 --- a/Userland/Libraries/LibWeb/DOM/AbortSignal.h +++ b/Userland/Libraries/LibWeb/DOM/AbortSignal.h @@ -10,8 +10,8 @@ #include #include #include -#include #include +#include namespace Web::DOM { diff --git a/Userland/Libraries/LibWeb/DOM/Comment.cpp b/Userland/Libraries/LibWeb/DOM/Comment.cpp index 77abdb9b16..293250d00c 100644 --- a/Userland/Libraries/LibWeb/DOM/Comment.cpp +++ b/Userland/Libraries/LibWeb/DOM/Comment.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include #include namespace Web::DOM { diff --git a/Userland/Libraries/LibWeb/DOM/Document.cpp b/Userland/Libraries/LibWeb/DOM/Document.cpp index 57fce26fb2..af4be273d3 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.cpp +++ b/Userland/Libraries/LibWeb/DOM/Document.cpp @@ -34,7 +34,6 @@ #include #include #include -#include #include #include #include @@ -56,6 +55,7 @@ #include #include #include +#include #include #include #include @@ -75,7 +75,7 @@ Document::Document(const AK::URL& url) , m_style_computer(make(*this)) , m_style_sheets(CSS::StyleSheetList::create(*this)) , m_url(url) - , m_window(Window::create_with_document(*this)) + , m_window(HTML::Window::create_with_document(*this)) , m_implementation(DOMImplementation::create({}, *this)) , m_history(HTML::History::create(*this)) { diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h index 3d45e33f0f..6da28d8a62 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.h +++ b/Userland/Libraries/LibWeb/DOM/Document.h @@ -242,7 +242,7 @@ public: void removed_last_ref(); - Window& window() { return *m_window; } + HTML::Window& window() { return *m_window; } ExceptionOr write(Vector const& strings); ExceptionOr writeln(Vector const& strings); @@ -250,7 +250,7 @@ public: ExceptionOr open(String const& = "", String const& = ""); ExceptionOr close(); - Window* default_view() { return m_window; } + HTML::Window* default_view() { return m_window; } const String& content_type() const { return m_content_type; } void set_content_type(const String& content_type) { m_content_type = content_type; } @@ -360,7 +360,7 @@ private: WeakPtr m_browsing_context; AK::URL m_url; - RefPtr m_window; + RefPtr m_window; RefPtr m_layout_root; diff --git a/Userland/Libraries/LibWeb/DOM/Document.idl b/Userland/Libraries/LibWeb/DOM/Document.idl index 03aff632ea..50b1baceef 100644 --- a/Userland/Libraries/LibWeb/DOM/Document.idl +++ b/Userland/Libraries/LibWeb/DOM/Document.idl @@ -33,7 +33,7 @@ interface Document : Node { readonly attribute Window? defaultView; [CEReactions] Document open(optional DOMString unused1, optional DOMString unused2); - // FIXME: implement ExceptionOr Document::open(...) + // FIXME: implement ExceptionOr Document::open(...) // WindowProxy? open(USVString url, DOMString name, DOMString features); [CEReactions] undefined close(); [CEReactions] undefined write(DOMString... text); diff --git a/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp b/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp index a9ac6833f2..26c4075e8b 100644 --- a/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp +++ b/Userland/Libraries/LibWeb/DOM/DocumentFragment.cpp @@ -5,7 +5,7 @@ */ #include -#include +#include namespace Web::DOM { diff --git a/Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp b/Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp index b037ac79d6..208920cdee 100644 --- a/Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp +++ b/Userland/Libraries/LibWeb/DOM/EventDispatcher.cpp @@ -22,9 +22,9 @@ #include #include #include -#include #include #include +#include #include namespace Web::DOM { @@ -190,7 +190,7 @@ bool EventDispatcher::dispatch(NonnullRefPtr target, NonnullRefPtr< target_override = target; } else { // NOTE: This can be done because legacy_target_override is only set for events targeted at Window. - target_override = verify_cast(*target).associated_document(); + target_override = verify_cast(*target).associated_document(); } RefPtr activation_target; @@ -229,7 +229,7 @@ bool EventDispatcher::dispatch(NonnullRefPtr target, NonnullRefPtr< touch_targets.append(retarget(touch_target, parent)); } - if (is(parent) + if (is(parent) || (is(parent) && verify_cast(*target).root().is_shadow_including_inclusive_ancestor_of(verify_cast(*parent)))) { if (is_activation_event && event->bubbles() && !activation_target && parent->activation_behavior) activation_target = parent; diff --git a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp index 8ba9dc6ecc..77419de0c5 100644 --- a/Userland/Libraries/LibWeb/DOM/EventTarget.cpp +++ b/Userland/Libraries/LibWeb/DOM/EventTarget.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -33,6 +32,7 @@ #include #include #include +#include #include namespace Web::DOM { @@ -315,8 +315,8 @@ Bindings::CallbackType* EventTarget::get_current_value_of_event_handler(FlyStrin element = element_event_target; document = element_event_target->document(); } else { - VERIFY(is(this)); - auto* window_event_target = verify_cast(this); + VERIFY(is(this)); + auto* window_event_target = verify_cast(this); document = window_event_target->associated_document(); } @@ -346,7 +346,7 @@ Bindings::CallbackType* EventTarget::get_current_value_of_event_handler(FlyStrin StringBuilder builder; // sourceText - if (name == HTML::EventNames::error && is(this)) { + if (name == HTML::EventNames::error && is(this)) { // -> If name is onerror and eventTarget is a Window object // The string formed by concatenating "function ", name, "(event, source, lineno, colno, error) {", U+000A LF, body, U+000A LF, and "}". builder.appendff("function {}(event, source, lineno, colno, error) {{\n{}\n}}", name, body); @@ -511,14 +511,14 @@ void EventTarget::activate_event_handler(FlyString const& name, HTML::EventHandl // FIXME: This is guess work on what global object the NativeFunction should be allocated on. // For or elements who just had an element attribute set, it will be this's wrapper, as `this` is the result of determine_target_of_event_handler - // returning the element's document's global object, which is the DOM::Window object. + // returning the element's document's global object, which is the HTML::Window object. // For any other HTMLElement who just had an element attribute set, `this` will be that HTMLElement, so the global object is this's document's realm's global object. // For anything else, it came from JavaScript, so use the global object of the provided callback function. // Sadly, this doesn't work if an element attribute is set on a element before any script is run, as Window::wrapper() will be null. JS::GlobalObject* global_object = nullptr; if (is_attribute == IsAttribute::Yes) { - if (is(this)) { - auto* window_global_object = verify_cast(this)->wrapper(); + if (is(this)) { + auto* window_global_object = verify_cast(this)->wrapper(); global_object = static_cast(window_global_object); } else { auto* html_element = verify_cast(this); @@ -606,7 +606,7 @@ JS::ThrowCompletionOr EventTarget::process_event_handler_for_event(FlyStri // 3. Let special error event handling be true if event is an ErrorEvent object, event's type is error, and event's currentTarget implements the WindowOrWorkerGlobalScope mixin. // Otherwise, let special error event handling be false. // FIXME: This doesn't check for WorkerGlobalScape as we don't currently have it. - bool special_error_event_handling = is(event) && event.type() == HTML::EventNames::error && is(event.current_target().ptr()); + bool special_error_event_handling = is(event) && event.type() == HTML::EventNames::error && is(event.current_target().ptr()); // 4. Process the Event object event as follows: JS::Completion return_value_or_error; diff --git a/Userland/Libraries/LibWeb/DOM/Range.cpp b/Userland/Libraries/LibWeb/DOM/Range.cpp index 6c95a982e5..9daf788987 100644 --- a/Userland/Libraries/LibWeb/DOM/Range.cpp +++ b/Userland/Libraries/LibWeb/DOM/Range.cpp @@ -9,11 +9,11 @@ #include #include #include -#include +#include namespace Web::DOM { -NonnullRefPtr Range::create(Window& window) +NonnullRefPtr Range::create(HTML::Window& window) { return Range::create(window.associated_document()); } diff --git a/Userland/Libraries/LibWeb/DOM/Range.h b/Userland/Libraries/LibWeb/DOM/Range.h index f7d73b1a85..1c84c0b34a 100644 --- a/Userland/Libraries/LibWeb/DOM/Range.h +++ b/Userland/Libraries/LibWeb/DOM/Range.h @@ -18,7 +18,7 @@ public: virtual ~Range() override; static NonnullRefPtr create(Document&); - static NonnullRefPtr create(Window&); + static NonnullRefPtr create(HTML::Window&); static NonnullRefPtr create(Node& start_container, u32 start_offset, Node& end_container, u32 end_offset); static NonnullRefPtr create_with_global_object(Bindings::WindowObject&); diff --git a/Userland/Libraries/LibWeb/DOM/Text.cpp b/Userland/Libraries/LibWeb/DOM/Text.cpp index 9f50e29fd8..22df127689 100644 --- a/Userland/Libraries/LibWeb/DOM/Text.cpp +++ b/Userland/Libraries/LibWeb/DOM/Text.cpp @@ -5,8 +5,8 @@ */ #include -#include #include +#include #include namespace Web::DOM { diff --git a/Userland/Libraries/LibWeb/DOM/Timer.cpp b/Userland/Libraries/LibWeb/DOM/Timer.cpp index 262051e854..e99a96de06 100644 --- a/Userland/Libraries/LibWeb/DOM/Timer.cpp +++ b/Userland/Libraries/LibWeb/DOM/Timer.cpp @@ -6,16 +6,16 @@ #include #include -#include +#include namespace Web::DOM { -NonnullRefPtr Timer::create(Window& window, i32 milliseconds, Function callback, i32 id) +NonnullRefPtr Timer::create(HTML::Window& window, i32 milliseconds, Function callback, i32 id) { return adopt_ref(*new Timer(window, milliseconds, move(callback), id)); } -Timer::Timer(Window& window, i32 milliseconds, Function callback, i32 id) +Timer::Timer(HTML::Window& window, i32 milliseconds, Function callback, i32 id) : m_window(window) , m_id(id) { diff --git a/Userland/Libraries/LibWeb/DOM/Timer.h b/Userland/Libraries/LibWeb/DOM/Timer.h index de40b93675..a9fb3a0970 100644 --- a/Userland/Libraries/LibWeb/DOM/Timer.h +++ b/Userland/Libraries/LibWeb/DOM/Timer.h @@ -15,16 +15,16 @@ namespace Web::DOM { class Timer final : public RefCounted { public: - static NonnullRefPtr create(Window& window, i32 milliseconds, Function callback, i32 id); + static NonnullRefPtr create(HTML::Window& window, i32 milliseconds, Function callback, i32 id); ~Timer(); void start(); private: - Timer(Window& window, i32 milliseconds, Function callback, i32 id); + Timer(HTML::Window& window, i32 milliseconds, Function callback, i32 id); RefPtr m_timer; - Window& m_window; + HTML::Window& m_window; i32 m_id { 0 }; }; diff --git a/Userland/Libraries/LibWeb/Forward.h b/Userland/Libraries/LibWeb/Forward.h index b6411825f6..245a331602 100644 --- a/Userland/Libraries/LibWeb/Forward.h +++ b/Userland/Libraries/LibWeb/Forward.h @@ -120,7 +120,6 @@ class StaticNodeList; class StaticRange; class Text; class Timer; -class Window; enum class QuirksMode; struct EventListenerOptions; struct AddEventListenerOptions; @@ -235,6 +234,7 @@ class WorkerDebugConsoleClient; class Storage; class SubmitEvent; class TextMetrics; +class Window; class WindowEnvironmentSettingsObject; class Worker; class WorkerEnvironmentSettingsObject; diff --git a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp index 1d0ca9d25f..7f6374f4be 100644 --- a/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp +++ b/Userland/Libraries/LibWeb/HTML/BrowsingContext.cpp @@ -6,12 +6,12 @@ #include #include -#include #include #include #include #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp index 248642db0f..f9247d4dc6 100644 --- a/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp +++ b/Userland/Libraries/LibWeb/HTML/CanvasRenderingContext2D.cpp @@ -13,12 +13,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/CloseEvent.h b/Userland/Libraries/LibWeb/HTML/CloseEvent.h index 3b7c56f2f7..cff27b926c 100644 --- a/Userland/Libraries/LibWeb/HTML/CloseEvent.h +++ b/Userland/Libraries/LibWeb/HTML/CloseEvent.h @@ -37,7 +37,7 @@ public: protected: CloseEvent(FlyString const& event_name, CloseEventInit const& event_init) - : Event(event_name, event_init) + : DOM::Event(event_name, event_init) , m_was_clean(event_init.was_clean) , m_code(event_init.code) , m_reason(event_init.reason) diff --git a/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp b/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp index 259e7b4240..8eba3d3ddf 100644 --- a/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp +++ b/Userland/Libraries/LibWeb/HTML/EventLoop/EventLoop.cpp @@ -9,10 +9,10 @@ #include #include #include -#include #include #include #include +#include #include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp index 4110f9a895..b521f104a3 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLBodyElement.cpp @@ -7,8 +7,8 @@ #include #include #include -#include #include +#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp index b116fd20c9..ff09b7798b 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.cpp @@ -11,13 +11,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/HTML/HTMLElement.h b/Userland/Libraries/LibWeb/HTML/HTMLElement.h index 1674a906c0..6e6239c56e 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLElement.h +++ b/Userland/Libraries/LibWeb/HTML/HTMLElement.h @@ -54,7 +54,7 @@ protected: private: // ^HTML::GlobalEventHandlers - virtual EventTarget& global_event_handlers_to_event_target() override { return *this; } + virtual DOM::EventTarget& global_event_handlers_to_event_target() override { return *this; } enum class ContentEditableState { True, diff --git a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp index 1381ff7e12..d900113a1d 100644 --- a/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp +++ b/Userland/Libraries/LibWeb/HTML/HTMLScriptElement.cpp @@ -11,10 +11,10 @@ #include #include #include -#include #include #include #include +#include #include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/MessageChannel.h b/Userland/Libraries/LibWeb/HTML/MessageChannel.h index a61851d21c..1d212db933 100644 --- a/Userland/Libraries/LibWeb/HTML/MessageChannel.h +++ b/Userland/Libraries/LibWeb/HTML/MessageChannel.h @@ -9,8 +9,8 @@ #include #include #include -#include #include +#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp index 351059e361..091c252356 100644 --- a/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp +++ b/Userland/Libraries/LibWeb/HTML/Parser/HTMLParser.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -27,6 +26,7 @@ #include #include #include +#include #include #include @@ -276,7 +276,7 @@ void HTMLParser::the_end() return; // 3. Let window be the Document's relevant global object. - NonnullRefPtr window = document->window(); + NonnullRefPtr window = document->window(); // FIXME: 4. Set the Document's load timing info's load event start time to the current high resolution time given window. diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp index df416ba44b..b804e08793 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp +++ b/Userland/Libraries/LibWeb/HTML/Scripting/Environments.cpp @@ -8,9 +8,9 @@ #include #include #include -#include #include #include +#include namespace Web::HTML { diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.cpp b/Userland/Libraries/LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.cpp index 089aaed189..14a541e6bb 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.cpp +++ b/Userland/Libraries/LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.cpp @@ -10,7 +10,7 @@ namespace Web::HTML { -WindowEnvironmentSettingsObject::WindowEnvironmentSettingsObject(DOM::Window& window, JS::ExecutionContext& execution_context) +WindowEnvironmentSettingsObject::WindowEnvironmentSettingsObject(Window& window, JS::ExecutionContext& execution_context) : EnvironmentSettingsObject(execution_context) , m_window(window) { diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.h b/Userland/Libraries/LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.h index 8577f82e04..e891c4f2bf 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.h +++ b/Userland/Libraries/LibWeb/HTML/Scripting/WindowEnvironmentSettingsObject.h @@ -6,8 +6,8 @@ #pragma once -#include #include +#include namespace Web::HTML { @@ -24,9 +24,9 @@ public: virtual CanUseCrossOriginIsolatedAPIs cross_origin_isolated_capability() override; private: - WindowEnvironmentSettingsObject(DOM::Window&, JS::ExecutionContext& execution_context); + WindowEnvironmentSettingsObject(Window&, JS::ExecutionContext& execution_context); - NonnullRefPtr m_window; + NonnullRefPtr m_window; }; } diff --git a/Userland/Libraries/LibWeb/HTML/Scripting/WorkerEnvironmentSettingsObject.h b/Userland/Libraries/LibWeb/HTML/Scripting/WorkerEnvironmentSettingsObject.h index f31c69bbf0..0dd1e32657 100644 --- a/Userland/Libraries/LibWeb/HTML/Scripting/WorkerEnvironmentSettingsObject.h +++ b/Userland/Libraries/LibWeb/HTML/Scripting/WorkerEnvironmentSettingsObject.h @@ -13,7 +13,7 @@ namespace Web::HTML { // FIXME: This is a bit ugly, this implementation is basically a 1:1 copy of what is in ESO -// just modified to use DOM::Document instead of DOM::Window since workers have no window +// just modified to use DOM::Document instead of HTML::Window since workers have no window class WorkerEnvironmentSettingsObject final : public EnvironmentSettingsObject , public Weakable { diff --git a/Userland/Libraries/LibWeb/DOM/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp similarity index 97% rename from Userland/Libraries/LibWeb/DOM/Window.cpp rename to Userland/Libraries/LibWeb/HTML/Window.cpp index bf181124f0..cb6dc64a50 100644 --- a/Userland/Libraries/LibWeb/DOM/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -16,7 +16,6 @@ #include #include #include -#include #include #include #include @@ -24,12 +23,13 @@ #include #include #include +#include #include #include #include #include -namespace Web::DOM { +namespace Web::HTML { class RequestAnimationFrameCallback : public RefCounted { public: @@ -107,13 +107,13 @@ void run_animation_frame_callbacks(DOM::Document&, double) request_animation_frame_driver().run(); } -NonnullRefPtr Window::create_with_document(Document& document) +NonnullRefPtr Window::create_with_document(DOM::Document& document) { return adopt_ref(*new Window(document)); } -Window::Window(Document& document) - : EventTarget() +Window::Window(DOM::Document& document) + : DOM::EventTarget() , m_associated_document(document) , m_performance(make(*this)) , m_crypto(Crypto::Crypto::create()) @@ -174,7 +174,7 @@ void Window::clear_interval(i32 id) m_timers.remove(id); } -void Window::deallocate_timer_id(Badge, i32 id) +void Window::deallocate_timer_id(Badge, i32 id) { m_timer_id_allocator.deallocate(id); } @@ -262,7 +262,7 @@ i32 Window::run_timer_initialization_steps(Bindings::TimerHandler handler, i32 t }; // 13. Run steps after a timeout given global, "setTimeout/setInterval", timeout, completionStep, and id. - auto timer = Timer::create(*this, timeout, move(completion_step), id); + auto timer = DOM::Timer::create(*this, timeout, move(completion_step), id); m_timers.set(id, timer); timer->start(); @@ -320,9 +320,9 @@ void Window::did_call_location_replace(Badge, String u browsing_context->loader().load(move(new_url), FrameLoader::Type::Navigation); } -bool Window::dispatch_event(NonnullRefPtr event) +bool Window::dispatch_event(NonnullRefPtr event) { - return EventDispatcher::dispatch(*this, event, true); + return DOM::EventDispatcher::dispatch(*this, event, true); } JS::Object* Window::create_wrapper(JS::GlobalObject& global_object) diff --git a/Userland/Libraries/LibWeb/DOM/Window.h b/Userland/Libraries/LibWeb/HTML/Window.h similarity index 85% rename from Userland/Libraries/LibWeb/DOM/Window.h rename to Userland/Libraries/LibWeb/HTML/Window.h index e8b57be84b..4a96829038 100644 --- a/Userland/Libraries/LibWeb/DOM/Window.h +++ b/Userland/Libraries/LibWeb/HTML/Window.h @@ -20,16 +20,16 @@ #include #include -namespace Web::DOM { +namespace Web::HTML { class RequestAnimationFrameCallback; class Window final : public RefCounted - , public EventTarget + , public DOM::EventTarget , public HTML::GlobalEventHandlers { public: - static NonnullRefPtr create_with_document(Document&); + static NonnullRefPtr create_with_document(DOM::Document&); ~Window(); using RefCounted::ref; @@ -37,15 +37,15 @@ public: virtual void ref_event_target() override { RefCounted::ref(); } virtual void unref_event_target() override { RefCounted::unref(); } - virtual bool dispatch_event(NonnullRefPtr) override; + virtual bool dispatch_event(NonnullRefPtr) override; virtual JS::Object* create_wrapper(JS::GlobalObject&) override; Page* page(); Page const* page() const; // https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window - Document const& associated_document() const { return *m_associated_document; } - Document& associated_document() { return *m_associated_document; } + DOM::Document const& associated_document() const { return *m_associated_document; } + DOM::Document& associated_document() { return *m_associated_document; } // https://html.spec.whatwg.org/multipage/window-object.html#window-bc HTML::BrowsingContext const* browsing_context() const { return m_associated_document->browsing_context(); } @@ -76,7 +76,7 @@ public: void set_wrapper(Badge, Bindings::WindowObject&); - void deallocate_timer_id(Badge, i32); + void deallocate_timer_id(Badge, i32); HighResolutionTime::Performance& performance() { return *m_performance; } @@ -84,8 +84,8 @@ public: CSS::Screen& screen() { return *m_screen; } - Event const* current_event() const { return m_current_event; } - void set_current_event(Event* event) { m_current_event = event; } + DOM::Event const* current_event() const { return m_current_event; } + void set_current_event(DOM::Event* event) { m_current_event = event; } NonnullRefPtr get_computed_style(DOM::Element&) const; NonnullRefPtr match_media(String); @@ -110,7 +110,7 @@ public: DOM::ExceptionOr post_message(JS::Value, String const& target_origin); private: - explicit Window(Document&); + explicit Window(DOM::Document&); // ^HTML::GlobalEventHandlers virtual DOM::EventTarget& global_event_handlers_to_event_target() override { return *this; } @@ -122,17 +122,17 @@ private: i32 run_timer_initialization_steps(Bindings::TimerHandler handler, i32 timeout, JS::MarkedVector arguments, Repeat repeat, Optional previous_id = {}); // https://html.spec.whatwg.org/multipage/window-object.html#concept-document-window - WeakPtr m_associated_document; + WeakPtr m_associated_document; WeakPtr m_wrapper; IDAllocator m_timer_id_allocator; - HashMap> m_timers; + HashMap> m_timers; NonnullOwnPtr m_performance; NonnullRefPtr m_crypto; NonnullOwnPtr m_screen; - RefPtr m_current_event; + RefPtr m_current_event; HashMap> m_request_animation_frame_callbacks; }; diff --git a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp index 9b6863be21..6fac7a0042 100644 --- a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp +++ b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.cpp @@ -8,12 +8,12 @@ #include #include #include -#include +#include #include namespace Web::HighResolutionTime { -Performance::Performance(DOM::Window& window) +Performance::Performance(HTML::Window& window) : DOM::EventTarget() , m_window(window) , m_timing(make(window)) diff --git a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.h b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.h index 7891c43b85..15fd0fa0c2 100644 --- a/Userland/Libraries/LibWeb/HighResolutionTime/Performance.h +++ b/Userland/Libraries/LibWeb/HighResolutionTime/Performance.h @@ -21,7 +21,7 @@ public: using WrapperType = Bindings::PerformanceWrapper; using AllowOwnPtr = TrueType; - explicit Performance(DOM::Window&); + explicit Performance(HTML::Window&); ~Performance(); double now() const { return m_timer.elapsed(); } @@ -35,7 +35,7 @@ public: virtual JS::Object* create_wrapper(JS::GlobalObject&) override; private: - DOM::Window& m_window; + HTML::Window& m_window; Core::ElapsedTimer m_timer; OwnPtr m_timing; diff --git a/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp b/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp index 8c669b7eb5..1f39cb2bb5 100644 --- a/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp +++ b/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.cpp @@ -8,7 +8,7 @@ namespace Web::NavigationTiming { -PerformanceTiming::PerformanceTiming(DOM::Window& window) +PerformanceTiming::PerformanceTiming(HTML::Window& window) : RefCountForwarder(window) { } diff --git a/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.h b/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.h index ae1b98e0da..1c9739b90a 100644 --- a/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.h +++ b/Userland/Libraries/LibWeb/NavigationTiming/PerformanceTiming.h @@ -9,18 +9,18 @@ #include #include #include -#include +#include namespace Web::NavigationTiming { class PerformanceTiming final - : public RefCountForwarder + : public RefCountForwarder , public Bindings::Wrappable { public: using WrapperType = Bindings::PerformanceTimingWrapper; using AllowOwnPtr = TrueType; - explicit PerformanceTiming(DOM::Window&); + explicit PerformanceTiming(HTML::Window&); ~PerformanceTiming(); u32 navigation_start() { return 0; } diff --git a/Userland/Libraries/LibWeb/Page/EventHandler.cpp b/Userland/Libraries/LibWeb/Page/EventHandler.cpp index e5c0f3abd4..f16e99934c 100644 --- a/Userland/Libraries/LibWeb/Page/EventHandler.cpp +++ b/Userland/Libraries/LibWeb/Page/EventHandler.cpp @@ -8,11 +8,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/Userland/Libraries/LibWeb/UIEvents/UIEvent.h b/Userland/Libraries/LibWeb/UIEvents/UIEvent.h index d410922179..920ec3a7e3 100644 --- a/Userland/Libraries/LibWeb/UIEvents/UIEvent.h +++ b/Userland/Libraries/LibWeb/UIEvents/UIEvent.h @@ -8,12 +8,12 @@ #include #include -#include +#include namespace Web::UIEvents { struct UIEventInit : public DOM::EventInit { - RefPtr view { nullptr }; + RefPtr view { nullptr }; int detail { 0 }; }; @@ -33,10 +33,10 @@ public: virtual ~UIEvent() override { } - DOM::Window const* view() const { return m_view; } + HTML::Window const* view() const { return m_view; } int detail() const { return m_detail; } - void init_ui_event(String const& type, bool bubbles, bool cancelable, DOM::Window* view, int detail) + void init_ui_event(String const& type, bool bubbles, bool cancelable, HTML::Window* view, int detail) { init_event(type, bubbles, cancelable); m_view = view; @@ -55,7 +55,7 @@ protected: { } - RefPtr m_view; + RefPtr m_view; int m_detail { 0 }; }; diff --git a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp index 220a3e2ad8..5e048f6bcc 100644 --- a/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp +++ b/Userland/Libraries/LibWeb/WebSockets/WebSocket.cpp @@ -18,11 +18,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include @@ -67,7 +67,7 @@ DOM::ExceptionOr> WebSocket::create_with_global_object( return WebSocket::create(window.impl(), url_record); } -WebSocket::WebSocket(DOM::Window& window, AK::URL& url) +WebSocket::WebSocket(HTML::Window& window, AK::URL& url) : EventTarget() , m_window(window) { diff --git a/Userland/Libraries/LibWeb/WebSockets/WebSocket.h b/Userland/Libraries/LibWeb/WebSockets/WebSocket.h index 93273f40c5..9e9f30bed0 100644 --- a/Userland/Libraries/LibWeb/WebSockets/WebSocket.h +++ b/Userland/Libraries/LibWeb/WebSockets/WebSocket.h @@ -59,7 +59,7 @@ public: using WrapperType = Bindings::WebSocketWrapper; - static NonnullRefPtr create(DOM::Window& window, AK::URL& url) + static NonnullRefPtr create(HTML::Window& window, AK::URL& url) { return adopt_ref(*new WebSocket(window, url)); } @@ -100,9 +100,9 @@ private: void on_error(); void on_close(u16 code, String reason, bool was_clean); - explicit WebSocket(DOM::Window&, AK::URL&); + explicit WebSocket(HTML::Window&, AK::URL&); - NonnullRefPtr m_window; + NonnullRefPtr m_window; AK::URL m_url; String m_binary_type { "blob" }; diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp index 5bea6158cb..1464752aea 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.cpp @@ -22,10 +22,10 @@ #include #include #include -#include #include #include #include +#include #include #include #include @@ -35,7 +35,7 @@ namespace Web::XHR { -XMLHttpRequest::XMLHttpRequest(DOM::Window& window) +XMLHttpRequest::XMLHttpRequest(HTML::Window& window) : XMLHttpRequestEventTarget() , m_window(window) , m_response_type(Bindings::XMLHttpRequestResponseType::Empty) diff --git a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h index 9431e39fe6..f1f95d474b 100644 --- a/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h +++ b/Userland/Libraries/LibWeb/XHR/XMLHttpRequest.h @@ -34,7 +34,7 @@ public: using WrapperType = Bindings::XMLHttpRequestWrapper; - static NonnullRefPtr create(DOM::Window& window) + static NonnullRefPtr create(HTML::Window& window) { return adopt_ref(*new XMLHttpRequest(window)); } @@ -86,9 +86,9 @@ private: Optional> get_decode_and_split(String const& header_name, HashMap const& header_list) const; Optional extract_mime_type(HashMap const& header_list) const; - explicit XMLHttpRequest(DOM::Window&); + explicit XMLHttpRequest(HTML::Window&); - NonnullRefPtr m_window; + NonnullRefPtr m_window; ReadyState m_ready_state { ReadyState::Unsent }; unsigned m_status { 0 }; diff --git a/Userland/Services/WebContent/ConnectionFromClient.cpp b/Userland/Services/WebContent/ConnectionFromClient.cpp index d9a52631b1..ecdeecaa63 100644 --- a/Userland/Services/WebContent/ConnectionFromClient.cpp +++ b/Userland/Services/WebContent/ConnectionFromClient.cpp @@ -17,11 +17,11 @@ #include #include #include -#include #include #include #include #include +#include #include #include #include diff --git a/Userland/Services/WebContent/ConsoleGlobalObject.cpp b/Userland/Services/WebContent/ConsoleGlobalObject.cpp index 89bab1984e..f371a780fc 100644 --- a/Userland/Services/WebContent/ConsoleGlobalObject.cpp +++ b/Userland/Services/WebContent/ConsoleGlobalObject.cpp @@ -10,7 +10,7 @@ #include #include #include -#include +#include namespace WebContent {