diff options
author | Andreas Kling <kling@serenityos.org> | 2022-09-07 17:38:29 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-09-07 17:47:33 +0200 |
commit | 9018b58875bb9d68d4edb5062b2e6ea113e6c272 (patch) | |
tree | 6f805ad9a1ebeda529a8a420abfada5e1865d15a | |
parent | faf974624428b37176ecb13c87c87de58c23befb (diff) | |
download | serenity-9018b58875bb9d68d4edb5062b2e6ea113e6c272.zip |
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.
-rw-r--r-- | Userland/Libraries/LibWeb/CSS/StyleValue.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp b/Userland/Libraries/LibWeb/CSS/StyleValue.cpp index e2142e1957..897209b0d3 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.cpp +++ b/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)); |