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
243465391a
LibWeb: Cache hardcoded counter styles
...
This avoids a bunch of string validations reducing time spent in
`CounterStyle::disc()` from ~3% to ~0.01% when loading
https://en.wikipedia.org/wiki/2023_in_American_television
2026-04-08 11:59:57 +01:00
Callum Law
b86377b9dc
LibWeb: Clamp CSS <integer> value to i32 at parse time
...
This matches the behavior of other browsers. Previously we implemented
this at used-value time for z-index specifically.
2026-03-26 12:30:01 +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
d0eabada0b
LibWeb: Support extended Korean counter styles
2026-02-27 12:10:44 +00:00
Callum Law
1877c20c7b
LibWeb: Support extended Japanese counter styles
2026-02-27 12:10:44 +00:00
Callum Law
08a5ed7ec6
LibWeb: Support Chinese counter styles
...
We implement the extended version of this algorithm but don't take full
advantage of it since we are limited to an i32 for our counter values.
2026-02-27 12:10:44 +00:00
Callum Law
120cabd35c
LibWeb: Support ethiopic-numeric counter style
2026-02-27 12:10:44 +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
63e2ed3cd9
LibWeb: Implement counter style fixed algorithm
2026-02-23 11:21:09 +00:00
Callum Law
fb239ceba0
LibWeb: Implement counter style symbolic algorithm
2026-02-23 11:21:09 +00:00
Callum Law
fddeb032b4
LibWeb: Implement counter style alphabetic algorithm
2026-02-23 11:21:09 +00:00
Callum Law
0a2fe1607c
LibWeb: Implement counter style numeric algorithm
2026-02-23 11:21:09 +00:00
Callum Law
85c367667e
LibWeb: Implement counter style cyclic algorithm
2026-02-23 11:21:09 +00:00
Callum Law
2827e12571
LibWeb: Implement counter style additive algorithm
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