LibWeb: Add a NavigationObserver to be notified of navigable updates

This contains a hook to be notified when a navigable navigation is
complete, to be used by WebDriver.
This commit is contained in:
Timothy Flynn 2024-10-25 10:26:01 -04:00 committed by Andreas Kling
commit 74ef9dc393
Notes: github-actions[bot] 2024-10-26 09:26:57 +00:00
6 changed files with 105 additions and 0 deletions

View file

@ -59,6 +59,9 @@ public:
ErrorOr<void> initialize_navigable(JS::NonnullGCPtr<DocumentState> document_state, JS::GCPtr<Navigable> parent);
void register_navigation_observer(Badge<NavigationObserver>, NavigationObserver&);
void unregister_navigation_observer(Badge<NavigationObserver>, NavigationObserver&);
Vector<JS::Handle<Navigable>> child_navigables() const;
bool is_traversable() const;
@ -232,6 +235,8 @@ private:
JS::NonnullGCPtr<Page> m_page;
HashTable<JS::NonnullGCPtr<NavigationObserver>> m_navigation_observers;
bool m_has_been_destroyed { false };
CSSPixelSize m_size;