mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 14:37:45 +00:00
LibWeb: Create list-item markers during layout tree construction
Previously, these were added during layout. This didn't fit into the new world where layout doesn't mutate the tree incrementally, so this patch adds logic to Layout::TreeBuilder for adding a marker to each list-item box after its children have been constructed.
This commit is contained in:
parent
c9700e100e
commit
92266d2247
8 changed files with 65 additions and 54 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -11,18 +11,17 @@
|
|||
|
||||
namespace Web::Layout {
|
||||
|
||||
class ListItemMarkerBox;
|
||||
|
||||
class ListItemBox final : public BlockContainer {
|
||||
public:
|
||||
ListItemBox(DOM::Document&, DOM::Element&, NonnullRefPtr<CSS::StyleProperties>);
|
||||
virtual ~ListItemBox() override;
|
||||
|
||||
void layout_marker();
|
||||
|
||||
DOM::Element& dom_node() { return static_cast<DOM::Element&>(*BlockContainer::dom_node()); }
|
||||
DOM::Element const& dom_node() const { return static_cast<DOM::Element const&>(*BlockContainer::dom_node()); }
|
||||
|
||||
ListItemMarkerBox const* marker() const { return m_marker; }
|
||||
void set_marker(RefPtr<ListItemMarkerBox>);
|
||||
|
||||
private:
|
||||
RefPtr<ListItemMarkerBox> m_marker;
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue