1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 05:07:35 +00:00

LibWeb: Implement Document/BrowsingContext hookup according to spec

We now implement the browsing context's "set active document" algorithm
from the spec, as well as the "discard" algorithm for browsing contexts
and documents.
This commit is contained in:
Andreas Kling 2022-09-20 21:44:42 +02:00
parent ab8432783e
commit 92deba7197
9 changed files with 189 additions and 70 deletions

View file

@ -47,7 +47,7 @@ public:
DOM::Document const* active_document() const;
DOM::Document* active_document();
void set_active_document(DOM::Document*);
void set_active_document(JS::NonnullGCPtr<DOM::Document>);
HTML::Window* active_window();
HTML::Window const* active_window() const;
@ -165,6 +165,9 @@ public:
VisibilityState system_visibility_state() const;
void set_system_visibility_state(VisibilityState);
// https://html.spec.whatwg.org/multipage/window-object.html#a-browsing-context-is-discarded
void discard();
private:
explicit BrowsingContext(Page&, HTML::BrowsingContextContainer*);
@ -195,7 +198,7 @@ private:
Optional<HTML::Origin> m_creator_origin;
WeakPtr<HTML::BrowsingContextContainer> m_container;
JS::Handle<DOM::Document> m_active_document;
JS::Handle<HTML::Window> m_active_window;
Gfx::IntSize m_size;
Gfx::IntPoint m_viewport_scroll_offset;