LibWeb: Only schedule ImageStyleValue resource load once

load_any_resources() may get called multiple times during layout, but
once we've started a resource load, we don't need to do it again.
This commit is contained in:
Andreas Kling 2022-09-07 17:38:29 +02:00
parent faf9746244
commit 9018b58875
Notes: sideshowbarker 2024-07-17 07:22:15 +09:00

View file

@ -1482,6 +1482,9 @@ void ImageStyleValue::load_any_resources(DOM::Document& document)
if (m_bitmap)
return;
if (resource())
return;
m_document = &document;
auto request = LoadRequest::create_for_url_on_page(m_url, document.page());
set_resource(ResourceLoader::the().load_resource(Resource::Type::Image, request));