summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibWeb/DOM/Document.h
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2022-09-21 00:03:53 +0200
committerAndreas Kling <kling@serenityos.org>2022-09-21 11:51:17 +0200
commit67559b12797ce41cfce01a61b8eaf974f2bed175 (patch)
treecb7d47feb8fd872f7f8118850c0493c88d86e29b /Userland/Libraries/LibWeb/DOM/Document.h
parent931458c3370dc68da5d773566aff07020d04630c (diff)
downloadserenity-67559b12797ce41cfce01a61b8eaf974f2bed175.zip
LibWeb: Add load/unload timing structures to Document
We don't populate these with information just yet, but we will soon!
Diffstat (limited to 'Userland/Libraries/LibWeb/DOM/Document.h')
-rw-r--r--Userland/Libraries/LibWeb/DOM/Document.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/DOM/Document.h b/Userland/Libraries/LibWeb/DOM/Document.h
index bf54165835..b560d9e7c9 100644
--- a/Userland/Libraries/LibWeb/DOM/Document.h
+++ b/Userland/Libraries/LibWeb/DOM/Document.h
@@ -42,6 +42,32 @@ enum class QuirksMode {
Yes
};
+// https://html.spec.whatwg.org/multipage/dom.html#document-load-timing-info
+struct DocumentLoadTimingInfo {
+ // https://html.spec.whatwg.org/multipage/dom.html#navigation-start-time
+ double navigation_start_time { 0 };
+ // https://html.spec.whatwg.org/multipage/dom.html#dom-interactive-time
+ double dom_interactive_time { 0 };
+ // https://html.spec.whatwg.org/multipage/dom.html#dom-content-loaded-event-start-time
+ double dom_content_loaded_event_start_time { 0 };
+ // https://html.spec.whatwg.org/multipage/dom.html#dom-content-loaded-event-end-time
+ double dom_content_loaded_event_end_time { 0 };
+ // https://html.spec.whatwg.org/multipage/dom.html#dom-complete-time
+ double dom_complete_time { 0 };
+ // https://html.spec.whatwg.org/multipage/dom.html#load-event-start-time
+ double load_event_start_time { 0 };
+ // https://html.spec.whatwg.org/multipage/dom.html#load-event-end-time
+ double load_event_end_time { 0 };
+};
+
+// https://html.spec.whatwg.org/multipage/dom.html#document-unload-timing-info
+struct DocumentUnloadTimingInfo {
+ // https://html.spec.whatwg.org/multipage/dom.html#unload-event-start-time
+ double unload_event_start_time { 0 };
+ // https://html.spec.whatwg.org/multipage/dom.html#unload-event-end-time
+ double unload_event_end_time { 0 };
+};
+
class Document
: public ParentNode
, public NonElementParentNode<Document>
@@ -397,6 +423,14 @@ public:
// https://html.spec.whatwg.org/multipage/dom.html#active-parser
RefPtr<HTML::HTMLParser> active_parser();
+ // https://html.spec.whatwg.org/multipage/dom.html#load-timing-info
+ DocumentLoadTimingInfo const& load_timing_info() { return m_load_timing_info; }
+ void set_load_timing_info(DocumentLoadTimingInfo const& load_timing_info) { m_load_timing_info = load_timing_info; }
+
+ // https://html.spec.whatwg.org/multipage/dom.html#previous-document-unload-timing
+ DocumentUnloadTimingInfo const& previous_document_unload_timing() { return m_previous_document_unload_timing; }
+ void set_previous_document_unload_timing(DocumentUnloadTimingInfo const& previous_document_unload_timing) { m_previous_document_unload_timing = previous_document_unload_timing; }
+
protected:
virtual void visit_edges(Cell::Visitor&) override;
@@ -546,6 +580,12 @@ private:
// https://html.spec.whatwg.org/multipage/interaction.html#visibility-state
HTML::VisibilityState m_visibility_state { HTML::VisibilityState::Hidden };
+
+ // https://html.spec.whatwg.org/multipage/dom.html#load-timing-info
+ DocumentLoadTimingInfo m_load_timing_info;
+
+ // https://html.spec.whatwg.org/multipage/dom.html#previous-document-unload-timing
+ DocumentUnloadTimingInfo m_previous_document_unload_timing;
};
}