1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:37:46 +00:00

LibWeb: Move image resource request out of ImageStyleValue constructor

This always felt awkward to me, and required a few other hacks to make
it work. Now, the request is only started when `load_bitmap()` is
called, which we do inside `NodeWithStyle::apply_style()`.
This commit is contained in:
Sam Atkins 2021-10-22 20:55:27 +01:00 committed by Andreas Kling
parent cf3c125e77
commit 0f393771b7
5 changed files with 17 additions and 9 deletions

View file

@ -218,6 +218,7 @@ void NodeWithStyle::apply_style(const CSS::StyleProperties& specified_style)
auto bgimage = specified_style.property(CSS::PropertyID::BackgroundImage);
if (bgimage.has_value() && bgimage.value()->is_image()) {
m_background_image = bgimage.value()->as_image();
m_background_image->load_bitmap(document());
}
computed_values.set_box_sizing(specified_style.box_sizing());