diff --git a/Userland/Libraries/LibWeb/CSS/Identifiers.json b/Userland/Libraries/LibWeb/CSS/Identifiers.json index b8c9252910..2f66bf8167 100644 --- a/Userland/Libraries/LibWeb/CSS/Identifiers.json +++ b/Userland/Libraries/LibWeb/CSS/Identifiers.json @@ -104,6 +104,8 @@ "line-through", "list-item", "lowercase", + "lower-alpha", + "lower-latin", "medium", "move", "ne-resize", diff --git a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp index 812f398f5b..9860bb1254 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp +++ b/Userland/Libraries/LibWeb/CSS/StyleProperties.cpp @@ -578,6 +578,10 @@ Optional StyleProperties::list_style_type() const return CSS::ListStyleType::Decimal; case CSS::ValueID::DecimalLeadingZero: return CSS::ListStyleType::DecimalLeadingZero; + case CSS::ValueID::LowerAlpha: + return CSS::ListStyleType::LowerAlpha; + case CSS::ValueID::LowerLatin: + return CSS::ListStyleType::LowerLatin; default: return {}; } diff --git a/Userland/Libraries/LibWeb/CSS/StyleValue.h b/Userland/Libraries/LibWeb/CSS/StyleValue.h index ac7d84aa2b..9a0b472a6d 100644 --- a/Userland/Libraries/LibWeb/CSS/StyleValue.h +++ b/Userland/Libraries/LibWeb/CSS/StyleValue.h @@ -160,6 +160,8 @@ enum class ListStyleType { Square, Decimal, DecimalLeadingZero, + LowerAlpha, + LowerLatin, }; enum class Overflow : u8 { diff --git a/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp b/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp index 646ffe9b04..dc201e4712 100644 --- a/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp +++ b/Userland/Libraries/LibWeb/Layout/ListItemMarkerBox.cpp @@ -5,11 +5,14 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include namespace Web::Layout { +constexpr auto lower_alpha = "abcdefghijklmnopqrstuvwxyz"; + ListItemMarkerBox::ListItemMarkerBox(DOM::Document& document, CSS::ListStyleType style_type, size_t index) : Box(document, nullptr, CSS::StyleProperties::create()) , m_list_style_type(style_type) @@ -74,6 +77,10 @@ void ListItemMarkerBox::paint(PaintContext& context, PaintPhase phase) m_index < 10 ? String::formatted("0{}.", m_index) : String::formatted("{}.", m_index), Gfx::TextAlignment::Center); break; + case CSS::ListStyleType::LowerAlpha: + case CSS::ListStyleType::LowerLatin: + context.painter().draw_text(enclosing, number_to_alphabet(m_index, lower_alpha), Gfx::TextAlignment::Center); + break; case CSS::ListStyleType::None: return;