mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-10 01:59:31 +00:00
LibWeb: Add a document observer to be notified upon becoming active
This commit is contained in:
parent
9a62e33517
commit
a2419b5f4e
Notes:
github-actions[bot]
2024-12-12 00:39:35 +00:00
Author: https://github.com/trflynn89
Commit: a2419b5f4e
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2881
Reviewed-by: https://github.com/ADKaster ✅
3 changed files with 17 additions and 0 deletions
|
@ -20,6 +20,9 @@ class DocumentObserver final : public Bindings::PlatformObject {
|
|||
GC_DECLARE_ALLOCATOR(DocumentObserver);
|
||||
|
||||
public:
|
||||
[[nodiscard]] GC::Ptr<GC::Function<void()>> document_became_active() const { return m_document_became_active; }
|
||||
void set_document_became_active(Function<void()>);
|
||||
|
||||
[[nodiscard]] GC::Ptr<GC::Function<void()>> document_became_inactive() const { return m_document_became_inactive; }
|
||||
void set_document_became_inactive(Function<void()>);
|
||||
|
||||
|
@ -42,6 +45,7 @@ private:
|
|||
virtual void finalize() override;
|
||||
|
||||
GC::Ref<DOM::Document> m_document;
|
||||
GC::Ptr<GC::Function<void()>> m_document_became_active;
|
||||
GC::Ptr<GC::Function<void()>> m_document_became_inactive;
|
||||
GC::Ptr<GC::Function<void()>> m_document_completely_loaded;
|
||||
GC::Ptr<GC::Function<void(HTML::DocumentReadyState)>> m_document_readiness_observer;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue