Skip to content

Commit ceb055a

Browse files
committed
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.
1 parent 2c9dfad commit ceb055a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

Userland/Libraries/LibWeb/HTML/HTMLLinkElement.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ void HTMLLinkElement::inserted()
3535
// as it may trigger a synchronous resource_did_load() callback.
3636
m_document_load_event_delayer.emplace(document());
3737
set_resource(ResourceLoader::the().load_resource(Resource::Type::Generic, request));
38+
39+
// NOTE: If we ended up not loading a resource for whatever reason, don't delay the load event.
40+
if (!resource())
41+
m_document_load_event_delayer.clear();
3842
}
3943

4044
if (m_relationship & Relationship::Preload) {

0 commit comments

Comments
 (0)