mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 09:47:35 +00:00
LibHTML: Implement basic support for background-color
This commit is contained in:
parent
a4fccc02ec
commit
37a37accd4
2 changed files with 9 additions and 1 deletions
|
@ -42,7 +42,12 @@ void LayoutNode::render(RenderingContext& context)
|
|||
if (!is_anonymous() && node() == document().hovered_node())
|
||||
context.painter().draw_rect(m_rect, Color::Red);
|
||||
#endif
|
||||
// TODO: render our background and border
|
||||
|
||||
auto bgcolor = style_properties().property("background-color");
|
||||
if (bgcolor.has_value() && bgcolor.value()->is_color())
|
||||
context.painter().fill_rect(rect(), bgcolor.value()->to_color());
|
||||
|
||||
// TODO: render our border
|
||||
for_each_child([&](auto& child) {
|
||||
child.render(context);
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue