diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/ListItemBox.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/ListItemBox.cpp | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/ListItemBox.cpp b/Userland/Libraries/LibWeb/Layout/ListItemBox.cpp index 590873a943..a830b46c1f 100644 --- a/Userland/Libraries/LibWeb/Layout/ListItemBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/ListItemBox.cpp @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org> + * Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org> * Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org> * * SPDX-License-Identifier: BSD-2-Clause @@ -19,30 +19,9 @@ ListItemBox::~ListItemBox() { } -void ListItemBox::layout_marker() +void ListItemBox::set_marker(RefPtr<ListItemMarkerBox> marker) { - if (m_marker) { - remove_child(*m_marker); - m_marker = nullptr; - } - - if (computed_values().list_style_type() == CSS::ListStyleType::None) - 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, *marker_style)); - if (first_child()) - m_marker->set_inline(first_child()->is_inline()); - append_child(*m_marker); - } - - m_marker->set_offset(-(m_marker->content_width() + 4), 0); - - if (m_marker->content_height() > content_height()) - set_content_height(m_marker->content_height()); + m_marker = move(marker); } } |