mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-01 06:07:59 +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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user