1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 12:47:35 +00:00

LibWeb: Make ListItemMarkerBox inherit style from ListItemBox

This commit is contained in:
Andreas Kling 2021-09-23 19:47:53 +02:00
parent ca28a118ae
commit c5b4928f4a
3 changed files with 6 additions and 4 deletions

View file

@ -30,8 +30,10 @@ void ListItemBox::layout_marker()
return; return;
if (!m_marker) { if (!m_marker) {
auto* marker_style = dom_node().specified_css_values();
VERIFY(marker_style);
int child_index = parent()->index_of_child<ListItemBox>(*this).value(); int child_index = parent()->index_of_child<ListItemBox>(*this).value();
m_marker = adopt_ref(*new ListItemMarkerBox(document(), computed_values().list_style_type(), child_index + 1)); m_marker = adopt_ref(*new ListItemMarkerBox(document(), computed_values().list_style_type(), child_index + 1, *marker_style));
if (first_child()) if (first_child())
m_marker->set_inline(first_child()->is_inline()); m_marker->set_inline(first_child()->is_inline());
append_child(*m_marker); append_child(*m_marker);

View file

@ -11,8 +11,8 @@
namespace Web::Layout { namespace Web::Layout {
ListItemMarkerBox::ListItemMarkerBox(DOM::Document& document, CSS::ListStyleType style_type, size_t index) ListItemMarkerBox::ListItemMarkerBox(DOM::Document& document, CSS::ListStyleType style_type, size_t index, NonnullRefPtr<CSS::StyleProperties> style)
: Box(document, nullptr, CSS::StyleProperties::create()) : Box(document, nullptr, move(style))
, m_list_style_type(style_type) , m_list_style_type(style_type)
, m_index(index) , m_index(index)
{ {

View file

@ -13,7 +13,7 @@ namespace Web::Layout {
class ListItemMarkerBox final : public Box { class ListItemMarkerBox final : public Box {
public: public:
explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, size_t index); explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, size_t index, NonnullRefPtr<CSS::StyleProperties>);
virtual ~ListItemMarkerBox() override; virtual ~ListItemMarkerBox() override;
virtual void paint(PaintContext&, PaintPhase) override; virtual void paint(PaintContext&, PaintPhase) override;