mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:28:10 +00:00
LibHTML: Add LayoutNode classes for "display: list-item" and its marker
This patch removes the hard-coded hack for "display: list-item" from LayoutBlock and adds LayoutListItem and LayoutListItemMarker. Elements with "display: list-item" now generate a LayoutListItem, which may then also generate a LayoutListItemMarker if appropriate. :^)
This commit is contained in:
parent
d3d972820e
commit
f5bf8f6380
7 changed files with 81 additions and 13 deletions
18
Libraries/LibHTML/Layout/LayoutListItemMarker.cpp
Normal file
18
Libraries/LibHTML/Layout/LayoutListItemMarker.cpp
Normal file
|
@ -0,0 +1,18 @@
|
|||
#include <LibGUI/GPainter.h>
|
||||
#include <LibHTML/Layout/LayoutListItemMarker.h>
|
||||
|
||||
LayoutListItemMarker::LayoutListItemMarker()
|
||||
: LayoutNode(nullptr)
|
||||
{
|
||||
}
|
||||
|
||||
LayoutListItemMarker::~LayoutListItemMarker()
|
||||
{
|
||||
}
|
||||
|
||||
void LayoutListItemMarker::render(RenderingContext& context)
|
||||
{
|
||||
Rect bullet_rect { 0, 0, 4, 4 };
|
||||
bullet_rect.center_within(rect());
|
||||
context.painter().fill_rect(bullet_rect, style().color_or_fallback(CSS::PropertyID::Color, document(), Color::Black));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue