Skip to content

Commit

Permalink
LibWeb: Call did_finish_load when page readiness changes to complete
Browse files Browse the repository at this point in the history
  • Loading branch information
kalenikaliaksandr committed Apr 16, 2023
1 parent a9a737b commit 2ca3afe
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Userland/Libraries/LibWeb/DOM/Document.cpp
Expand Up @@ -1591,6 +1591,15 @@ void Document::update_readiness(HTML::DocumentReadyState readiness_value)

// 4. Fire an event named readystatechange at document.
dispatch_event(Event::create(realm(), HTML::EventNames::readystatechange).release_value_but_fixme_should_propagate_errors());

if (readiness_value == HTML::DocumentReadyState::Complete) {
// FIXME: about:blank should not be an exception
if (url().to_deprecated_string() != "about:blank") {
if (auto* page = browsing_context()->page()) {
page->client().page_did_finish_loading(url());
}
}
}
}

Page* Document::page()
Expand Down

0 comments on commit 2ca3afe

Please sign in to comment.