mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-05 15:49:15 +00:00
LibWeb: Move and rename CSSStyleValue to StyleValues/StyleValue.{h,cpp}
This reverts 0e3487b9ab
.
Back when I made that change, I thought we could make our StyleValue
classes match the typed-om definitions directly. However, they have
different requirements. Typed-om types need to be mutable and GCed,
whereas StyleValues are immutable and ideally wouldn't require a JS VM.
While I was already making such a cataclysmic change, I've moved it into
the StyleValues directory, because it *not* being there has bothered me
for a long time. 😅
This commit is contained in:
parent
0d8ad0a9fe
commit
c57975c9fd
Notes:
github-actions[bot]
2025-08-08 14:20:54 +00:00
Author: https://github.com/AtkinsSJ
Commit: c57975c9fd
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5775
Reviewed-by: https://github.com/tcl3 ✅
167 changed files with 989 additions and 990 deletions
|
@ -17,7 +17,7 @@
|
|||
|
||||
namespace Web::CSS {
|
||||
|
||||
CounterStyleValue::CounterStyleValue(CounterFunction function, FlyString counter_name, ValueComparingNonnullRefPtr<CSSStyleValue const> counter_style, FlyString join_string)
|
||||
CounterStyleValue::CounterStyleValue(CounterFunction function, FlyString counter_name, ValueComparingNonnullRefPtr<StyleValue const> counter_style, FlyString join_string)
|
||||
: StyleValueWithDefaultOperators(Type::Counter)
|
||||
, m_properties {
|
||||
.function = function,
|
||||
|
@ -31,7 +31,7 @@ CounterStyleValue::CounterStyleValue(CounterFunction function, FlyString counter
|
|||
CounterStyleValue::~CounterStyleValue() = default;
|
||||
|
||||
// https://drafts.csswg.org/css-counter-styles-3/#generate-a-counter
|
||||
static String generate_a_counter_representation(CSSStyleValue const& counter_style, i32 value)
|
||||
static String generate_a_counter_representation(StyleValue const& counter_style, i32 value)
|
||||
{
|
||||
// When asked to generate a counter representation using a particular counter style for a particular
|
||||
// counter value, follow these steps:
|
||||
|
@ -149,7 +149,7 @@ String CounterStyleValue::to_string(SerializationMode mode) const
|
|||
|
||||
// 4. Let list be a list of CSS component values belonging to <counter>,
|
||||
// omitting the last CSS component value if it is "decimal".
|
||||
Vector<RefPtr<CSSStyleValue const>> list;
|
||||
Vector<RefPtr<StyleValue const>> list;
|
||||
list.append(CustomIdentStyleValue::create(m_properties.counter_name));
|
||||
if (m_properties.function == CounterFunction::Counters)
|
||||
list.append(StringStyleValue::create(m_properties.join_string.to_string()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue