mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 18:15:06 +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
|
@ -199,18 +199,6 @@ void LayoutBlock::render(RenderingContext& context)
|
|||
|
||||
LayoutNode::render(context);
|
||||
|
||||
// FIXME: position this properly
|
||||
if (style().string_or_fallback(CSS::PropertyID::Display, "block") == "list-item") {
|
||||
Rect bullet_rect {
|
||||
rect().x() - 8,
|
||||
rect().y() + 4,
|
||||
3,
|
||||
3
|
||||
};
|
||||
|
||||
context.painter().fill_rect(bullet_rect, style().color_or_fallback(CSS::PropertyID::Color, document(), Color::Black));
|
||||
}
|
||||
|
||||
if (children_are_inline()) {
|
||||
for (auto& line_box : m_line_boxes) {
|
||||
for (auto& fragment : line_box.fragments()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue