From 63046d82f4dc9006d5097565ff9c9815f967e227 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Wed, 6 Jan 2021 12:09:18 +0100 Subject: [PATCH] LibWeb: Use the cached background-image value in Layout::Box::paint() --- Libraries/LibWeb/Layout/Box.cpp | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/Libraries/LibWeb/Layout/Box.cpp b/Libraries/LibWeb/Layout/Box.cpp index cbc98040ea..9c468252a8 100644 --- a/Libraries/LibWeb/Layout/Box.cpp +++ b/Libraries/LibWeb/Layout/Box.cpp @@ -52,13 +52,8 @@ void Box::paint(PaintContext& context, PaintPhase phase) if (phase == PaintPhase::Background && !is_body()) { context.painter().fill_rect(enclosing_int_rect(padded_rect), computed_values().background_color()); - auto bgimage = specified_style().property(CSS::PropertyID::BackgroundImage); - if (bgimage.has_value() && bgimage.value()->is_image()) { - auto& image_value = static_cast(*bgimage.value()); - if (image_value.bitmap()) { - context.painter().draw_tiled_bitmap(enclosing_int_rect(padded_rect), *image_value.bitmap()); - } - } + if (background_image() && background_image()->bitmap()) + context.painter().draw_tiled_bitmap(enclosing_int_rect(padded_rect), *background_image()->bitmap()); } if (phase == PaintPhase::Border) {