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:
parent
1bc7a52587
commit
8b787020a2
Notes:
github-actions[bot]
2025-05-22 21:45:47 +00:00
Author: https://github.com/trflynn89
Commit: 8b787020a2
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4843
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 4 additions and 0 deletions
|
@ -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()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue