mirror of
https://github.com/RGBCube/serenity
synced 2025-05-19 23:55:07 +00:00

This commit removes DeprecatedString's "null" state, and replaces all its users with one of the following: - A normal, empty DeprecatedString - Optional<DeprecatedString> Note that null states of DeprecatedFlyString/StringView/etc are *not* affected by this commit. However, DeprecatedString::empty() is now considered equal to a null StringView.
42 lines
1.3 KiB
C++
42 lines
1.3 KiB
C++
/*
|
|
* Copyright (c) 2018-2022, Andreas Kling <kling@serenityos.org>
|
|
* Copyright (c) 2021, Tobias Christiansen <tobyase@serenityos.org>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <LibWeb/Layout/Box.h>
|
|
|
|
namespace Web::Layout {
|
|
|
|
class ListItemMarkerBox final : public Box {
|
|
JS_CELL(ListItemMarkerBox, Box);
|
|
|
|
public:
|
|
explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, CSS::ListStylePosition, size_t index, NonnullRefPtr<CSS::StyleProperties>);
|
|
virtual ~ListItemMarkerBox() override;
|
|
|
|
Optional<DeprecatedString> const& text() const { return m_text; }
|
|
|
|
virtual JS::GCPtr<Painting::Paintable> create_paintable() const override;
|
|
|
|
CSS::ListStyleType list_style_type() const { return m_list_style_type; }
|
|
CSS::ListStylePosition list_style_position() const { return m_list_style_position; }
|
|
|
|
private:
|
|
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::ListStyleType::None };
|
|
CSS::ListStylePosition m_list_style_position { CSS::ListStylePosition::Outside };
|
|
size_t m_index;
|
|
|
|
Optional<DeprecatedString> m_text {};
|
|
};
|
|
|
|
template<>
|
|
inline bool Node::fast_is<ListItemMarkerBox>() const { return is_list_item_marker_box(); }
|
|
|
|
}
|