1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 06:58:11 +00:00

LibWeb: Put final foreground/background colors in LayoutStyle

This way we don't have to look them up in the CSS::StyleProperties
every time we want to paint with them.
This commit is contained in:
Andreas Kling 2020-12-15 16:13:05 +01:00
parent 78a51933ad
commit c630ae517e
7 changed files with 22 additions and 21 deletions

View file

@ -327,11 +327,10 @@ Color Document::background_color(const Palette& palette) const
if (!body_layout_node)
return default_color;
auto background_color = body_layout_node->specified_style().property(CSS::PropertyID::BackgroundColor);
if (!background_color.has_value() || !background_color.value()->is_color())
auto color = body_layout_node->style().background_color();
if (!color.alpha())
return default_color;
return background_color.value()->to_color(*this);
return color;
}
RefPtr<Gfx::Bitmap> Document::background_image() const