Commit Graph

34 Commits

Author SHA1 Message Date
Sam Atkins
afdc0df70b Tests: Re-enable some tests which rely on font loading
These should no longer be flaky, now that we wait for fonts to load.
2026-02-24 15:44:32 +00:00
Callum Law
49eb9d7a7a LibWeb: Support composition of mixed values
This exposes an existing issue with interpolation where it is not clear
in what situations zero-valued dimensions should be excluded from the
interpolated value of a dimension-percentage mix (e.g. `calc(50% + 0px)`
vs `50%`) - but this is just a serialization issue as both
representations are resolved to the same used value
2026-02-23 09:01:19 +00:00
Callum Law
55ce89d513 LibWeb: Support composition of BasicShapeStyleValue
This also required supporting composition for it's constituent types
(`RadialSizeStyleValue` and `BorderRadiusRect`).

The remaining failing subtests in the two affected tests are because we
dont yet support compositing of mixed values
2026-01-22 11:29:41 +00:00
Callum Law
51bea3b308 LibWeb: Clamp interpolation of RadialSizeStyleValue 2026-01-22 11:29:41 +00:00
Callum Law
04885a2d41 Tests: Import some more composition and interpolation tests 2026-01-22 11:29:41 +00:00
Callum Law
668d3afde0 LibWeb: Properly parse attributes for CSS-connected FontFace
Previously we would just set the attributes to the serialized
descriptors, even if they were the empty string.

We now apply defaults when we have empty descriptors and apply parsing
logic from the various `set_*` methods (only applicable to `font-family`
so far where we now extract the value from either a string or a
custom-ident)

Fixes an issue in some css/css-shapes WPT tests where we weren't
properly matching fonts.
2026-01-13 10:40:00 +00:00
Callum Law
2ba1141e3c LibWeb: Don't round when absolutizing lengths
Lengths should be rounded at use-time rather than compute-time

Also removes an unnecessary if statement which was always true
2026-01-08 10:51:35 +01:00
Tim Ledbetter
e4fb4d7c1a LibWeb: Extract animation-composition value from keyframe at-rules
Previously, we weren't respecting the value of this property, so the
composite operation always defaulted to
`AnimationComposition::Replace`.
2026-01-06 12:58:54 +01:00
Callum Law
72a00a17cc LibWeb: Omit nonzero fill rule when serializing polygon()
Gains us ~160 WPT passes
2026-01-06 10:49:51 +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
cb1425877a LibWeb: Serialize inset() arguments as positional value list 2026-01-06 10:50:06 +01:00
Callum Law
a2b2baca7e Tests: Import some more inset() tests 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
6964593377 LibWeb: Add absolutized method to EdgeStyleValue
Fixes #7192.

We absolutize `EdgeStyleValue` to always be relative to the top/left
edge which allows for some simplification.
2026-01-02 11:43:10 +01: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
Sam Atkins
40b25f631b Tests: Re-import some border- and outline-width tests
Some subtests changed in response to this CSSWG resolution:
https://github.com/w3c/csswg-drafts/issues/11494#issuecomment-2675800489

Basically, `border-style: none` now affects the used value of
`border-width`, not the computed value. (And the same for `outline`
properties.)

This affects way more tests than I expected because
interpolation-testcommon.js now adds tests for composition.
2025-12-15 21:28:19 +01:00
Callum Law
883b190e64 LibWeb: Omit default radius from ellipse() serialization 2025-12-12 12:20:16 +00:00
Callum Law
f17f4f233d LibWeb: Don't serialize omitted ellipse() position argument 2025-12-12 12:20:16 +00:00
Callum Law
375df05ab9 LibWeb: Omit default radius from serialization of CSS circle() 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
Callum Law
8501d6995d LibWeb: Support all <radial-extent> values in circle() 2025-12-12 12:20:16 +00:00
Callum Law
f751e59c88 LibWeb: Import some circle() and ellipse() tests 2025-12-12 12:20:16 +00:00
Callum Law
73f41b20b4 LibWeb: Compute rect() and xywh() to their equivalent inset()
This also allows us to remove the path generation and interpolation
handling for `rect()` and `xywh()` since that occurs after computation

Regressions in clip-path-interpolation-xywh.html are due to improper
simplification of length-percentage mixes where the length is 0px.
2025-12-09 11:23:59 +00:00
Callum Law
2fca7a3847 LibWeb: Add absolutized method to BasicShapeStyleValue 2025-12-09 11:23:59 +00:00
Sam Atkins
48854a8e74 LibWeb/CSS: Resolve calc percentages as lengths in basic-shape functions
Fixes a crash on https://www.lego.com/en-gb/product/game-boy-72046 :^)

The apparent regressions in clip-path-interpolation-xywh-rect.html are
because of false positives. Something about the test was causing it to
compare two wrong values that happened to be the same. Now one of the
values is correct, they don't match.
2025-11-14 09:55:09 +00:00
Callum Law
1a3635cda5 LibWeb: Parse the shape-margin property 2025-10-17 11:10:05 +01:00
Callum Law
9c7202e3f3 LibWeb: Parse the shape-image-threshold property 2025-10-17 11:10:05 +01:00
Callum Law
01c5b6f74f LibWeb: Parse the shape-outside property 2025-10-17 11:10:05 +01:00
Callum Law
fb64be2f78 Tests: Import some css-shapes tests 2025-10-17 11:10:05 +01:00
Sam Atkins
0ff61e5e7b LibWeb/CSS: Implement path() basic shape 2025-07-17 13:59:23 -04:00
Sam Atkins
07b5b7ffb6 Tests: Import CSS clip-path: path(...) tests 2025-07-17 13:59:23 -04:00