1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-08 13:37:10 +09:00

LibWeb: Delay the document load event while re-fetching <object> images

We are required to delay the load event while any fetch is ongoing. We
currently have a very hacky re-fetch for images to go through the shared
resource request infrastructure. We must delay the load event during
this re-fetch.

This becomes an issue in an upcoming commit to import the acid2 test.
This commit is contained in:
Timothy Flynn 2025-05-22 12:32:30 -04:00 committed by Tim Flynn
parent 1bc7a52587
commit 8b787020a2
Notes: github-actions[bot] 2025-05-22 21:45:47 +00:00

View file

@ -535,13 +535,17 @@ void HTMLObjectElement::load_image()
return;
}
m_document_load_event_delayer_for_resource_load.empend(document());
m_resource_request = HTML::SharedResourceRequest::get_or_create(realm(), document().page(), *url);
m_resource_request->add_callbacks(
[this] {
run_object_representation_completed_steps(Representation::Image);
m_document_load_event_delayer_for_resource_load.take_last();
},
[this] {
run_object_representation_fallback_steps();
m_document_load_event_delayer_for_resource_load.take_last();
});
if (m_resource_request->needs_fetching()) {