mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 10:12:25 -05:00
1682f0b760
SPDX License Identifiers are a more compact / standardized way of representing file license information. See: https://spdx.dev/resources/use/#identifiers This was done with the `ambr` search and replace tool. ambr --no-parent-ignore --key-from-file --rep-from-file key.txt rep.txt *
44 lines
1.1 KiB
C++
44 lines
1.1 KiB
C++
/*
|
|
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
|
* Copyright (c) 2021, Tobias Christiansen <tobi@tobyase.de>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Layout/ListItemBox.h>
|
|
#include <LibWeb/Layout/ListItemMarkerBox.h>
|
|
|
|
namespace Web::Layout {
|
|
|
|
ListItemBox::ListItemBox(DOM::Document& document, DOM::Element& element, NonnullRefPtr<CSS::StyleProperties> style)
|
|
: Layout::BlockBox(document, &element, move(style))
|
|
{
|
|
}
|
|
|
|
ListItemBox::~ListItemBox()
|
|
{
|
|
}
|
|
|
|
void ListItemBox::layout_marker()
|
|
{
|
|
if (m_marker) {
|
|
remove_child(*m_marker);
|
|
m_marker = nullptr;
|
|
}
|
|
|
|
if (computed_values().list_style_type() == CSS::ListStyleType::None)
|
|
return;
|
|
|
|
if (!m_marker) {
|
|
int child_index = parent()->index_of_child<ListItemBox>(*this).value();
|
|
m_marker = adopt(*new ListItemMarkerBox(document(), computed_values().list_style_type(), child_index + 1));
|
|
if (first_child())
|
|
m_marker->set_inline(first_child()->is_inline());
|
|
append_child(*m_marker);
|
|
}
|
|
|
|
m_marker->set_offset(-8, 0);
|
|
m_marker->set_size(4, line_height());
|
|
}
|
|
|
|
}
|