1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-10 05:37:35 +00:00

LibHTML: Implement rendering

This commit is contained in:
Sergey Bugaev 2019-09-25 12:40:37 +03:00 committed by Andreas Kling
parent 93003bfda1
commit 235dee8c42
7 changed files with 62 additions and 0 deletions

View file

@ -1,3 +1,4 @@
#include <LibGUI/GPainter.h>
#include <LibHTML/DOM/Element.h>
#include <LibHTML/Layout/LayoutBlock.h>
@ -143,3 +144,19 @@ void LayoutBlock::compute_height()
if (height_length.is_absolute())
rect().set_height(height_length.to_px());
}
void LayoutBlock::render(RenderingContext& context)
{
LayoutNode::render(context);
// FIXME: position this properly
if (style_properties().string_or_fallback("display", "block") == "list-item") {
Rect bullet_rect {
rect().x() - 8,
rect().y() + 4,
3,
3
};
context.painter().fill_rect(bullet_rect, Color::Black);
}
}