mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 13:19:05 +00:00
LibWeb: Add a DocumentObserver hook to be notified of readyState changes
This commit is contained in:
parent
44b1c4f2b5
commit
0bbe836f8c
Notes:
github-actions[bot]
2024-10-26 09:27:09 +00:00
Author: https://github.com/trflynn89
Commit: 0bbe836f8c
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/1967
3 changed files with 18 additions and 2 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2023, Tim Flynn <trflynn89@serenityos.org>
|
||||
* Copyright (c) 2023-2024, Tim Flynn <trflynn89@ladybird.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -25,6 +25,7 @@ void DocumentObserver::visit_edges(Cell::Visitor& visitor)
|
|||
visitor.visit(m_document);
|
||||
visitor.visit(m_document_became_inactive);
|
||||
visitor.visit(m_document_completely_loaded);
|
||||
visitor.visit(m_document_readiness_observer);
|
||||
}
|
||||
|
||||
void DocumentObserver::finalize()
|
||||
|
@ -43,4 +44,9 @@ void DocumentObserver::set_document_completely_loaded(Function<void()> callback)
|
|||
m_document_completely_loaded = JS::create_heap_function(vm().heap(), move(callback));
|
||||
}
|
||||
|
||||
void DocumentObserver::set_document_readiness_observer(Function<void(HTML::DocumentReadyState)> callback)
|
||||
{
|
||||
m_document_readiness_observer = JS::create_heap_function(vm().heap(), move(callback));
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue