diff --git a/Libraries/LibWeb/CSS/Parser/Parser.cpp b/Libraries/LibWeb/CSS/Parser/Parser.cpp index 8504f3b0e26..5d8ff1db63e 100644 --- a/Libraries/LibWeb/CSS/Parser/Parser.cpp +++ b/Libraries/LibWeb/CSS/Parser/Parser.cpp @@ -6506,13 +6506,13 @@ RefPtr Parser::parse_easing_value(TokenStream& to } // Perform extra validation - // https://drafts.csswg.org/css-easing/#funcdef-step-easing-function-steps - // The first parameter specifies the number of intervals in the function. It must be a positive integer greater than 0 - // unless the second parameter is jump-none in which case it must be a positive integer greater than 1. + // https://drafts.csswg.org/css-easing/#step-easing-functions + // If the is jump-none, the must be at least 2, or the function is invalid. + // Otherwise, the must be at least 1, or the function is invalid. if (steps.position == EasingStyleValue::Steps::Position::JumpNone) { - if (intervals < 1) + if (intervals <= 1) return nullptr; - } else if (intervals < 0) { + } else if (intervals <= 0) { return nullptr; } diff --git a/Tests/LibWeb/Text/expected/WebAnimations/misc/parse-animation-timing-function-steps.txt b/Tests/LibWeb/Text/expected/WebAnimations/misc/parse-animation-timing-function-steps.txt new file mode 100644 index 00000000000..1fcb88ad23f --- /dev/null +++ b/Tests/LibWeb/Text/expected/WebAnimations/misc/parse-animation-timing-function-steps.txt @@ -0,0 +1 @@ +Computed animation-timing-function: ease diff --git a/Tests/LibWeb/Text/input/WebAnimations/misc/parse-animation-timing-function-steps.html b/Tests/LibWeb/Text/input/WebAnimations/misc/parse-animation-timing-function-steps.html new file mode 100644 index 00000000000..59a48576a61 --- /dev/null +++ b/Tests/LibWeb/Text/input/WebAnimations/misc/parse-animation-timing-function-steps.html @@ -0,0 +1,27 @@ + + +
+ + \ No newline at end of file