mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 07:36:50 +00:00
LibWeb: Support strings as list-style-types
We've long claimed to support this, but then silently ignored string
values, until 4cb2063577 which would
not-so-silently crash instead. (Oops)
So, actually pass the string value along and use it in the list marker.
As part of this, rename our `list-style-type` enum to
`counter-style-name-keyword`. This is an awkward name, attempting to be
spec-based. (The spec says `<counter-style>`, which is either a
`<counter-style-name>` or a function, and the `<counter-style-name>` is
a `<custom-ident>` that also has a few predefined values. So this is the
best I could come up with.)
Unfortunately only one WPT test for this passes - the others fail
because we produce a different layout when text is in `::before` than
when it's in `::marker`, and similar issues.
This commit is contained in:
committed by
Andreas Kling
parent
b987d53926
commit
0fd0596dbf
@@ -1008,7 +1008,9 @@ TextTransform ComputedProperties::text_transform() const
|
||||
ListStyleType ComputedProperties::list_style_type() const
|
||||
{
|
||||
auto const& value = property(PropertyID::ListStyleType);
|
||||
return keyword_to_list_style_type(value.to_keyword()).release_value();
|
||||
if (value.is_string())
|
||||
return value.as_string().string_value().to_string();
|
||||
return keyword_to_counter_style_name_keyword(value.to_keyword()).release_value();
|
||||
}
|
||||
|
||||
ListStylePosition ComputedProperties::list_style_position() const
|
||||
|
||||
Reference in New Issue
Block a user