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
commit 0bbe836f8c
Notes: github-actions[bot] 2024-10-26 09:27:09 +00:00
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