summaryrefslogtreecommitdiff
path: root/Userland/Libraries
diff options
context:
space:
mode:
authorAndreas Kling <kling@serenityos.org>2021-09-23 19:47:53 +0200
committerAndreas Kling <kling@serenityos.org>2021-09-24 15:01:49 +0200
commitc5b4928f4a8f00d31d5b62a33f9246876866ecb8 (patch)
treed90e23cc124e9db9837fe06225fe6ae80109db67 /Userland/Libraries
parentca28a118aedae7d35848925bb35bb62ef527cb83 (diff)
downloadserenity-c5b4928f4a8f00d31d5b62a33f9246876866ecb8.zip
LibWeb: Make ListItemMarkerBox inherit style from ListItemBox
Diffstat (limited to 'Userland/Libraries')
-rw-r--r--Userland/Libraries/LibWeb/Layout/ListItemBox.cpp4
-rw-r--r--Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp4
-rw-r--r--Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.h2
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<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())
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<CSS::StyleProperties> 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<CSS::StyleProperties>);
virtual ~ListItemMarkerBox() override;
virtual void paint(PaintContext&, PaintPhase) override;