LibWeb: Improve support for CalculatedStyleValue in translate

- Omit calcs that are resolved to `0px` from the serialized value
- Allow CSV to be the 'Z' component in interpolated value.
- Allow calcs with mixed percentages in the first two arguments.

To achieve the third item above the concept of a "special" value parsing
context has been added - this will also be useful for instance for
different arguments of color functions having different contexts.

Gains us 23 WPT tests
This commit is contained in:
Callum Law 2025-07-31 23:22:32 +12:00 committed by Sam Atkins
commit 39fdcbc526
Notes: github-actions[bot] 2025-08-08 08:46:24 +00:00
10 changed files with 57 additions and 43 deletions

View file

@ -1685,7 +1685,7 @@ bool Parser::context_allows_quirky_length() const
[top_level_property](FunctionContext const& function_context) {
return function_context.name == "rect"sv && top_level_property == PropertyID::Clip;
},
[](DescriptorContext const&) { return false; });
[](auto const&) { return false; });
}
return unitless_length_allowed;