haikuwebkit/LayoutTests/animations/fill-mode-iteration-count-n...

24 lines
1.1 KiB
Plaintext
Raw Permalink Normal View History

animation-iteration-count does not handle floating point values correctly. https://bugs.webkit.org/show_bug.cgi?id=69531 Source/WebCore: Implements support for non-integers animation-iteration-count numbers. Non-integer numbers will cause the animation to end part-way through a cycle. Reviewed by Dean Jackson. Tests: animations/fill-mode-iteration-count-non-integer.html animations/keyframes-iteration-count-non-integer.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSParser.cpp: (WebCore::CSSParser::parseAnimationIterationCount): * css/CSSStyleApplyProperty.cpp: (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty): * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::collectMatchingRulesForList): * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::fractionalTime): (WebCore::AnimationBase::progress): * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::pauseAnimationAtTime): * platform/animation/Animation.h: (WebCore::Animation::iterationCount): (WebCore::Animation::setIterationCount): (Animation): (WebCore::Animation::initialAnimationIterationCount): LayoutTests: Reviewed by Dean Jackson. * animations/fill-mode-iteration-count-non-integer-expected.txt: Added. * animations/fill-mode-iteration-count-non-integer.html: Added. * animations/keyframes-iteration-count-non-integer-expected.txt: Added. * animations/keyframes-iteration-count-non-integer.html: Added. Canonical link: https://commits.webkit.org/98165@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-03-13 19:06:56 +00:00
This test performs an animation of the left property with four different fill modes. It animates over 0.1 second with a 0.1 second delay. It takes snapshots at document load and the end of the animation.
None
Backwards
Forwards
Both
Both iterating
Safari mis-applies "animation-fill-mode: forwards" when using fractional iteration count https://bugs.webkit.org/show_bug.cgi?id=146996 Reviewed by Dean Jackson. Source/WebCore: animation-fill-mode: forwards with fractional iteration counts always snapped to 1 or 0, depending on direction. Fix to compute the fill-forward state from the correct keyframes. If filling forwards, AnimationBase::progress() sets the elapsed time to the duration, then uses fractionalTime() to handle animation direction mapping. If the fractionalTime is integral, we can return early, avoiding the cost of mapping through timing functions. Tested by existing tests. * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::progress): (WebCore::AnimationBase::getElapsedTime): * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): It was possible to end up with prevIndex == nextIndex with reverse animations, which resulted in divide-by-zero when computing scale. Fix by picking a nextIndex that is different from prevIndex. LayoutTests: Progressions, improved tests. * animations/animation-direction-reverse-fill-mode-expected.txt: New results; this is a progression. * animations/animation-direction-reverse-fill-mode.html: Use a shorter animation. Fixed results. * animations/fill-mode-iteration-count-non-integer-expected.txt: * animations/fill-mode-iteration-count-non-integer.html: Use iteration counts that are not multiplies of 0.5, so the test can differentiation between forward and backwards states. Add a non-linear timing function to check that fill-forwards consults the timing functions. Don't print exact succeeding results because they may have floating point values. * animations/fill-mode-reverse-expected.txt: New results; this is a progression. * animations/fill-mode-reverse.html: Fixed results, use gray. Canonical link: https://commits.webkit.org/165201@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-07-21 21:19:20 +00:00
Both reverse alternate
Ease function
animation-iteration-count does not handle floating point values correctly. https://bugs.webkit.org/show_bug.cgi?id=69531 Source/WebCore: Implements support for non-integers animation-iteration-count numbers. Non-integer numbers will cause the animation to end part-way through a cycle. Reviewed by Dean Jackson. Tests: animations/fill-mode-iteration-count-non-integer.html animations/keyframes-iteration-count-non-integer.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSParser.cpp: (WebCore::CSSParser::parseAnimationIterationCount): * css/CSSStyleApplyProperty.cpp: (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty): * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::collectMatchingRulesForList): * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::fractionalTime): (WebCore::AnimationBase::progress): * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::pauseAnimationAtTime): * platform/animation/Animation.h: (WebCore::Animation::iterationCount): (WebCore::Animation::setIterationCount): (Animation): (WebCore::Animation::initialAnimationIterationCount): LayoutTests: Reviewed by Dean Jackson. * animations/fill-mode-iteration-count-non-integer-expected.txt: Added. * animations/fill-mode-iteration-count-non-integer.html: Added. * animations/keyframes-iteration-count-non-integer-expected.txt: Added. * animations/keyframes-iteration-count-non-integer.html: Added. Canonical link: https://commits.webkit.org/98165@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-03-13 19:06:56 +00:00
PASS - start of animation - id: a expected: 100 actual: 100
PASS - start of animation - id: b expected: 200 actual: 200
PASS - start of animation - id: c expected: 100 actual: 100
PASS - start of animation - id: d expected: 200 actual: 200
PASS - start of animation - id: e expected: 200 actual: 200
Safari mis-applies "animation-fill-mode: forwards" when using fractional iteration count https://bugs.webkit.org/show_bug.cgi?id=146996 Reviewed by Dean Jackson. Source/WebCore: animation-fill-mode: forwards with fractional iteration counts always snapped to 1 or 0, depending on direction. Fix to compute the fill-forward state from the correct keyframes. If filling forwards, AnimationBase::progress() sets the elapsed time to the duration, then uses fractionalTime() to handle animation direction mapping. If the fractionalTime is integral, we can return early, avoiding the cost of mapping through timing functions. Tested by existing tests. * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::progress): (WebCore::AnimationBase::getElapsedTime): * page/animation/KeyframeAnimation.cpp: (WebCore::KeyframeAnimation::fetchIntervalEndpointsForProperty): It was possible to end up with prevIndex == nextIndex with reverse animations, which resulted in divide-by-zero when computing scale. Fix by picking a nextIndex that is different from prevIndex. LayoutTests: Progressions, improved tests. * animations/animation-direction-reverse-fill-mode-expected.txt: New results; this is a progression. * animations/animation-direction-reverse-fill-mode.html: Use a shorter animation. Fixed results. * animations/fill-mode-iteration-count-non-integer-expected.txt: * animations/fill-mode-iteration-count-non-integer.html: Use iteration counts that are not multiplies of 0.5, so the test can differentiation between forward and backwards states. Add a non-linear timing function to check that fill-forwards consults the timing functions. Don't print exact succeeding results because they may have floating point values. * animations/fill-mode-reverse-expected.txt: New results; this is a progression. * animations/fill-mode-reverse.html: Fixed results, use gray. Canonical link: https://commits.webkit.org/165201@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@187121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2015-07-21 21:19:20 +00:00
PASS - start of animation - id: f expected: 300 actual: 300
PASS - start of animation - id: g expected: 300 actual: 300
PASS - end of animation - id: a close to expected: 100
PASS - end of animation - id: b close to expected: 100
PASS - end of animation - id: c close to expected: 225
PASS - end of animation - id: d close to expected: 225
PASS - end of animation - id: e close to expected: 225
PASS - end of animation - id: f close to expected: 275
PASS - end of animation - id: g close to expected: 291
animation-iteration-count does not handle floating point values correctly. https://bugs.webkit.org/show_bug.cgi?id=69531 Source/WebCore: Implements support for non-integers animation-iteration-count numbers. Non-integer numbers will cause the animation to end part-way through a cycle. Reviewed by Dean Jackson. Tests: animations/fill-mode-iteration-count-non-integer.html animations/keyframes-iteration-count-non-integer.html * css/CSSComputedStyleDeclaration.cpp: (WebCore::CSSComputedStyleDeclaration::getPropertyCSSValue): * css/CSSParser.cpp: (WebCore::CSSParser::parseAnimationIterationCount): * css/CSSStyleApplyProperty.cpp: (WebCore::CSSStyleApplyProperty::CSSStyleApplyProperty): * css/CSSStyleSelector.cpp: (WebCore::CSSStyleSelector::collectMatchingRulesForList): * page/animation/AnimationBase.cpp: (WebCore::AnimationBase::fractionalTime): (WebCore::AnimationBase::progress): * page/animation/CompositeAnimation.cpp: (WebCore::CompositeAnimation::pauseAnimationAtTime): * platform/animation/Animation.h: (WebCore::Animation::iterationCount): (WebCore::Animation::setIterationCount): (Animation): (WebCore::Animation::initialAnimationIterationCount): LayoutTests: Reviewed by Dean Jackson. * animations/fill-mode-iteration-count-non-integer-expected.txt: Added. * animations/fill-mode-iteration-count-non-integer.html: Added. * animations/keyframes-iteration-count-non-integer-expected.txt: Added. * animations/keyframes-iteration-count-non-integer.html: Added. Canonical link: https://commits.webkit.org/98165@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@110588 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-03-13 19:06:56 +00:00