Truly independent web browser
LibWeb: Space keyframes without offsets evenly between their neighbors
Tim Ledbetter11d93c38fff6
diff --git a/Libraries/LibWeb/Animations/KeyframeEffect.cpp b/Libraries/LibWeb/Animations/KeyframeEffect.cppindex d3eb107ed3e..391a1b0aa4d 100644--- a/Libraries/LibWeb/Animations/KeyframeEffect.cpp+++ b/Libraries/LibWeb/Animations/KeyframeEffect.cpp@@ -310,7 +310,7 @@ void compute_missing_keyframe_offsets(Vector<BaseKeyframe>& keyframes)auto index = static_cast<double>(keyframe_index - index_a);// 4. Set the computed keyframe offset of keyframe to offsetA + (offsetB − offsetA) × index / n.- keyframes[keyframe_index].computed_offset = (offset_a + (offset_b - offset_a)) * index / n;+ keyframes[keyframe_index].computed_offset = offset_a + (offset_b - offset_a) * index / n;}index_a = index_b;diff --git a/Tests/LibWeb/Text/expected/wpt-import/web-animations/interfaces/Animatable/animate.txt b/Tests/LibWeb/Text/expected/wpt-import/web-animations/interfaces/Animatable/animate.txtindex dc0d0010a44..758c1b3b3b6 100644--- a/Tests/LibWeb/Text/expected/wpt-import/web-animations/interfaces/Animatable/animate.txt+++ b/Tests/LibWeb/Text/expected/wpt-import/web-animations/interfaces/Animatable/animate.txt@@ -2,8 +2,8 @@ Harness status: OKFound 153 tests-141 Pass-12 Fail+144 Pass+9 FailPass Element.animate() creates an Animation objectPass Element.animate() creates an Animation object in the relevant realm of the target elementPass Element.animate() creates an Animation object with a KeyframeEffect@@ -26,7 +26,7 @@ Pass Element.animate() accepts a one property one non-array value property-indexPass Element.animate() accepts a one property two value property-indexed keyframes specification where the first value is invalidPass Element.animate() accepts a one property two value property-indexed keyframes specification where the second value is invalidPass Element.animate() accepts a property-indexed keyframes specification with a CSS variable as the property-Fail Element.animate() accepts a property-indexed keyframe with a single offset+Pass Element.animate() accepts a property-indexed keyframe with a single offsetPass Element.animate() accepts a property-indexed keyframe with an array of offsetsPass Element.animate() accepts a property-indexed keyframe with an array of offsets that is too shortPass Element.animate() accepts a property-indexed keyframe with an array of offsets that is too long@@ -68,9 +68,9 @@ Pass Element.animate() accepts a single keyframe sequence with omitted offsetFail Element.animate() accepts a single keyframe sequence with null offsetPass Element.animate() accepts a single keyframe sequence with string offsetFail Element.animate() accepts a single keyframe sequence with a single calc() offset-Fail Element.animate() accepts a one property keyframe sequence with some omitted offsets+Pass Element.animate() accepts a one property keyframe sequence with some omitted offsetsFail Element.animate() accepts a one property keyframe sequence with some null offsets-Fail Element.animate() accepts a two property keyframe sequence with some omitted offsets+Pass Element.animate() accepts a two property keyframe sequence with some omitted offsetsPass Element.animate() accepts a one property keyframe sequence with all omitted offsetsPass Element.animate() accepts a keyframe sequence with different easing values, but the same easing value for a given offsetPass Element.animate() accepts a keyframe sequence with different composite values, but the same composite value for a given offsetdiff --git a/Tests/LibWeb/Text/expected/wpt-import/web-animations/interfaces/KeyframeEffect/constructor.txt b/Tests/LibWeb/Text/expected/wpt-import/web-animations/interfaces/KeyframeEffect/constructor.txtindex 8d029a36dd1..724794903fe 100644--- a/Tests/LibWeb/Text/expected/wpt-import/web-animations/interfaces/KeyframeEffect/constructor.txt+++ b/Tests/LibWeb/Text/expected/wpt-import/web-animations/interfaces/KeyframeEffect/constructor.txt@@ -2,8 +2,8 @@ Harness status: OKFound 175 tests-121 Pass-54 Fail+124 Pass+51 FailPass A KeyframeEffect can be constructed with no framesPass easing values are parsed correctly when passed to the KeyframeEffect constructor in KeyframeEffectOptionsPass Invalid easing values are correctly rejected when passed to the KeyframeEffect constructor in KeyframeEffectOptions@@ -40,7 +40,7 @@ Pass A KeyframeEffect can be constructed with a one property two value property-Fail A KeyframeEffect constructed with a one property two value property-indexed keyframes specification where the second value is invalid roundtripsPass A KeyframeEffect can be constructed with a property-indexed keyframes specification with a CSS variable as the propertyFail A KeyframeEffect constructed with a property-indexed keyframes specification with a CSS variable as the property roundtrips-Fail A KeyframeEffect can be constructed with a property-indexed keyframe with a single offset+Pass A KeyframeEffect can be constructed with a property-indexed keyframe with a single offsetFail A KeyframeEffect constructed with a property-indexed keyframe with a single offset roundtripsPass A KeyframeEffect can be constructed with a property-indexed keyframe with an array of offsetsPass A KeyframeEffect constructed with a property-indexed keyframe with an array of offsets roundtrips@@ -124,11 +124,11 @@ Pass A KeyframeEffect can be constructed with a single keyframe sequence with stPass A KeyframeEffect constructed with a single keyframe sequence with string offset roundtripsFail A KeyframeEffect can be constructed with a single keyframe sequence with a single calc() offsetFail A KeyframeEffect constructed with a single keyframe sequence with a single calc() offset roundtrips-Fail A KeyframeEffect can be constructed with a one property keyframe sequence with some omitted offsets+Pass A KeyframeEffect can be constructed with a one property keyframe sequence with some omitted offsetsFail A KeyframeEffect constructed with a one property keyframe sequence with some omitted offsets roundtripsFail A KeyframeEffect can be constructed with a one property keyframe sequence with some null offsetsFail A KeyframeEffect constructed with a one property keyframe sequence with some null offsets roundtrips-Fail A KeyframeEffect can be constructed with a two property keyframe sequence with some omitted offsets+Pass A KeyframeEffect can be constructed with a two property keyframe sequence with some omitted offsetsFail A KeyframeEffect constructed with a two property keyframe sequence with some omitted offsets roundtripsPass A KeyframeEffect can be constructed with a one property keyframe sequence with all omitted offsetsFail A KeyframeEffect constructed with a one property keyframe sequence with all omitted offsets roundtripsdiff --git a/Tests/LibWeb/Text/expected/wpt-import/web-animations/interfaces/KeyframeEffect/setKeyframes.txt b/Tests/LibWeb/Text/expected/wpt-import/web-animations/interfaces/KeyframeEffect/setKeyframes.txtindex d9b4713defa..f7ee624cc3e 100644--- a/Tests/LibWeb/Text/expected/wpt-import/web-animations/interfaces/KeyframeEffect/setKeyframes.txt+++ b/Tests/LibWeb/Text/expected/wpt-import/web-animations/interfaces/KeyframeEffect/setKeyframes.txt@@ -2,8 +2,8 @@ Harness status: OKFound 80 tests-69 Pass-11 Fail+72 Pass+8 FailPass Keyframes can be replaced with an empty keyframePass Keyframes can be replaced with a one property two value property-indexed keyframes specificationPass Keyframes can be replaced with a one shorthand property two value property-indexed keyframes specification@@ -20,7 +20,7 @@ Pass Keyframes can be replaced with a one property one non-array value property-Pass Keyframes can be replaced with a one property two value property-indexed keyframes specification where the first value is invalidPass Keyframes can be replaced with a one property two value property-indexed keyframes specification where the second value is invalidPass Keyframes can be replaced with a property-indexed keyframes specification with a CSS variable as the property-Fail Keyframes can be replaced with a property-indexed keyframe with a single offset+Pass Keyframes can be replaced with a property-indexed keyframe with a single offsetPass Keyframes can be replaced with a property-indexed keyframe with an array of offsetsPass Keyframes can be replaced with a property-indexed keyframe with an array of offsets that is too shortPass Keyframes can be replaced with a property-indexed keyframe with an array of offsets that is too long@@ -62,9 +62,9 @@ Pass Keyframes can be replaced with a single keyframe sequence with omitted offsFail Keyframes can be replaced with a single keyframe sequence with null offsetPass Keyframes can be replaced with a single keyframe sequence with string offsetFail Keyframes can be replaced with a single keyframe sequence with a single calc() offset-Fail Keyframes can be replaced with a one property keyframe sequence with some omitted offsets+Pass Keyframes can be replaced with a one property keyframe sequence with some omitted offsetsFail Keyframes can be replaced with a one property keyframe sequence with some null offsets-Fail Keyframes can be replaced with a two property keyframe sequence with some omitted offsets+Pass Keyframes can be replaced with a two property keyframe sequence with some omitted offsetsPass Keyframes can be replaced with a one property keyframe sequence with all omitted offsetsPass Keyframes can be replaced with a keyframe sequence with different easing values, but the same easing value for a given offsetPass Keyframes can be replaced with a keyframe sequence with different composite values, but the same composite value for a given offset