summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM/Document.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-20 21:44:42 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-20 23:44:59 +0200
commit92deba7197dc705109423945d52518de6d4d52c7 (patch)
tree9827cf71ada22b4adef70d81b9c26f90f7741cb7 /Userland/Libraries/LibWeb/DOM/Document.h
parentab8432783e8d6187a91e48149bf5731e912d6349 (diff)
downloadserenity-92deba7197dc705109423945d52518de6d4d52c7.zip
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.
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Document.h')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.h20
1 files changed, 17 insertions, 3 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h
index 230d810f71..bf54165835 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.h
+++ b/Userland/Libraries/LibWeb/DOM/Document.h
@@ -135,12 +135,11 @@ public:
String title() const;
void set_title(String const&);
- void attach_to_browsing_context(Badge<HTML::BrowsingContext>, HTML::BrowsingContext&);
- void detach_from_browsing_context(Badge<HTML::BrowsingContext>, HTML::BrowsingContext&);
-
HTML::BrowsingContext* browsing_context() { return m_browsing_context.ptr(); }
HTML::BrowsingContext const* browsing_context() const { return m_browsing_context.ptr(); }
+ void set_browsing_context(HTML::BrowsingContext*);
+
Page* page();
Page const* page() const;
@@ -322,6 +321,9 @@ public:
// https://html.spec.whatwg.org/multipage/interaction.html#update-the-visibility-state
void update_the_visibility_state(HTML::VisibilityState);
+ // NOTE: This does not fire any events, unlike update_the_visibility_state().
+ void set_visibility_state(Badge<HTML::BrowsingContext>, HTML::VisibilityState);
+
void run_the_resize_steps();
void run_the_scroll_steps();
@@ -386,6 +388,15 @@ public:
// https://html.spec.whatwg.org/multipage/browsers.html#list-of-the-descendant-browsing-contexts
Vector<NonnullRefPtr<HTML::BrowsingContext>> list_of_descendant_browsing_contexts() const;
+ // https://html.spec.whatwg.org/multipage/window-object.html#discard-a-document
+ void discard();
+
+ // https://html.spec.whatwg.org/multipage/browsing-the-web.html#abort-a-document
+ void abort();
+
+ // https://html.spec.whatwg.org/multipage/dom.html#active-parser
+ RefPtr<HTML::HTMLParser> active_parser();
+
protected:
virtual void visit_edges(Cell::Visitor&) override;
@@ -476,6 +487,9 @@ private:
size_t m_number_of_things_delaying_the_load_event { 0 };
+ // https://html.spec.whatwg.org/multipage/browsing-the-web.html#concept-document-salvageable
+ bool m_salvageable { true };
+
// https://html.spec.whatwg.org/#page-showing
bool m_page_showing { false };