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
commit c630ae517e
Notes: sideshowbarker 2024-07-19 00:48:54 +09:00
7 changed files with 22 additions and 21 deletions

View file

@ -45,7 +45,7 @@ void ListItemMarkerBox::paint(PaintContext& context, PaintPhase phase)
Gfx::IntRect bullet_rect { 0, 0, 4, 4 };
bullet_rect.center_within(enclosing_int_rect(absolute_rect()));
// FIXME: It would be nicer to not have to go via the parent here to get our inherited style.
auto color = parent()->specified_style().color_or_fallback(CSS::PropertyID::Color, document(), context.palette().base_text());
auto color = parent()->style().color();
context.painter().fill_rect(bullet_rect, color);
}