LibWeb: Add a DocumentObserver hook to be notified of readyState changes

This commit is contained in:
Timothy Flynn
2024-10-25 10:20:55 -04:00
committed by Andreas Kling
parent 44b1c4f2b5
commit 0bbe836f8c
3 changed files with 18 additions and 2 deletions

View File

@@ -2392,6 +2392,11 @@ void Document::update_readiness(HTML::DocumentReadyState readiness_value)
m_needs_to_call_page_did_load = true;
}
}
for (auto document_observer : m_document_observers) {
if (document_observer->document_readiness_observer())
document_observer->document_readiness_observer()->function()(m_readiness);
}
}
// https://html.spec.whatwg.org/multipage/dom.html#dom-document-lastmodified