mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-21 23:50:06 +00:00
LibWeb: Maintain easing keywords as KeywordStyleValue
until use-time
This excludes `step-end` and `step-start` which are expected to be converted to the equivalent function at parse time. We are expected to serialize these as the explicit keywords - previously we would parse as `EasingStyleValue` and serialize equivalent functions as the keywords. This caused issues as we would incorrectly serialize even explicit functions as the keyword. This also allows us to move the magic easing functions to `EasingFunction` rather than `EasingStyleValue` which is a bit tidier
This commit is contained in:
parent
755a576013
commit
03be70087d
Notes:
github-actions[bot]
2025-10-20 10:29:02 +00:00
Author: https://github.com/Calme1709
Commit: 03be70087d
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6459
Reviewed-by: https://github.com/AtkinsSJ ✅
15 changed files with 210 additions and 125 deletions
|
@ -2865,20 +2865,10 @@ RefPtr<StyleValue const> Parser::parse_easing_value(TokenStream<ComponentValue>&
|
|||
if (part.is(Token::Type::Ident)) {
|
||||
auto name = part.token().ident();
|
||||
auto maybe_simple_easing = [&] -> RefPtr<EasingStyleValue const> {
|
||||
if (name.equals_ignoring_ascii_case("linear"sv))
|
||||
return EasingStyleValue::create(EasingStyleValue::Linear::identity());
|
||||
if (name.equals_ignoring_ascii_case("ease"sv))
|
||||
return EasingStyleValue::create(EasingStyleValue::CubicBezier::ease());
|
||||
if (name.equals_ignoring_ascii_case("ease-in"sv))
|
||||
return EasingStyleValue::create(EasingStyleValue::CubicBezier::ease_in());
|
||||
if (name.equals_ignoring_ascii_case("ease-out"sv))
|
||||
return EasingStyleValue::create(EasingStyleValue::CubicBezier::ease_out());
|
||||
if (name.equals_ignoring_ascii_case("ease-in-out"sv))
|
||||
return EasingStyleValue::create(EasingStyleValue::CubicBezier::ease_in_out());
|
||||
if (name.equals_ignoring_ascii_case("step-start"sv))
|
||||
return EasingStyleValue::create(EasingStyleValue::Steps::step_start());
|
||||
return EasingStyleValue::create(EasingStyleValue::Steps { IntegerStyleValue::create(1), StepPosition::Start });
|
||||
if (name.equals_ignoring_ascii_case("step-end"sv))
|
||||
return EasingStyleValue::create(EasingStyleValue::Steps::step_end());
|
||||
return EasingStyleValue::create(EasingStyleValue::Steps { IntegerStyleValue::create(1), StepPosition::End });
|
||||
return {};
|
||||
}();
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue