Commit graph

19 commits

Author SHA1 Message Date
Callum Law
cb1425877a LibWeb: Serialize inset() arguments as positional value list 2026-01-06 10:50:06 +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
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
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
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
46da13636e LibWeb: Reduce overlapping inset() dimensions 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
Callum Law
6466001367 LibWeb: Store BasicShapeStyleValue sub-values directly
Storing these within `LengthPercentage`, `LengthBox`, and `Variant`
over-complicated things.

We also now use the correct `SerializationMode` when serializing `xywh`
and `rect`
2025-12-09 11:23:59 +00:00
Andreas Kling
321809320b LibWeb+LibGfx: Remove Path::close_all_subpaths()
As it turns out, SkPath already behaves the way we need for SVG and HTML
canvas elements. Less work for us, yay! This removes a 5% item from the
profile when scrolling on https://imdb.com/

Note that there's a tiny screenshot test expectation change due to
minor antialiasing differences when we no longer do our redundant
subpath modifications.
2025-09-25 21:42:52 +02:00
Sam Atkins
dd122e2f74 LibWeb: Make LengthBox hold LengthPercentageOrAuto
Not every user of this requires an `auto` state, but most do.

This has quite a big diff but most of that is mechanical:
LengthPercentageOrAuto has `resolved_or_auto()` instead of `resolved()`,
and `to_px_or_zero()` instead of `to_px()`, to make their output
clearer.
2025-09-04 13:31:24 +01:00
Callum Law
a5cbcaf698 LibWeb: Use correct SerializationMode when serializing PercentageOr 2025-08-06 17:44:12 +01:00
Sam Atkins
0ff61e5e7b LibWeb/CSS: Implement path() basic shape 2025-07-17 13:59:23 -04:00
Sam Atkins
eec4365542 LibWeb/CSS: Extract SerializationMode into its own header
Prep for using this to serialize dimension types, and perhaps other
things in the future.
2025-05-17 07:53:24 +01:00
Gingeh
84150f972f LibWeb: Properly serialize position/edge style values 2024-12-13 11:35:38 +00:00
Andreas Kling
e85c3c97fb LibWeb: Add mode flag to CSSStyleValue::to_string()
This will be used to differentiate between serialization for resolved
style (i.e window.getComputedStyle()) and serialization for all other
purposes.
2024-12-07 08:31:03 +00:00
Timothy Flynn
93712b24bf Everywhere: Hoist the Libraries folder to the top-level 2024-11-10 12:50:45 +01:00
Renamed from Userland/Libraries/LibWeb/CSS/StyleValues/BasicShapeStyleValue.cpp (Browse further)