LibWeb: Don't delay document "load" event for non-loading link elements

If we try loading a link element but it's reject for whatever reason
(broken URL, content filtering, etc.) make sure we don't mark that link
element as delaying the document load event.
This commit is contained in:
Andreas Kling 2022-03-19 14:58:48 +01:00
parent 2c9dfadb21
commit ceb055a75e
Notes: sideshowbarker 2024-07-17 17:07:12 +09:00

View file

@ -35,6 +35,10 @@ void HTMLLinkElement::inserted()
// as it may trigger a synchronous resource_did_load() callback.
m_document_load_event_delayer.emplace(document());
set_resource(ResourceLoader::the().load_resource(Resource::Type::Generic, request));
// NOTE: If we ended up not loading a resource for whatever reason, don't delay the load event.
if (!resource())
m_document_load_event_delayer.clear();
}
if (m_relationship & Relationship::Preload) {