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

155 lines
4.8 KiB
HTML
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
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Test simple animation with fill modes and non integer iteration count</title>
<style type="text/css" media="screen">
.box {
position: relative;
left: 100px;
top: 10px;
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
height: 25px;
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
width: 100px;
-webkit-animation-delay: 0.1s;
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
-webkit-animation-duration: 2s;
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
-webkit-animation-timing-function: linear;
-webkit-animation-name: anim;
}
@-webkit-keyframes anim {
from { left: 200px; }
to { left: 300px; }
}
#a {
background-color: blue;
-webkit-animation-fill-mode: none;
-webkit-animation-iteration-count: 1.5;
}
#b {
background-color: red;
-webkit-animation-fill-mode: backwards;
-webkit-animation-iteration-count: 0.5;
}
#c {
background-color: green;
-webkit-animation-fill-mode: forwards;
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
-webkit-animation-iteration-count: 1.25;
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
}
#d {
background-color: yellow;
-webkit-animation-fill-mode: both;
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
-webkit-animation-iteration-count: 1.25;
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
}
#e {
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
background-color: gray;
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
-webkit-animation-fill-mode: both;
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
-webkit-animation-iteration-count: 2.25;
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
-webkit-animation-direction: alternate;
}
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
#f {
background-color: silver;
-webkit-animation-fill-mode: both;
-webkit-animation-iteration-count: 2.25;
-webkit-animation-direction: alternate-reverse;
}
#g {
background-color: orange;
-webkit-animation-fill-mode: both;
-webkit-animation-iteration-count: 2.25;
-webkit-animation-timing-function: ease-out;
-webkit-animation-direction: alternate-reverse;
}
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
</style>
<script type="text/javascript" charset="utf-8">
const numAnims = 5;
var animsFinished = 0;
const allowance = 5;
const expectedValues = [
{id: "a", start: 100, end: 100},
{id: "b", start: 200, end: 100},
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
{id: "c", start: 100, end: 225},
{id: "d", start: 200, end: 225},
{id: "e", start: 200, end: 225},
{id: "f", start: 300, end: 275},
{id: "g", start: 300, end: 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
];
var result = "";
Use testRunner instead of layoutTestController in animations tests https://bugs.webkit.org/show_bug.cgi?id=88757 Reviewed by Tony Chang. * animations/3d/change-transform-in-end-event.html: * animations/3d/replace-filling-transform.html: * animations/3d/state-at-end-event-transform.html: * animations/3d/transform-origin-vs-functions.html: * animations/animation-add-events-in-handler.html: * animations/animation-border-overflow.html: * animations/animation-controller-drt-api.html: * animations/animation-direction-reverse-fill-mode-hardware.html: * animations/animation-direction-reverse-fill-mode.html: * animations/animation-drt-api-multiple-keyframes.html: * animations/animation-drt-api.html: * animations/animation-end-event-destroy-renderer.html: * animations/animation-end-event-short-iterations.html: * animations/animation-hit-test-transform.html: * animations/animation-hit-test.html: * animations/animation-iteration-event-destroy-renderer.html: * animations/animation-matrix-negative-scale-unmatrix.html: * animations/animation-on-inline-crash.html: * animations/animation-shorthand-overriding.html: * animations/animation-shorthand-removed.html: * animations/animation-shorthand.html: * animations/animation-start-event-destroy-renderer.html: * animations/animation-welcome-safari.html: * animations/body-removal-crash.html: * animations/change-keyframes-name.html: * animations/change-transform-style-during-animation.html: * animations/combo-transform-translate+scale.html: * animations/empty-keyframes.html: * animations/fill-mode-forwards.html: * animations/fill-mode-iteration-count-non-integer.html: * animations/fill-mode-missing-from-to-keyframes.html: * animations/fill-mode-multiple-keyframes.html: * animations/fill-mode-removed.html: * animations/fill-mode-reverse.html: * animations/fill-mode-transform.html: * animations/fill-mode.html: * animations/fill-unset-properties.html: * animations/font-size-using-ems.html-disabled: * animations/import-crash.html: * animations/keyframe-timing-functions-transform.html: * animations/keyframe-timing-functions2.html: * animations/keyframes-iteration-count-non-integer.html: * animations/longhand-timing-function.html: * animations/missing-from-to-transforms.html: * animations/missing-from-to.html: * animations/pause-crash.html: * animations/resources/animation-test-helpers.js: (checkExpectedValue): (endTest): * animations/state-at-end-event.html: * animations/suspend-resume-animation-events.html: * animations/suspend-transform-animation.html: * animations/transition-and-animation-3.html: * animations/unanimated-style.html: Canonical link: https://commits.webkit.org/106621@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-06-11 17:22:07 +00:00
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
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
}
function animationEnded(event) {
if (++animsFinished == numAnims) {
setTimeout(endTest, 0); // this set timeout should be ok in the test environment
// since we're just giving style a chance to resolve
}
};
function endTest() {
for (var i=0; i < expectedValues.length; i++) {
var el = document.getElementById(expectedValues[i].id);
var expectedValue = expectedValues[i].end;
var realValue = window.getComputedStyle(el).getPropertyCSSValue("left").getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
if (Math.abs(expectedValue - realValue) < allowance) {
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
result += "PASS - end of animation - id: " + expectedValues[i].id + " close to expected: " + expectedValue + "<br>";
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
} else {
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
result += "FAIL - end of animation - id: " + expectedValues[i].id + " expected: " + expectedValue + " actual: " + realValue + "<br>";
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
}
}
document.getElementById('result').innerHTML = result;
Use testRunner instead of layoutTestController in animations tests https://bugs.webkit.org/show_bug.cgi?id=88757 Reviewed by Tony Chang. * animations/3d/change-transform-in-end-event.html: * animations/3d/replace-filling-transform.html: * animations/3d/state-at-end-event-transform.html: * animations/3d/transform-origin-vs-functions.html: * animations/animation-add-events-in-handler.html: * animations/animation-border-overflow.html: * animations/animation-controller-drt-api.html: * animations/animation-direction-reverse-fill-mode-hardware.html: * animations/animation-direction-reverse-fill-mode.html: * animations/animation-drt-api-multiple-keyframes.html: * animations/animation-drt-api.html: * animations/animation-end-event-destroy-renderer.html: * animations/animation-end-event-short-iterations.html: * animations/animation-hit-test-transform.html: * animations/animation-hit-test.html: * animations/animation-iteration-event-destroy-renderer.html: * animations/animation-matrix-negative-scale-unmatrix.html: * animations/animation-on-inline-crash.html: * animations/animation-shorthand-overriding.html: * animations/animation-shorthand-removed.html: * animations/animation-shorthand.html: * animations/animation-start-event-destroy-renderer.html: * animations/animation-welcome-safari.html: * animations/body-removal-crash.html: * animations/change-keyframes-name.html: * animations/change-transform-style-during-animation.html: * animations/combo-transform-translate+scale.html: * animations/empty-keyframes.html: * animations/fill-mode-forwards.html: * animations/fill-mode-iteration-count-non-integer.html: * animations/fill-mode-missing-from-to-keyframes.html: * animations/fill-mode-multiple-keyframes.html: * animations/fill-mode-removed.html: * animations/fill-mode-reverse.html: * animations/fill-mode-transform.html: * animations/fill-mode.html: * animations/fill-unset-properties.html: * animations/font-size-using-ems.html-disabled: * animations/import-crash.html: * animations/keyframe-timing-functions-transform.html: * animations/keyframe-timing-functions2.html: * animations/keyframes-iteration-count-non-integer.html: * animations/longhand-timing-function.html: * animations/missing-from-to-transforms.html: * animations/missing-from-to.html: * animations/pause-crash.html: * animations/resources/animation-test-helpers.js: (checkExpectedValue): (endTest): * animations/state-at-end-event.html: * animations/suspend-resume-animation-events.html: * animations/suspend-transform-animation.html: * animations/transition-and-animation-3.html: * animations/unanimated-style.html: Canonical link: https://commits.webkit.org/106621@main git-svn-id: https://svn.webkit.org/repository/webkit/trunk@119985 268f45cc-cd09-0410-ab3c-d52691b4dbfc
2012-06-11 17:22:07 +00:00
if (window.testRunner)
testRunner.notifyDone();
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
}
window.onload = function () {
for (var i=0; i < expectedValues.length; i++) {
var el = document.getElementById(expectedValues[i].id);
var expectedValue = expectedValues[i].start;
var realValue = window.getComputedStyle(el).getPropertyCSSValue("left").getFloatValue(CSSPrimitiveValue.CSS_NUMBER);
if (Math.abs(expectedValue - realValue) < allowance) {
result += "PASS";
} else {
result += "FAIL";
}
result += " - start of animation - id: " + expectedValues[i].id + " expected: " + expectedValue + " actual: " + realValue + "<br>";
}
document.addEventListener("webkitAnimationEnd", animationEnded, false);
};
</script>
</head>
<body>
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.
<div id="a" class="box">
None
</div>
<div id="b" class="box">
Backwards
</div>
<div id="c" class="box">
Forwards
</div>
<div id="d" class="box">
Both
</div>
<div id="e" class="box">
Both iterating
</div>
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
<div id="f" class="box">
Both reverse alternate
</div>
<div id="g" class="box">
Ease function
</div>
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
<div id="result">
</div>
</body>
</html>