mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2026-04-19 02:10:26 +00:00
Previously we parsed it as `<custom-ident>` in `<counter>` and as a keyword in `list-style-type`. The practical effect of this is: - Spec defined counter style names in `<counter>` are ASCII lowercased on parse. - Non spec defined counter style names are allowed in `list-style-type. We are still to parse the `symbols()` function but this gives us a better base for that.
24 lines
592 B
C++
24 lines
592 B
C++
/*
|
|
* Copyright (c) 2026, Callum Law <callumlaw1709@outlook.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include "CounterStyleStyleValue.h"
|
|
#include <LibWeb/CSS/Enums.h>
|
|
|
|
namespace Web::CSS {
|
|
|
|
void CounterStyleStyleValue::serialize(StringBuilder& builder, SerializationMode) const
|
|
{
|
|
builder.append(m_name);
|
|
}
|
|
|
|
Optional<CounterStyleNameKeyword> CounterStyleStyleValue::to_counter_style_name_keyword() const
|
|
{
|
|
return keyword_from_string(m_name)
|
|
.map([](auto keyword) { return keyword_to_counter_style_name_keyword(keyword); })
|
|
.value_or(OptionalNone {});
|
|
}
|
|
|
|
}
|