LibWeb: Implement compositing of font-variation-settings values
Some checks are pending
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

This commit is contained in:
Tim Ledbetter 2025-09-19 16:58:13 +01:00 committed by Sam Atkins
commit b64cb89b9d
Notes: github-actions[bot] 2025-09-26 10:22:03 +00:00
3 changed files with 147 additions and 0 deletions

View file

@ -1812,6 +1812,16 @@ RefPtr<StyleValue const> composite_value(StyleValue const& underlying_value, Sty
auto result = composite_raw_values(underlying_value.as_number().number(), animated_value.as_number().number());
return NumberStyleValue::create(result);
}
case StyleValue::Type::OpenTypeTagged: {
auto& underlying_open_type_tagged = underlying_value.as_open_type_tagged();
auto& animated_open_type_tagged = animated_value.as_open_type_tagged();
if (underlying_open_type_tagged.tag() != animated_open_type_tagged.tag())
return {};
auto composited_value = composite_value(underlying_open_type_tagged.value(), animated_open_type_tagged.value(), composite_operation);
if (!composited_value)
return {};
return OpenTypeTaggedStyleValue::create(OpenTypeTaggedStyleValue::Mode::FontVariationSettings, underlying_open_type_tagged.tag(), composited_value.release_nonnull());
}
case StyleValue::Type::Percentage: {
auto result = composite_raw_values(underlying_value.as_percentage().percentage().value(), animated_value.as_percentage().percentage().value());
return PercentageStyleValue::create(Percentage { result });