Tim Ledbetter
ca9364983c
LibWeb/CSS: Support interpolating filter
and backdrop-filter
values
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-07-30 23:29:07 +02:00
Tim Ledbetter
62e52163d6
LibWeb: Interpolate text-shadow
values as a shadow list
...
This is the same behavior as is currently used for `box-shadow`.
2025-07-30 10:51:50 +02:00
Tim Ledbetter
3ae48776fd
LibWeb: Round integral values to the nearest integer when interpolating
...
Previously, color components were being incorrectly rounded when
interpolating.
2025-07-30 10:51:50 +02:00
Arran Ireland
423e944a92
LibGfx+LibWeb: Upgrade to multi-arg subscript operator in Matrix
...
See the following for more details:
https://en.cppreference.com/w/cpp/language/operators.html#Array_subscript_operator
2025-07-28 09:15:23 +02:00
ayeteadoe
77d9508618
LibWeb/CSS: Fix implicit narrowing cast in interpolate_rotate
...
The changes introduced in 484a09d6a2
broke the Windows LibWeb build, so this fixes that
2025-07-22 13:21:17 -06:00
Tim Ledbetter
484a09d6a2
LibWeb: Support interpolating rotate
values
2025-07-22 11:09:45 +01:00
Tim Ledbetter
cf33dec6d6
LibWeb: Extract SLERP algorithm into its own method
...
No functional changes.
2025-07-22 11:09:45 +01:00
Callum Law
6a9c8d7767
LibWeb: Don't resolve colors with unresolved components
...
`CSSColorValue`s which have unresolved `calc` components should be able
to be resolved. Previously we would always resolve them but with
incorrect values.
This is useful as we will now be able to now whether we should serialize
colors in their normalized form or not.
Slight regression in that we now serialize (RGB, HSL and HWB) colors
with components that rely on compute-time information as an empty
string, but that will be fixed in the next commit.
2025-07-16 13:05:33 +01:00
Gingeh
1b7323fc2d
LibWeb: Interpolate legacy colors in sRGB
2025-07-04 15:28:08 +01:00
Callum Law
9ab7c5d08d
LibWeb: Support relative lengths in calc
color values
...
Gains us ~40 WPT tests.
2025-07-04 13:18:55 +01:00
Callum Law
62d138ebf7
LibWeb: Allow passing a resolution context to CSSStyleValue::to_color
...
This will be used for resolving any calculated style values within the
various `CSSColorValue` sub-classes.
No functionality changes.
2025-07-04 13:18:55 +01:00
Tim Ledbetter
b46378085d
LibWeb: Absolutize keyframe values before interpolating
2025-06-24 12:36:47 +01:00
Sam Atkins
1435480d76
LibWeb/CSS: Add fixme for sRGB color interpolation
...
Corresponds to a0a9886063
2025-06-17 12:38:27 +01:00
Tim Ledbetter
a3f6e71e33
LibWeb/CSS: Disallow third argument in 2D scale functions
2025-06-15 15:59:02 +02:00
Tim Ledbetter
17f14a277b
LibWeb: Don't crash when interpolating single-value repeatable lists
...
Previously, when interpolating a repeatable list from a list with
multiple values to a single value, we would crash.
2025-06-02 11:33:01 +01:00
Tim Ledbetter
b16f34767e
LibWeb: Ensure discrete interpolated properties are non-transitionable
...
CI / Lagom (arm64, Sanitizer_CI, false, macOS, macos-15, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, Linux, blacksmith-16vcpu-ubuntu-2404, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, Linux, blacksmith-16vcpu-ubuntu-2404, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, Linux, blacksmith-16vcpu-ubuntu-2404, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macOS, macOS-universal2, macos-15) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, Linux, Linux-x86_64, blacksmith-8vcpu-ubuntu-2404) (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
If a property is uses discrete interpolation and TransitionBehavior is
not set to `AllowDiscrete` that property should be non-transitionable.
This is now true for properties whose animation type is not discrete,
but the animation type falls back to discrete.
2025-05-27 13:33:29 +02:00
Tim Ledbetter
09f4d90594
LibWeb: Clamp interpolated values to the range of their numeric type
...
This fixes a UBSAN warning that we previously hit when interpolating
color values.
2025-05-19 11:31:47 +01: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
Sam Atkins
4edafb35cd
LibWeb/CSS: Use PendingSubstitutionValue for unresolved shorthands
...
Previously, we would just assign the UnresolvedStyleValue to each
longhand, which was completely wrong but happened to work if it was a
ShorthandStyleValue (because that's basically a list of "set property X
to Y", and doesn't care which property it's the value of).
For example, the included `var-in-margin-shorthand.html` test would:
1. Set `margin-top` to `var(--a) 10px`
2. Resolve it to `margin-top: 5px 10px`
3. Reject that as invalid
What now happens is:
1. Set `margin-top` to a PendingSubstitutionValue
2. Resolve `margin` to `5px 10px`
3. Expand that out into its longhands
4. `margin-top` is `5px` 🎉
In order to support this, `for_each_property_expanding_shorthands()` now
runs the callback for the shorthand too if it's an unresolved or
pending-substitution value. This is so that we can store those in the
CascadedProperties until they can be resolved - otherwise, by the time
we want to resolve them, we don't have them any more.
`cascade_declarations()` has an unfortunate hack: it tracks, for each
declaration, which properties have already been given values, so that
it can avoid overwriting an actual value with a pending one. This is
necessary because of the unfortunate way that CSSStyleProperties holds
expanded longhands, and not just the original declarations. The spec
disagrees with itself about this, but we do need to do that expansion
for `element.style` to work correctly. This HashTable is unfortunate
but it does solve the problem until a better solution can be found.
2025-05-14 11:46:47 +01:00
Tim Ledbetter
03e34db9f8
LibWeb: Interpolate the content-visibility
property correctly
2025-05-13 11:24:05 +01:00
Tim Ledbetter
882ad4726e
LibWeb: Interpolate the visibility
property correctly
2025-05-13 11:24:05 +01:00
Tim Ledbetter
23009779e1
LibWeb: Interpolate font-style
values correctly
...
These are interpolated by computed value, except a value of `normal` is
treated as `oblique 0deg`.
2025-05-03 12:05:22 +02:00
Tim Ledbetter
542c3cbe51
LibWeb: Implement the transition-behavior
CSS property
...
This specifies whether transitions should be started for transitions
whose animation behavior is discrete.
2025-05-02 11:07:19 +01:00
Tim Ledbetter
c72d5943e6
LibWeb: Support interpolating translate
values
2025-04-30 19:36:56 +02:00
Tim Ledbetter
f854f644a7
LibWeb: Don't crash when interpolating non <number>
scale values
2025-04-28 11:46:34 +02:00
Andreas Kling
cf704cfbfc
LibWeb: Implement interpolation for CSS scale
values
...
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, 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
And let's handle the 3rd (Z) scale parameter as well, while we're here.
At least 242 new passes on WPT.
2025-04-25 14:08:12 +02:00
Tim Ledbetter
04d7228c51
LibWeb: Implement interpolation of repeatable lists
2025-04-23 09:13:45 +01:00
Tim Ledbetter
0beb22f19e
LibWeb: Implement interpolation of edge values
2025-04-23 09:13:45 +01:00
Andrew Kaster
d1f6f5649e
LibWeb: Make storage of CSS::CalculationNodes const-correct
...
Now we consistently use `RefPtr<CalculationNode const>` for all
CalculationNodes.
2025-04-16 10:41:44 -06: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
Tim Ledbetter
f07a3fe6da
LibWeb: Use discrete interpolation for degenerate ratios
...
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (arm64, macos-15, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (x86_64, ubuntu-24.04, Linux, 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
Degenerate ratios cannot be interpolated.
2025-04-11 11:38:05 +01:00
Tim Ledbetter
b3980d40f7
LibWeb: Round to the nearest integer when interpolating integer values
2025-04-11 11:31:54 +01:00
Gingeh
31853c13d3
LibWeb: Implement css gradient-interpolation-method
2025-03-06 11:33:12 +00:00
InvalidUsernameException
f7276bfab3
LibWeb: Reduced number of recompiled files for CSS property headers
...
CI / Lagom (x86_64, Sanitizer_CI, false, ubuntu-24.04, Linux, GNU) (push) Waiting to run
CI / Lagom (arm64, Sanitizer_CI, false, macos-15, macOS, Clang) (push) Waiting to run
CI / Lagom (x86_64, Fuzzers_CI, false, ubuntu-24.04, Linux, Clang) (push) Waiting to run
CI / Lagom (x86_64, Sanitizer_CI, true, ubuntu-24.04, Linux, Clang) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (macos-14, macOS, macOS-universal2) (push) Waiting to run
Package the js repl as a binary artifact / build-and-package (ubuntu-24.04, Linux, 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
This reduces the number of `.cpp` files that need to be recompiled when
one of the below header files changes as follows:
CSS/ComputedProperties.h: 1113 -> 49
CSS/ComputedValues.h: 1120 -> 209
2025-02-23 10:14:39 -05:00
Sam Atkins
c3d61020e7
LibWeb/CSS: Make CalculationNodes ref-counted
...
Calc simplification (which I'm working towards) involves repeatedly
deriving a new calculation tree from an existing one, and in many
cases, either the whole result or a portion of it will be identical to
that of the original. Using RefPtr lets us avoid making unnecessary
copies. As a bonus it will also make it easier to return either `this`
or a new node.
In future we could also cache commonly-used nodes, similar to how we do
so for 1px and 0px LengthStyleValues and various keywords.
2025-01-30 19:31:54 +01:00
Sam Atkins
ac15e626dd
LibWeb/CSS: Merge ScaleStyleValue into TransformationStyleValue
...
The only ways this varies from the `scale()` function is with parsing
and serialization. Parsing stays separate, and serialization is done by
telling `TransformationStyleValue` which property it is, and overriding
its normal `to_string()` code for properties other than `transform`.
2025-01-17 10:12:39 +01:00
Sam Atkins
18e0ff6537
LibWeb/CSS: Properly classify calculations inside transform functions
...
Assuming all calculations produce `<length-percentage>` is a very bad
assumption, and was causing crashes on https://ai.cloudflare.com/
2025-01-15 14:29:08 +00:00
Sam Atkins
4efdb76857
LibWeb/CSS: Give calc() a CalculationContext for resolving percentages
...
This is passed in at construction, meaning we will be able to refer to
it later, when we're no longer inside the Parser.
2025-01-13 10:59:16 +00:00
Sam Atkins
69a0f28d04
Revert "LibWeb/CSS: Rename CalculatedStyleValue -> CSSMathValue"
...
This reverts commit 76daba3069
.
We're going to need separate types for the JS-exposed style values, so
it doesn't make sense for us to match their names with our internal
types.
2024-12-21 18:14:28 +01:00
Sam Atkins
ee9db99961
LibWeb: Remove unused Realm arg from StyleComputer::get_inherit_value()
...
We no longer need this now that property_initial_value() doesn't take a
Realm.
2024-12-05 19:59:57 +01:00
Sam Atkins
2c3c821305
LibWeb: Remove Realm parameter from property_initial_value()
...
We don't need the Realm to parse a style value.
Fixes #2720
2024-12-05 19:59:57 +01:00
Glenn Skrzypczak
0d15cc4672
LibWeb/Animation: Fall back to discrete animation in more cases
...
Use discrete animation when the number of components or the types
of corresponding components do not match. This commit does not cover
all cases, but adds FIXME comments in the appropriate places.
2024-11-25 18:10:24 +01:00
Timothy Flynn
93712b24bf
Everywhere: Hoist the Libraries folder to the top-level
2024-11-10 12:50:45 +01:00