diff --git a/Userland/Libraries/LibWeb/HTML/Window.cpp b/Userland/Libraries/LibWeb/HTML/Window.cpp index a4e76f8271..e2327d3f6d 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.cpp +++ b/Userland/Libraries/LibWeb/HTML/Window.cpp @@ -863,6 +863,20 @@ void Window::set_name(String const& name) navigable()->active_session_history_entry()->document_state->set_navigable_target_name(name); } +// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-status +String Window::status() const +{ + // the status attribute on the Window object must, on getting, return the last string it was set to + return m_status; +} + +// https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-status +void Window::set_status(String const& status) +{ + // on setting, must set itself to the new value. + m_status = status; +} + // https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-location JS::NonnullGCPtr Window::location() { diff --git a/Userland/Libraries/LibWeb/HTML/Window.h b/Userland/Libraries/LibWeb/HTML/Window.h index a8821032c6..d568643f0e 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.h +++ b/Userland/Libraries/LibWeb/HTML/Window.h @@ -134,6 +134,8 @@ public: JS::NonnullGCPtr document() const; String name() const; void set_name(String const&); + String status() const; + void set_status(String const&); [[nodiscard]] JS::NonnullGCPtr location(); JS::NonnullGCPtr history() const; JS::NonnullGCPtr navigation(); @@ -275,6 +277,10 @@ private: // https://streams.spec.whatwg.org/#byte-length-queuing-strategy-size-function JS::GCPtr m_byte_length_queuing_strategy_size_function; + + // https://html.spec.whatwg.org/multipage/nav-history-apis.html#dom-window-status + // When the Window object is created, the attribute must be set to the empty string. It does not do anything else. + String m_status; }; void run_animation_frame_callbacks(DOM::Document&, double now); diff --git a/Userland/Libraries/LibWeb/HTML/Window.idl b/Userland/Libraries/LibWeb/HTML/Window.idl index 139df1fc11..a867f353cf 100644 --- a/Userland/Libraries/LibWeb/HTML/Window.idl +++ b/Userland/Libraries/LibWeb/HTML/Window.idl @@ -24,6 +24,7 @@ interface Window : EventTarget { [Replaceable] readonly attribute WindowProxy self; [LegacyUnforgeable] readonly attribute Document document; attribute DOMString name; + attribute DOMString status; [PutForwards=href, LegacyUnforgeable] readonly attribute Location location; readonly attribute History history; readonly attribute Navigation navigation;