Callum Law
3b3f06bfa3
LibWeb: Support non-literal integers in repeat()
...
We now support non-literal integers (i.e. `calc()` and tree counting
functions) within `<track-repeat>` and `<fixed-repeat>`
2026-03-30 14:05:10 +01:00
Callum Law
9b2dd73359
LibWeb: Store ColorMixComponent::percentage as StyleValue
...
This simplifies handling and gets us closer to removing the
`OrCalculated` classes
2026-03-30 14:05:10 +01:00
Callum Law
fe5d6471f0
LibWeb: Store GridTrackPlacement sub-values as StyleValues
...
Gets us one step closer to removing the `FooOrCalculated` classes
2026-03-30 14:05:10 +01:00
Callum Law
0ab06e119e
LibWeb: Use i32 max for clamping 'infinite' calculated integers
...
This required us to change our range values from `float`s to `double`s
since `float` can't exactly represent i32 max
2026-03-26 12:30:01 +01:00
Callum Law
cdc264a62e
LibWeb: Validate nested contents when parsing declaration value
...
Previously we automatically assumed that contents inside functions and
blocks were valid, now we actually check them.
2026-03-26 01:11:39 +00:00
Callum Law
cfc2e64b4b
LibWeb: Add is_valid_custom_ident function
...
We repeat this pattern in a couple of places so let's add a single
helper method
2026-03-26 01:11:39 +00:00
Callum Law
614a5cf33e
LibWeb: Set context for parsing against <foo-percentage> syntax
...
This means that we correctly parse dimension percentage mixes (i.e.
`calc(10px + 10%)` is a valid `<length-percentage>`)
2026-03-26 01:11:39 +00:00
Callum Law
02db1b942b
LibWeb: Improve handling of calculated values in <ratio>
...
We no longer try to resolve calculated values at parse time which means
we support relative lengths.
We now clamp negative values rather than rejecting them at parse time.
Parsing has been inlined into `parse_ratio_value` and `parse_ratio` has
been removed since `parse_ratio_value` was the only caller
2026-03-24 14:00:01 +00:00
Callum Law
f347be8206
LibWeb: Store underlying RatioStyleValue values as StyleValues
...
Previously we stored a fully formed `Ratio` - this restricted us from
supporting calculated values which will be implemented in a later commit
2026-03-24 14:00:01 +00:00
mikiubo
b5e90e0350
LibWeb: Remove outdated FIXME about path() in basic-shape parser
...
Remove a FIXME stating that path() was not implemented in
basic-shape parsing, as it is now supported.
2026-03-21 02:44:49 +00:00
Callum Law
6f226f3d2e
LibWeb: Add missing AD-HOC comment to parse_family_name_value
2026-03-20 14:06:39 +00:00
Callum Law
915fc4602b
LibWeb: Implement CSS inherit() function
...
The remaining failing imported tests are due to wider issues which are
covered by FIXMEs (both existing and added in this commit)
2026-03-19 10:25:37 +01:00
Callum Law
2300ba41fb
LibWeb: Use generic <color-interpolation-method> parsing for color-mix
...
This also fixes an issue where we would allow arbitrary idents as color
spaces
2026-03-18 13:21:57 +00:00
Callum Law
d8c38a294c
LibWeb: Add a generic <color-interpolation-method> parsing method
...
Previously we had two implementations for parsing
`<color-interpolation-method>`, one for gradients and one for
`color-mix()` - this commit adds another which will unify the existing
ones in following commits.
This implementation has a couple of advantages over the existing ones:
- It is simpler in that it uses global CSS enums and their helper
functions
- It is spec compliant (unlike the `color-mix()` one which allows
arbitrary idents)
- It parses as a `StyleValue` which will be required once we support
`<custom-color-space>` since that can be an `ident()` which isn't
resolvable at parse time
2026-03-18 13:21:57 +00:00
Callum Law
c47f226225
LibWeb: Support CSS if() function
...
We don't yet support style queries
2026-03-09 14:36:18 +00:00
Callum Law
11d5898915
LibWeb: Make ASF grammar parsing method more reusable
...
These changes make it possible to use this function to parse
`<if-args-branch>` as part of `<if-args>`
2026-03-09 14:36:18 +00:00
Callum Law
81cb968beb
LibWeb: Support symbols() function in <counter-style>
2026-02-27 16:25:53 +00:00
Tim Ledbetter
804287847a
LibWeb: Add SVG paint fallback color support to CSS parsing
2026-02-27 17:14:50 +01:00
Callum Law
b683568556
LibWeb: Add missing predefined counter style keywords
...
This means that we properly lowercase these keywords when used as
counter style names
2026-02-27 12:10:44 +00:00
Callum Law
e6669482e6
LibWeb: Parse font-variant-alternates functions
2026-02-20 22:01:44 +00:00
Callum Law
630117e111
LibWeb: Reuse logic for parsing font-variant-alternates
...
This means that we only need to add support for parsing of alternates
functions in one place
2026-02-20 22:01:44 +00:00
Callum Law
849e55b7ae
LibWeb: Simplify parsing of font-variant-numeric
2026-02-20 22:01:44 +00:00
Callum Law
04fd7e00e9
LibWeb: Disallow disjointed numeric component of font-variant
...
The grammar groups this component together meaning that all
sub-components must occur together i.e.
`ordinal slashed-zero small-caps` is valid but
`ordinal small-caps slashed-zero` is not.
We also reuse the logic for parsing from the longhand
`font-variant-numeric` property for simplicity.
2026-02-20 22:01:44 +00:00
Callum Law
f511b95b81
LibWeb: Simplify parsing of font-variant-ligatures
2026-02-20 22:01:44 +00:00
Callum Law
d97098ec80
LibWeb: Disallow disjointed ligatures component of font-variant
...
The grammar groups this component together meaning that all
sub-components must occur together i.e.
`common-ligatures no-contextual small-caps` is valid but
`common-ligatures small-caps no-contextual` is not.
We also reuse the logic for parsing from the longhand
`font-variant-ligatures` property for simplicity.
2026-02-20 22:01:44 +00:00
Callum Law
d6b94951cf
LibWeb: Simplify parsing of font-variant-east-asian
2026-02-20 22:01:44 +00:00
Callum Law
75dd7b767f
LibWeb: Disallow disjointed east asian component of font-variant
...
The grammar groups this component together meaning that all
sub-components must occur together i.e. `jis78 full-width small-caps` is
valid but `jis78 small-caps full-width` is not.
We also reuse the logic for parsing from the longhand
`font-variant-east-asian` property for simplicity.
2026-02-20 22:01:44 +00:00
Callum Law
f0434655f9
LibWeb: Reduce recompilation from editing Enums.json
...
Reduces the recompilation caused by editing `Enums.json` from ~1528 to
~327
2026-02-19 11:27:06 +00:00
Callum Law
caa5705edf
LibWeb: Clamp blur() calculated values
2026-02-16 12:09:23 +00:00
Callum Law
2c4db0da7e
LibWeb: Clamp calculated filter color() amounts by context
...
This brings us in line with other properties/values and simplifies
handling of non-calculated values
2026-02-16 12:09:23 +00:00
Luke Wilde
5e1493d4c0
LibWeb/CSS: Don't assume that we consumed a color space token
...
Fixes https://cockpit-project.org/ crashing on load.
2026-02-14 19:54:51 +00:00
Callum Law
8a82d116d6
LibWeb: Always parse <counter-style> as such
...
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.
2026-02-12 10:33:09 +00:00
Callum Law
a541c09d61
LibWeb: Support calculated value in additive-symbols descriptor
...
Calculated weight values are resolved and verified to be in strictly
decreasing order (as with non-calculated values) at parse time.
2026-02-12 01:26:52 +01:00
Callum Law
3783dd96a3
LibWeb: Support calculated value in @counter-style pad descriptor
2026-02-12 01:26:52 +01:00
Callum Law
9b376240f9
LibWeb: Parse @counter-style pad descriptor
2026-02-03 09:58:47 +00:00
Callum Law
70c8d8746f
LibWeb: Parse @counter-style negative descriptor
2026-02-03 09:58:47 +00:00
Callum Law
703259a24c
LibWeb: Parse and serialize @counter-style rule
...
We don't yet parse or serialize any of the descriptors in the rule, just
the rule itself and the name
2026-02-03 09:58:47 +00:00
Callum Law
9b20fe6902
LibWeb: Promote font-style to ValueType
...
This means we now allow oblique angles when parsing the `font`
shorthand.
This also required us to rename the existing `FontStyle` enum to
`FontStyleKeyword`
2026-01-13 10:21:26 +00:00
Sam Atkins
ade44c7ddb
LibWeb/CSS: Make color-interpolation-method optional in color-mix()
2026-01-09 19:11:59 +00:00
Jelle Raaijmakers
ae20ecf857
AK+Everywhere: Add Vector::contains(predicate) and use it
...
No functional changes.
2026-01-08 15:27:30 +00:00
Callum Law
4f5bab7e5d
LibWeb: Support border radius in xywh() function
2026-01-06 10:50:06 +01:00
Callum Law
02a8d22a4e
LibWeb: Support border radius in rect() function
2026-01-06 10:50:06 +01:00
Callum Law
1b7567cc86
LibWeb: Support parsing of border radius in inset() function
...
Respecting this value during basic shape path resolution is yet to be
implemented
2026-01-06 10:50:06 +01:00
Callum Law
84c6fd5730
LibWeb: Make parsing of border-radius value reusable
...
This is also useful for `<basic-shape-rect>`
2026-01-06 10:50:06 +01:00
Callum Law
96a4e33eaf
LibWeb: Resolve circle()/ellipse() position keywords at parse time
2026-01-05 11:42:19 +00:00
Callum Law
41b2496d3e
LibWeb: Clamp <radial-size> calculated length percentages
...
The spec requires `<radial-size>` to be non-negative
2026-01-05 11:42:19 +00:00
Callum Law
e6ddb7db9e
LibWeb: Store EdgeStyleValue sub-values directly
...
As well as being required to implement absolutization this also means we
now bypass a limitation with `LengthPercentage` where we would always
use `SerializationMode::Normal` for the constituent lengths which gains
us some WPT passes
2026-01-02 11:43:10 +01:00
Callum Law
f17f4f233d
LibWeb: Don't serialize omitted ellipse() position argument
2025-12-12 12:20:16 +00:00
Callum Law
daf464844b
LibWeb: Support all <radial-extent> values in ellipse()
...
To do this we use the generic `RadialSizeStyleValue` which allows us to
remove the remaining logic around `<shape-radius>`
2025-12-12 12:20:16 +00:00
Callum Law
ad1083f14e
LibWeb: Don't serialize omitted circle() position argument
...
This should only be defaulted to `center` at use time
2025-12-12 12:20:16 +00:00