Callum Law
778da0175e
LibWeb: Clamp and censor top-level calc results
...
We now clamp the values returned from calc into the allowed range (where
we know it) and censor any `NaN`s to `0` both when we resolve and when
we serialize.
Gains us 76 WPT passes.
2025-08-11 17:10:04 +01:00
Callum Law
9e1ace28a6
LibWeb: Import WPT tests related to handling non-finite values in calcs
2025-08-08 11:43:49 +01:00
Sam Atkins
5808eff1f4
LibWeb/CSS: Hyphenate request-url-modifier names
...
Corresponds to e1bf92d49a
Also update our imported WPT tests.
2025-08-07 13:38:25 +01:00
Callum Law
c3b1013018
LibWeb: Skip inverted non-canonical values when simplifying product node
...
This matches the logic with the non-inverted children.
Gains us 2 WPT tests.
2025-08-06 14:53:22 +01:00
Callum Law
15cee5cc15
LibWeb: Correctly round non-integer z-indexes
...
Previously we would just cast to an int.
Gains us 3 WPT tests.
2025-08-05 06:37:40 +01:00
Sam Atkins
5d1ba658c9
Tests: Import attr()-related WPT tests
2025-07-16 14:47:45 +01:00
Tim Ledbetter
c4cf1ccede
LibWeb: Don't crash when parsing ASF with non comma-separated arguments
2025-07-09 19:47:12 +01:00
Tim Ledbetter
78b6032940
LibWeb: Validate operator count when parsing a calculation
...
Previously, we would allow calc values such as `calc(min(1 2))`, which
would be simplified to `calc(3)` because we assumed that numbers not
separated by an operator represented a sum. We now validate that the
number of operators we see is as we would expect before collecting
these values into a sum node.
2025-07-02 10:12:58 +01:00
Callum Law
8e9753eadb
LibWeb: Correctly compute consistent type when simplifying hypot
...
Previously we would never get a valid `consistent_type` as we were
trying to make the node types consistent with the initial empty type
which isn't possible.
Gains us 7 WPT tests.
2025-06-30 14:53:04 +02:00
Tim Ledbetter
48f56cad08
LibWeb: Handle non-numeric font-weight values in keyframes
...
Previously, using `font-weight` with a keyword or `calc()` value inside
a keyframe rule would cause a crash.
2025-06-25 09:01:56 +02:00
Callum Law
536f8c395c
LibWeb: Set numeric type of asin, acos, atan calculation results
...
Previously we were omitting the numeric type which meant these functions
weren't valid in some cases e.g. within rotate() functions.
2025-06-25 05:19:07 +01:00
Tim Ledbetter
b46378085d
LibWeb: Absolutize keyframe values before interpolating
2025-06-24 12:36:47 +01:00
Tim Ledbetter
689dff3ee8
Tests: Synchronize imported tests with the WPT repository
2025-06-22 23:51:34 +02:00
Andreas Kling
f813c495ae
Tests: Import a WPT test for sin(), cos() and tan() serialization
2025-05-18 17:23:34 +02:00
Sam Atkins
09b508d8e8
Tests: Import some URL-related WPT tests
2025-05-03 23:22:40 +01:00
Andreas Kling
d8ea16d94e
LibWeb: Don't assume calc() simplification worked on invalid tree
...
Fixes #4469
2025-04-25 16:55:05 +02:00
Andreas Kling
0553bcb35b
LibWeb: Simplify standalone CSS math functions when used outside calc()
...
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
Math functions like abs(), clamp(), round(), etc, can be used by
themselves in property values, without wrapping them in calc().
Before this change, we were neglecting to run calc simplification on the
generated calculation node trees. By doing that manually after parsing a
standalone math function, we score at least a couple hundred WPT points.
2025-04-24 20:38:00 +02:00
Andreas Kling
1772adb600
LibWeb: Don't crash on non-finite values in CSS clamp() function
...
Stops a WPT test from crashing, giving us 29 new subtest passes. :^)
2025-04-24 18:26:54 +02:00
Sam Atkins
7b13ccabd4
Tests: Import some calc() serialization tests from WPT
2025-02-27 21:42:43 +01:00