Explorar o código

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.
Andreas Kling %!s(int64=2) %!d(string=hai) anos
pai
achega
9018b58875
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      Userland/Libraries/LibWeb/CSS/StyleValue.cpp

+ 3 - 0
Userland/Libraries/LibWeb/CSS/StyleValue.cpp

@@ -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));