ladybird/Libraries/LibWeb/Layout/ListItemMarkerBox.h
Glenn Skrzypczak 0750513993
Some checks are pending
CI / Lagom (false, NO_FUZZ, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (false, NO_FUZZ, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (true, NO_FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (false, FUZZ, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, Linux-x86_64) (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
LibWeb: Support reversed ordered lists
This PR adds support for the `reversed` attribute of
ordered lists.
2025-02-21 04:23:28 +00:00

44 lines
1.4 KiB
C++

/*
* Copyright (c) 2018-2022, Andreas Kling <andreas@ladybird.org>
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
* Copyright (c) 2025, Sam Atkins <sam@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Layout/Box.h>
namespace Web::Layout {
class ListItemMarkerBox final : public Box {
GC_CELL(ListItemMarkerBox, Box);
GC_DECLARE_ALLOCATOR(ListItemMarkerBox);
public:
explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, CSS::ListStylePosition, GC::Ref<DOM::Element>, GC::Ref<CSS::ComputedProperties>);
virtual ~ListItemMarkerBox() override;
Optional<String> text() const;
virtual GC::Ptr<Painting::Paintable> create_paintable() const override;
CSS::ListStyleType const& list_style_type() const { return m_list_style_type; }
CSS::ListStylePosition list_style_position() const { return m_list_style_position; }
private:
virtual void visit_edges(Cell::Visitor&) override;
virtual bool is_list_item_marker_box() const final { return true; }
virtual bool can_have_children() const override { return false; }
CSS::ListStyleType m_list_style_type { CSS::CounterStyleNameKeyword::None };
CSS::ListStylePosition m_list_style_position { CSS::ListStylePosition::Outside };
GC::Ref<DOM::Element> m_list_item_element;
};
template<>
inline bool Node::fast_is<ListItemMarkerBox>() const { return is_list_item_marker_box(); }
}