mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 21:29:06 +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:
parent
78a51933ad
commit
c630ae517e
Notes:
sideshowbarker
2024-07-19 00:48:54 +09:00
Author: https://github.com/awesomekling
Commit: c630ae517e
7 changed files with 22 additions and 21 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue