ladybird/Userland/Libraries/LibWeb/Layout/ListItemBox.cpp
Andreas Kling 268b9c5d90 LibWeb: Make the layout tree GC-allocated
This removes a set of complex reference cycles between DOM, layout tree
and browsing context.

It also makes lifetimes much easier to reason about, as the DOM and
layout trees are now free to keep each other alive.
2022-10-20 15:16:23 +02:00

32 lines
739 B
C++

/*
* Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
*
* 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::BlockContainer(document, element, move(style))
{
}
ListItemBox::~ListItemBox() = default;
void ListItemBox::visit_edges(Cell::Visitor& visitor)
{
Base::visit_edges(visitor);
visitor.visit(m_marker);
}
void ListItemBox::set_marker(JS::GCPtr<ListItemMarkerBox> marker)
{
m_marker = move(marker);
}
}