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

@ -64,9 +64,7 @@ void InlineNode::paint_fragment(PaintContext& context, const LineBoxFragment& fr
auto& painter = context.painter();
if (phase == PaintPhase::Background) {
auto background_color = specified_style().property(CSS::PropertyID::BackgroundColor);
if (background_color.has_value() && background_color.value()->is_color())
painter.fill_rect(enclosing_int_rect(fragment.absolute_rect()), background_color.value()->to_color(document()));
painter.fill_rect(enclosing_int_rect(fragment.absolute_rect()), style().background_color());
}
}