mirror of
https://github.com/RGBCube/serenity
synced 2025-05-16 15:34:58 +00:00

List item markers will never have children, so let's mark them as such, which now allows our layout system to skip over their "insides" and going straight to positioning instead.
30 lines
733 B
C++
30 lines
733 B
C++
/*
|
|
* Copyright (c) 2018-2020, 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 {
|
|
public:
|
|
explicit ListItemMarkerBox(DOM::Document&, CSS::ListStyleType, size_t index, NonnullRefPtr<CSS::StyleProperties>);
|
|
virtual ~ListItemMarkerBox() override;
|
|
|
|
virtual void paint(PaintContext&, PaintPhase) override;
|
|
|
|
private:
|
|
virtual bool can_have_children() const override { return false; }
|
|
|
|
CSS::ListStyleType m_list_style_type { CSS::ListStyleType::None };
|
|
size_t m_index;
|
|
|
|
String m_text {};
|
|
};
|
|
|
|
}
|