Commit graph

18 commits

Author SHA1 Message Date
Tim Ledbetter
0d7f2b8cba LibWeb: Avoid String allocations in BasicShape serialization methods 2026-01-09 10:00:58 +01:00
Tim Ledbetter
a27d269721 LibWeb: Pass StringBuilder around during StyleValue serialization
Previously, some StyleValues created a large number of intermediate
strings during serialization. Passing a StringBUilder into the
serialization function allows us to avoid a large number of these
unnecessary allocations.
2026-01-09 10:00:58 +01: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
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
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
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
Sam Atkins
c57975c9fd LibWeb: Move and rename CSSStyleValue to StyleValues/StyleValue.{h,cpp}
This reverts 0e3487b9ab.

Back when I made that change, I thought we could make our StyleValue
classes match the typed-om definitions directly. However, they have
different requirements. Typed-om types need to be mutable and GCed,
whereas StyleValues are immutable and ideally wouldn't require a JS VM.

While I was already making such a cataclysmic change, I've moved it into
the StyleValues directory, because it *not* being there has bothered me
for a long time. 😅
2025-08-08 15:19:03 +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
Andrew Kaster
6d11414957 LibWeb: Make storage of CSS::StyleValues const-correct
Now we consistently use `RefPtr<StyleValue const>` for all StyleValues.
2025-04-16 10:41:44 -06: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.h (Browse further)