mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 15:40:19 +00:00
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:
parent
2c9dfadb21
commit
ceb055a75e
Notes:
sideshowbarker
2024-07-17 17:07:12 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/ceb055a75e
1 changed files with 4 additions and 0 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue