Callum Law
2f83356c0f
LibWeb: Support calc within linear() easing function
2025-10-20 11:27:44 +01:00
Callum Law
91925db9ca
LibWeb: Don't canonicalize linear easing function points until use time
...
Canonicalization can require information that is only known after
compute time (i.e. resolved relative lengths within calcs).
This also allows us to get rid of the `had_explicit_input` flag and just
rely on whether Optional has a value
2025-10-20 11:27:44 +01:00
Callum Law
95e26819d9
LibWeb: Separate use time easing functions from EasingStyleValue
...
In the future there will be different methods of creating these use-time
easing functions (e.g. from `KeywordStyleValue`s)
2025-10-20 11:27:44 +01:00
Callum Law
0e30de82cc
LibWeb: Implement <step-position> as an enum
...
This simplifies parsing and serialization by using the generated
functions
2025-10-20 11:27:44 +01:00
Luke Wilde
eeb5446c1b
LibWeb: Avoid including Navigable.h in headers
...
This greatly reduces how much is recompiled when changing Navigable.h,
from >1000 to 82.
2025-10-20 10:16:55 +01:00
Andreas Kling
dfa796a4e4
LibJS+LibWeb: Use GC::Weak instead of AK::WeakPtr for GC-allocated types
...
This makes some common types like JS::Object smaller (by 8 bytes) and
yields a minor speed improvement on many benchmarks.
2025-10-17 17:22:16 +02:00
Tim Ledbetter
e55060ef6e
LibWeb: Support the display-p3-linear color space in color functions
2025-10-15 18:40:48 +02:00
Sam Atkins
0afa93e639
LibWeb/CSS: Add a Property -> CalculationContext factory method
...
We have this code duplicated in multiple places, and we'll want to
handle registered custom properties too at some point, so wrap it in a
reusable `CalculationContext::for_property()` method.
Noticed while doing this that ValueParsingContext will eventually need
to take a PropertyNameAndID, not a PropertyID, so I've added a FIXME.
2025-10-13 09:59:38 +01:00
Callum Law
102edf638d
LibWeb: Support interpolation of SuperellipseStyleValue
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
2025-10-09 10:23:20 +01:00
Callum Law
20a2e8ab12
LibWeb: Store corner-*-shape properties in computed form
2025-10-09 10:23:20 +01:00
Callum Law
814efa9809
LibWeb: Parse corner-*-shape physical longhands
2025-10-09 10:23:20 +01:00
Callum Law
e772a992be
LibWeb: Store CursorStyleValue sub-values directly
...
Storing these within NumberOrCalculated is unnecessary
2025-10-07 10:50:01 +01:00
Callum Law
25192d3c20
LibWeb: Store BorderRadiusStyleValue sub-values directly
...
Storing these within LengthPercentage is unnecessary
2025-10-07 10:50:01 +01:00
Callum Law
2ebf446cbf
LibWeb: Store BackgroundSizeStyleValue sub-values directly
...
Storing these within LengthPercentage is unnecessary
2025-10-07 10:50:01 +01:00
Callum Law
4a998879d5
LibWeb: Add absolutized method for TransformStyleValue
2025-10-07 10:50:01 +01:00
Callum Law
e675b95f51
LibWeb: Add absolutized method to OpenTypeTaggedStyleValue
2025-10-07 10:50:01 +01:00
Callum Law
2c7b56511b
LibWeb: Add absolutized method to CounterDefinitionsStyleValue
...
This avoids a crash when a counter value relies on relative units
2025-10-07 10:50:01 +01:00
Callum Law
52192a308b
LibWeb: Update absolutize to take a ComputationContext struct
...
This struct will in the future hold information other than a length
resolution context (e.g. context for tree counting functions) and a
single struct is easier to work with than multiple parameters.
2025-10-07 10:50:01 +01:00
Callum Law
28c12324c2
LibWeb: Remove unused NumericCalculationNode::to_style_value
2025-10-07 10:50:01 +01:00
Sam Atkins
2de4fe8104
LibWeb/CSS: Store StyleValue pointer instead of string on CSSStyleValue
...
When setting style to a CSSStyleValue we need to convert it to a
StyleValue. If we already have one, we might as well use it avoid the
work of serialization and re-parsing.
I realised I misunderstood what "constructed from a USVString" means, so
I've adjusted based on that. It does raise a question on what the source
USVString is if that string resulted in multiple CSSStyleValues being
created - see the linked issue.
2025-10-04 22:57:00 +02:00
Sam Atkins
a30afafcc9
LibWeb/CSS: Use FlyString for CSSStyleValue property name
2025-10-02 13:46:04 +01:00
Tim Ledbetter
bf1564388d
LibWeb: Serialize grid-template shorthand correctly
2025-09-28 17:34:58 +02:00
Sam Atkins
aa8bf6372f
LibWeb/CSS: Inline EasingStyleValue::CubicBezier::operator==()
...
For whatever reason, this method in particular ends up failing to link
into WebContent with a subsequent change. It's small and simple, so
just inline it.
2025-09-26 22:31:07 +02: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
Tim Ledbetter
d42235a642
LibWeb: Use move() for grid track placement values where possible
2025-09-25 10:34:45 +01:00
Sam Atkins
4acde45d5e
LibWeb/CSS: Remove now-unused non-spec calc() resolution code
...
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
We're now fully using the simplification algorithm to produce calc
results.
2025-09-24 16:33:53 +01:00
Sam Atkins
0314606c73
LibWeb/CSS: Replace resolve_length_deprecated() with resolve_length()
2025-09-24 16:33:53 +01:00
Sam Atkins
995b7eb7b4
LibWeb/CSS: Replace resolve_percentage_deprecated() with undeprecated
2025-09-24 16:33:53 +01:00
Sam Atkins
0dba531772
LibWeb/CSS: Replace resolve_number_deprecated() with resolve_number()
2025-09-24 16:33:53 +01:00
Sam Atkins
d9a386fa81
LibWeb/CSS: Replace resolve_integer_deprecated() with resolve_integer()
2025-09-24 16:33:53 +01:00
Sam Atkins
0ff012d3f3
LibWeb/CSS: Replace resolve_time_deprecated() with resolve_time()
2025-09-24 16:33:53 +01:00
Sam Atkins
7428a8eb40
LibWeb/CSS: Replace resolve_resolution_deprecated() with undeprecated
2025-09-24 16:33:53 +01:00
Sam Atkins
7f237b3e62
LibWeb/CSS: Replace resolve_frequency_deprecated() with undeprecated
2025-09-24 16:33:53 +01:00
Sam Atkins
cd29111b36
LibWeb/CSS: Replace resolve_flex_deprecated() with resolve_flex()
2025-09-24 16:33:53 +01:00
Sam Atkins
375e32c523
LibWeb/CSS: Replace resolve_angle_deprecated() with resolve_angle()
...
Gets us some WPT passes. 🎉
2025-09-24 16:33:53 +01:00
Sam Atkins
b24b00fb7d
LibWeb/CSS: Reify CSSTransformValues
...
We have a slightly odd setup here. TransformationStyleValue reifies as a
single CSSTransformComponent. It's StyleValueList that actually reifies
as a CSSTransformValue - but only if it only contains
TransformationStyleValues.
+79 WPT subtests.
2025-09-24 12:27:05 +01:00
Callum Law
517e3f5f1d
LibWeb: Serialize animation according to spec
...
We now:
- Serialize longhands in the correct order
- Support serializing multiple values
- Include default longhands where required (to distinguish
animation-name from that longhand).
2025-09-24 11:58:20 +01:00
Callum Law
2ff1ae6155
LibWeb: Escape serialized custom idents
2025-09-24 11:58:20 +01:00
Tim Ledbetter
23380a563a
LibWeb: Include custom-ident type in specification of grid properties
...
CI / macOS, arm64, Sanitizer, Clang (push) Waiting to run
CI / Linux, x86_64, Fuzzers, Clang (push) Waiting to run
CI / Linux, x86_64, Sanitizer, GNU (push) Waiting to run
CI / Linux, x86_64, Sanitizer, Clang (push) Waiting to run
Package the js repl as a binary artifact / Linux, arm64 (push) Waiting to run
Package the js repl as a binary artifact / macOS, arm64 (push) Waiting to run
Package the js repl as a binary artifact / Linux, x86_64 (push) Waiting to run
Run test262 and test-wasm / run_and_update_results (push) Waiting to run
Lint Code / lint (push) Waiting to run
Label PRs with merge conflicts / auto-labeler (push) Waiting to run
Push notes / build (push) Waiting to run
Previously, serialization of `grid-column-*` and `grid-row-*`
properties containing a custom-ident would fail.
2025-09-24 02:25:26 +02:00
Tim Ledbetter
4def0b9dc4
LibWeb: Serialize grid-area according to specification
2025-09-24 02:25:26 +02:00
Callum Law
10793aef56
LibWeb: Move to_font_slope from StyleValue to FontStyleStyleValue
...
This method only operated on `FontStyleStyleValue`s anyway so this is a
better place to have it
2025-09-19 10:06:33 +01:00
Callum Law
425b7de44a
LibWeb: Use compute_font_width for font-width descriptor
...
This allows us to remove `StyleValue::to_font_width`
2025-09-19 10:06:33 +01:00
Callum Law
073d10c6d1
LibWeb: Clamp dimension percentage values to the specified percentage
...
Previously we would clamp the percentage value to the allowed range for
canonical dimension values rather than the percentage value.
Also fixes an issue where we would clamp pure percentages (i.e.
percentages that don't have a hint) against the allowed values for the
first dimension we checked (i.e. angle)
2025-09-19 10:06:33 +01:00
Callum Law
b52525b454
LibWeb: Convert font-width percentages to keywords when serializing font
2025-09-19 10:06:33 +01:00
Callum Law
45a4e9cd0f
LibWeb: Use compute_font_weight for font-weight descriptor
...
This allows us to remove `StyleValue::to_font_weight`
2025-09-19 10:06:33 +01:00
Callum Law
1ca511b627
LibWeb: Correctly resolve percentages against relative lengths in calcs
...
Previously we would always assume the percentage was 100%
2025-09-19 10:06:33 +01:00
Callum Law
c3a78d2884
LibWeb: Don't include spread distance when serializing text-shadow
...
We shouldn't include spread distance when serializing `text-shadow` as
it is not supported unlike `box-shadow` - to achieve this we store
whether this is a text or box shadow within the ShadowStyleValue and
serialize appropriately.
2025-09-18 15:21:22 +01:00
Callum Law
1ac7b47764
LibWeb: Disallow spread distance value when parsing text-shadow
...
`text-shadow` does not support setting a value for spread distance
unlike `box-shadow`.
2025-09-18 15:21:22 +01:00
Callum Law
b0e3af7d10
LibWeb: Parse text-underline-position property
...
This introduces the `TextUnderlinePositionStyleValue` class, it is
possible to represent `text-underline-position` as a `StyleValueList`
but would have required ugly workarounds for either serialization or in
`ComputedProperties::text_underline_position`
2025-09-15 15:24:20 +01:00
Sam Atkins
5904694844
LibWeb/CSS: Implement CSSImageValue and reify images as it
...
This is specced to be opaque, so there's not much to it.
2025-09-15 08:47:10 +01:00