From c5b4928f4a8f00d31d5b62a33f9246876866ecb8 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 23 Sep 2021 19:47:53 +0200 Subject: [PATCH] LibWeb: Make ListItemMarkerBox inherit style from ListItemBox --- Userland/Libraries/LibWeb/Layout/ListItemBox.cpp | 4 +++- Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp | 4 ++-- Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.h | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/ListItemBox.cpp b/Userland/Libraries/LibWeb/Layout/ListItemBox.cpp index d50df41586..7587b13a84 100644 --- a/Userland/Libraries/LibWeb/Layout/ListItemBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/ListItemBox.cpp @@ -30,8 +30,10 @@ void ListItemBox::layout_marker() return; if (!m_marker) { + auto* marker_style = dom_node().specified_css_values(); + VERIFY(marker_style); int child_index = parent()->index_of_child(*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()) m_marker->set_inline(first_child()->is_inline()); append_child(*m_marker); diff --git a/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp b/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp index b00cf27448..4aca039ed5 100644 --- a/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp @@ -11,8 +11,8 @@ namespace Web::Layout { -ListItemMarkerBox::ListItemMarkerBox(DOM::Document& document, CSS::ListStyleType style_type, size_t index) - : Box(document, nullptr, CSS::StyleProperties::create()) +ListItemMarkerBox::ListItemMarkerBox(DOM::Document& document, CSS::ListStyleType style_type, size_t index, NonnullRefPtr style) + : Box(document, nullptr, move(style)) , m_list_style_type(style_type) , m_index(index) { diff --git a/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.h b/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.h index 8189353e4c..13db342381 100644 --- a/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.h +++ b/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.h @@ -13,7 +13,7 @@ namespace Web::Layout { class ListItemMarkerBox final : public Box { public: - explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, size_t index); + explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, size_t index, NonnullRefPtr); virtual ~ListItemMarkerBox() override; virtual void paint(PaintContext&, PaintPhase) override;