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

LibWeb: Make Window.getSelection() forward to Document.getSelection()

(And have document create the Selection object on demand.)
This commit is contained in:
Andreas Kling 2022-10-10 21:23:03 +02:00
parent b945d164e2
commit a2348ebcc0
4 changed files with 24 additions and 10 deletions

View file

@ -87,6 +87,9 @@ public:
static JS::NonnullGCPtr<Document> construct_impl(JS::Realm&);
virtual ~Document() override;
// https://w3c.github.io/selection-api/#dom-document-getselection
JS::GCPtr<Selection::Selection> get_selection();
size_t next_layout_node_serial_id(Badge<Layout::Node>) { return m_next_layout_node_serial_id++; }
size_t layout_node_count() const { return m_next_layout_node_serial_id; }
@ -592,6 +595,8 @@ private:
// https://html.spec.whatwg.org/multipage/dom.html#previous-document-unload-timing
DocumentUnloadTimingInfo m_previous_document_unload_timing;
JS::GCPtr<Selection::Selection> m_selection;
};
}