mirror of
https://github.com/RGBCube/serenity
synced 2025-07-10 05:37:35 +00:00
LibHTML: Implement rendering
This commit is contained in:
parent
93003bfda1
commit
235dee8c42
7 changed files with 62 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue