1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-28 18:15:09 +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

@ -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());
}
}