Commit Graph

8 Commits

Author SHA1 Message Date
Callum Law
595848b0fa LibWeb: Implement CounterStyle::equals
This makes `ValueComparingRefPtr<CounterStyle>` work
2026-04-15 11:07:38 +01:00
Callum Law
64ccb9a015 LibWeb: Make @counter-style tree-scoped
This was a pretty straightforward change of storing registered counter
styles on the relevant `StyleScope`s and resolving by following the
process to dereference a global tree-scoped name, the only things of
note are:
 - We only define predefined counter styles (e.g. decimal) on the
   document's scope (since otherwise overrides in outer scopes would
   themselves be overriden).
 - When registering counter styles we don't have the full list of
   extendable styles so we defer fallback to "decimal" for undefined
   styles until `CounterStyle::from_counter_style_definition`.
2026-04-15 11:07:38 +01:00
Callum Law
858989e006 LibWeb: Make CounterStyle ref counted
Previously we just passed around a reference to the `CounterStyle`
stored on `Document::registered_counter_styles` but this won't be
possible for anonymous counter styles (i.e. those created by the
`<symbols()>` function)
2026-02-27 16:25:53 +00:00
Callum Law
66dee23f6e LibWeb: Use i64 when generating initial counter representation
This means that we can correctly represent the absolute value of INT_MIN
(2147483648) rather than clamping it to an i32 (2147483647)
2026-02-27 12:10:44 +00:00
Callum Law
8d4084261a LibWeb: Resolve list item marker using registered counter styles 2026-02-23 11:21:09 +00:00
Callum Law
0002d1cfc3 LibWeb: Implement algorithm to generate a counter representation 2026-02-23 11:21:09 +00:00
Callum Law
cfa5bc44d5 LibWeb: Implement creating CounterStyle from CounterStyleDefinition 2026-02-23 11:21:09 +00:00
Callum Law
ff40e9e7ba LibWeb: Stub CounterStyle
Eventually this will be used to resolve counter representations but we
are yet to implement any of the algorithms to do so.
2026-02-23 11:21:09 +00:00