Changeset 55576 in webkit
- Timestamp:
- Mar 5, 2010 4:58:54 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 6 added
- 25 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r55574 r55576 1 2010-03-05 Dean Jackson <dino@apple.com> 2 3 Reviewed by Simon Fraser and Chris Marrin. 4 5 Bug 26869: Add fill modes for CSS Animations 6 https://bugs.webkit.org/show_bug.cgi?id=26869 7 8 Add tests for -webkit-animation-fill-mode property, 9 and update existing computed style tests with the 10 new property. 11 12 * animations/computed-style-expected.txt: 13 * animations/computed-style.html: 14 * animations/fill-mode-expected.txt: Added. 15 * animations/fill-mode-removed-expected.txt: Added. 16 * animations/fill-mode-removed.html: Added. 17 * animations/fill-mode-transform-expected.txt: Added. 18 * animations/fill-mode-transform.html: Added. 19 * animations/fill-mode.html: Added. 20 * animations/fill-unset-properties-expected.txt: 21 * animations/fill-unset-properties.html: 22 * fast/css/getComputedStyle/computed-style-expected.txt: 23 * fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: 24 * platform/mac/fast/css/getComputedStyle/computed-style-expected.txt: 25 * platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt: 26 * svg/css/getComputedStyle-basic-expected.txt: 27 1 28 2010-03-05 Fumitoshi Ukai <ukai@chromium.org> 2 29 -
trunk/LayoutTests/animations/computed-style-expected.txt
r40667 r55576 8 8 PASS test1Style.webkitAnimationDuration is '10s' 9 9 PASS test2Style.webkitAnimationDuration is '5s, 2.5s' 10 PASS test1Style.webkitAnimationFillMode is 'backwards' 11 PASS test2Style.webkitAnimationFillMode is 'forwards, both' 10 12 PASS test1Style.webkitAnimationIterationCount is '10' 11 13 PASS test2Style.webkitAnimationIterationCount is '10, infinite' -
trunk/LayoutTests/animations/computed-style.html
r40667 r55576 10 10 -webkit-animation-name: anim1; 11 11 -webkit-animation-duration: 10s; 12 -webkit-animation-fill-mode: backwards; 12 13 -webkit-animation-iteration-count: 10; 13 14 -webkit-animation-timing-function: linear; … … 21 22 -webkit-animation-name: anim2, anim3; 22 23 -webkit-animation-duration: 5s, 2500ms; 24 -webkit-animation-fill-mode: forwards, both; 23 25 -webkit-animation-iteration-count: 10, infinite; 24 26 -webkit-animation-timing-function: linear, ease-in-out; … … 61 63 shouldBe("test2Style.webkitAnimationDuration", "'5s, 2.5s'"); 62 64 65 shouldBe("test1Style.webkitAnimationFillMode", "'backwards'"); 66 shouldBe("test2Style.webkitAnimationFillMode", "'forwards, both'"); 67 63 68 shouldBe("test1Style.webkitAnimationIterationCount", "'10'"); 64 69 shouldBe("test2Style.webkitAnimationIterationCount", "'10, infinite'"); -
trunk/LayoutTests/animations/fill-unset-properties-expected.txt
r38776 r55576 6 6 Testing webkitAnimationDuration: PASS 7 7 Testing webkitAnimationDelay: PASS 8 Testing webkitAnimationFillMode: PASS 8 9 -
trunk/LayoutTests/animations/fill-unset-properties.html
r38776 r55576 14 14 -webkit-animation-duration: 10s, 20s; 15 15 -webkit-animation-delay: 1s; 16 -webkit-animation-fill-mode: forwards, backwards; 16 17 } 17 18 @-webkit-keyframes a { } … … 33 34 { 'property': 'webkitAnimationDuration', 'value': '10s, 20s, 10s, 20s, 10s' }, 34 35 { 'property': 'webkitAnimationDelay', 'value': '1s, 1s, 1s, 1s, 1s' }, 36 { 'property': 'webkitAnimationFillMode', 'value': 'forwards, backwards, forwards, backwards, forwards' }, 35 37 ]; 36 38 -
trunk/LayoutTests/fast/css/getComputedStyle/computed-style-expected.txt
r46287 r55576 87 87 -webkit-animation-direction: normal; 88 88 -webkit-animation-duration: 0s; 89 -webkit-animation-fill-mode: none; 89 90 -webkit-animation-iteration-count: 1; 90 91 -webkit-animation-name: none; -
trunk/LayoutTests/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
r46287 r55576 86 86 -webkit-animation-direction: normal 87 87 -webkit-animation-duration: 0s 88 -webkit-animation-fill-mode: none 88 89 -webkit-animation-iteration-count: 1 89 90 -webkit-animation-name: none -
trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-expected.txt
r53157 r55576 97 97 -webkit-animation-direction: normal; 98 98 -webkit-animation-duration: 0s; 99 -webkit-animation-fill-mode: none; 99 100 -webkit-animation-iteration-count: 1; 100 101 -webkit-animation-name: none; -
trunk/LayoutTests/platform/mac/fast/css/getComputedStyle/computed-style-without-renderer-expected.txt
r53157 r55576 96 96 -webkit-animation-direction: normal 97 97 -webkit-animation-duration: 0s 98 -webkit-animation-fill-mode: none 98 99 -webkit-animation-iteration-count: 1 99 100 -webkit-animation-name: none -
trunk/LayoutTests/svg/css/getComputedStyle-basic-expected.txt
r53157 r55576 191 191 rect: style.getPropertyValue(-webkit-animation-duration) : 0s 192 192 rect: style.getPropertyCSSValue(-webkit-animation-duration) : [object CSSValueList] 193 rect: style.getPropertyValue(-webkit-animation-fill-mode) : none 194 rect: style.getPropertyCSSValue(-webkit-animation-fill-mode) : [object CSSValueList] 193 195 rect: style.getPropertyValue(-webkit-animation-iteration-count) : 1 194 196 rect: style.getPropertyCSSValue(-webkit-animation-iteration-count) : [object CSSValueList] … … 605 607 g: style.getPropertyValue(-webkit-animation-duration) : 0s 606 608 g: style.getPropertyCSSValue(-webkit-animation-duration) : [object CSSValueList] 609 g: style.getPropertyValue(-webkit-animation-fill-mode) : none 610 g: style.getPropertyCSSValue(-webkit-animation-fill-mode) : [object CSSValueList] 607 611 g: style.getPropertyValue(-webkit-animation-iteration-count) : 1 608 612 g: style.getPropertyCSSValue(-webkit-animation-iteration-count) : [object CSSValueList] -
trunk/WebCore/ChangeLog
r55575 r55576 1 2010-03-05 Dean Jackson <dino@apple.com> 2 3 Reviewed by Simon Fraser and Chris Marrin. 4 5 Bug 26869: Add fill modes for CSS Animations 6 https://bugs.webkit.org/show_bug.cgi?id=26869 7 8 Tests: animations/fill-mode-removed.html 9 animations/fill-mode-transform.html 10 animations/fill-mode.html 11 12 * css/CSSComputedStyleDeclaration.cpp: 13 * css/CSSParser.cpp: 14 * css/CSSParser.h: 15 * css/CSSPropertyNames.in: 16 * css/CSSStyleSelector.cpp: 17 * css/CSSStyleSelector.h: 18 * css/CSSValueKeywords.in: 19 - parse, assign and retrieve the value of the new 20 -webkit-animation-fill-mode property 21 * page/animation/AnimationBase.cpp: 22 * page/animation/AnimationBase.h: 23 - new state in animation engine for a finished animation 24 that is "filling" forwards in time. This allows the 25 engine to keep the animation around and not revert to the 26 old style. 27 - update the timer code to indicate it doesn't need to 28 keep animating if it is filling 29 - now that animations can extend beyond their elapsed time, 30 make sure progress works correctly with iteration counts 31 * page/animation/KeyframeAnimation.cpp: 32 (WebCore::KeyframeAnimation::animate): 33 - ensure correct style value is returned at the right 34 time by checking for fill mode 35 (WebCore::KeyframeAnimation::onAnimationEnd): 36 - continue to send the end event, but only remove the 37 animation if it isn't filling forwards 38 * platform/animation/Animation.cpp: 39 * platform/animation/Animation.h: 40 - new fill mode member property 41 * platform/animation/AnimationList.cpp: 42 - ensure the fill mode is propagated to a list of style valus 43 * platform/graphics/mac/GraphicsLayerCA.mm: 44 - make hardware layers use Core Animation's fill mode 45 1 46 2010-03-05 Ilya Tikhonovsky <loislo@chromium.org> 2 47 -
trunk/WebCore/css/CSSComputedStyleDeclaration.cpp
r53450 r55576 147 147 CSSPropertyWebkitAnimationDirection, 148 148 CSSPropertyWebkitAnimationDuration, 149 CSSPropertyWebkitAnimationFillMode, 149 150 CSSPropertyWebkitAnimationIterationCount, 150 151 CSSPropertyWebkitAnimationName, … … 1199 1200 case CSSPropertyWebkitAnimationDuration: 1200 1201 return getDurationValue(style->animations()); 1202 case CSSPropertyWebkitAnimationFillMode: { 1203 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); 1204 const AnimationList* t = style->animations(); 1205 if (t) { 1206 for (size_t i = 0; i < t->size(); ++i) { 1207 switch (t->animation(i)->fillMode()) { 1208 case Animation::AnimationFillModeNone: 1209 list->append(CSSPrimitiveValue::createIdentifier(CSSValueNone)); 1210 break; 1211 case Animation::AnimationFillModeForwards: 1212 list->append(CSSPrimitiveValue::createIdentifier(CSSValueForwards)); 1213 break; 1214 case Animation::AnimationFillModeBackwards: 1215 list->append(CSSPrimitiveValue::createIdentifier(CSSValueBackwards)); 1216 break; 1217 case Animation::AnimationFillModeBoth: 1218 list->append(CSSPrimitiveValue::createIdentifier(CSSValueBoth)); 1219 break; 1220 } 1221 } 1222 } else 1223 list->append(CSSPrimitiveValue::createIdentifier(CSSValueNone)); 1224 return list.release(); 1225 } 1201 1226 case CSSPropertyWebkitAnimationIterationCount: { 1202 1227 RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated(); -
trunk/WebCore/css/CSSParser.cpp
r55308 r55576 1394 1394 case CSSPropertyWebkitAnimationDirection: 1395 1395 case CSSPropertyWebkitAnimationDuration: 1396 case CSSPropertyWebkitAnimationFillMode: 1396 1397 case CSSPropertyWebkitAnimationName: 1397 1398 case CSSPropertyWebkitAnimationPlayState: … … 2572 2573 } 2573 2574 2575 PassRefPtr<CSSValue> CSSParser::parseAnimationFillMode() 2576 { 2577 CSSParserValue* value = m_valueList->current(); 2578 if (value->id == CSSValueNone || value->id == CSSValueForwards || value->id == CSSValueBackwards || value->id == CSSValueBoth) 2579 return CSSPrimitiveValue::createIdentifier(value->id); 2580 return 0; 2581 } 2582 2574 2583 PassRefPtr<CSSValue> CSSParser::parseAnimationIterationCount() 2575 2584 { … … 2711 2720 case CSSPropertyWebkitTransitionDuration: 2712 2721 currValue = parseAnimationDuration(); 2722 if (currValue) 2723 m_valueList->next(); 2724 break; 2725 case CSSPropertyWebkitAnimationFillMode: 2726 currValue = parseAnimationFillMode(); 2713 2727 if (currValue) 2714 2728 m_valueList->next(); -
trunk/WebCore/css/CSSParser.h
r52784 r55576 96 96 PassRefPtr<CSSValue> parseAnimationDirection(); 97 97 PassRefPtr<CSSValue> parseAnimationDuration(); 98 PassRefPtr<CSSValue> parseAnimationFillMode(); 98 99 PassRefPtr<CSSValue> parseAnimationIterationCount(); 99 100 PassRefPtr<CSSValue> parseAnimationName(); -
trunk/WebCore/css/CSSPropertyNames.in
r50760 r55576 152 152 -webkit-animation-direction 153 153 -webkit-animation-duration 154 -webkit-animation-fill-mode 154 155 -webkit-animation-iteration-count 155 156 -webkit-animation-name -
trunk/WebCore/css/CSSStyleSelector.cpp
r55359 r55576 5292 5292 HANDLE_ANIMATION_VALUE(duration, Duration, value) 5293 5293 return; 5294 case CSSPropertyWebkitAnimationFillMode: 5295 HANDLE_ANIMATION_VALUE(fillMode, FillMode, value) 5296 return; 5294 5297 case CSSPropertyWebkitAnimationIterationCount: 5295 5298 HANDLE_ANIMATION_VALUE(iterationCount, IterationCount, value) … … 5649 5652 else if (primitiveValue->primitiveType() == CSSPrimitiveValue::CSS_MS) 5650 5653 animation->setDuration(primitiveValue->getFloatValue()/1000.0f); 5654 } 5655 5656 void CSSStyleSelector::mapAnimationFillMode(Animation* layer, CSSValue* value) 5657 { 5658 if (value->cssValueType() == CSSValue::CSS_INITIAL) { 5659 layer->setFillMode(Animation::initialAnimationFillMode()); 5660 return; 5661 } 5662 5663 CSSPrimitiveValue* primitiveValue = static_cast<CSSPrimitiveValue*>(value); 5664 switch (primitiveValue->getIdent()) { 5665 case CSSValueNone: 5666 layer->setFillMode(Animation::AnimationFillModeNone); 5667 break; 5668 case CSSValueForwards: 5669 layer->setFillMode(Animation::AnimationFillModeForwards); 5670 break; 5671 case CSSValueBackwards: 5672 layer->setFillMode(Animation::AnimationFillModeBackwards); 5673 break; 5674 case CSSValueBoth: 5675 layer->setFillMode(Animation::AnimationFillModeBoth); 5676 break; 5677 } 5651 5678 } 5652 5679 -
trunk/WebCore/css/CSSStyleSelector.h
r54834 r55576 236 236 void mapAnimationDirection(Animation*, CSSValue*); 237 237 void mapAnimationDuration(Animation*, CSSValue*); 238 void mapAnimationFillMode(Animation*, CSSValue*); 238 239 void mapAnimationIterationCount(Animation*, CSSValue*); 239 240 void mapAnimationName(Animation*, CSSValue*); -
trunk/WebCore/css/CSSValueKeywords.in
r54472 r55576 640 640 641 641 # 642 # CSS_PROP__WEBKIT_ANIMATION_FILL_MODE 643 # 644 # forwards 645 # backwards 646 # both 647 648 # 642 649 # CSS_PROP__WEBKIT_ANIMATION_ITERATION_COUNT 643 650 # -
trunk/WebCore/page/animation/AnimationBase.cpp
r54106 r55576 919 919 switch (m_animState) { 920 920 case AnimationStateNew: 921 ASSERT(input == AnimationStateInputStartAnimation || input == AnimationStateInputPlayStateRunn ning || input == AnimationStateInputPlayStatePaused);922 if (input == AnimationStateInputStartAnimation || input == AnimationStateInputPlayStateRunn ning) {921 ASSERT(input == AnimationStateInputStartAnimation || input == AnimationStateInputPlayStateRunning || input == AnimationStateInputPlayStatePaused); 922 if (input == AnimationStateInputStartAnimation || input == AnimationStateInputPlayStateRunning) { 923 923 m_requestedStartTime = beginAnimationUpdateTime(); 924 924 m_animState = AnimationStateStartWaitTimer; … … 1022 1022 1023 1023 if (input == AnimationStateInputEndTimerFired) { 1024 1024 1025 ASSERT(param >= 0); 1025 1026 // End timer fired, finish up … … 1029 1030 1030 1031 if (m_object) { 1031 resumeOverriddenAnimations(); 1032 if (m_animation->fillsForwards()) 1033 m_animState = AnimationStateFillingForwards; 1034 else 1035 resumeOverriddenAnimations(); 1032 1036 1033 1037 // Fire off another style change so we can set the final value … … 1043 1047 break; 1044 1048 case AnimationStatePausedWaitTimer: 1045 ASSERT(input == AnimationStateInputPlayStateRunn ning);1049 ASSERT(input == AnimationStateInputPlayStateRunning); 1046 1050 ASSERT(paused()); 1047 1051 // Update the times … … 1059 1063 // When the AnimationStateInputStartTimeSet comes in and we were in AnimationStatePausedRun, we will notice 1060 1064 // that we have already set the startTime and will ignore it. 1061 ASSERT(input == AnimationStateInputPlayStateRunn ning || input == AnimationStateInputStartTimeSet);1065 ASSERT(input == AnimationStateInputPlayStateRunning || input == AnimationStateInputStartTimeSet); 1062 1066 ASSERT(paused()); 1063 1067 … … 1094 1098 } 1095 1099 break; 1100 case AnimationStateFillingForwards: 1096 1101 case AnimationStateDone: 1097 1102 // We're done. Stay in this state until we are deleted … … 1153 1158 { 1154 1159 if (paused() == run || isNew()) 1155 updateStateMachine(run ? AnimationStateInputPlayStateRunn ning : AnimationStateInputPlayStatePaused, -1);1160 updateStateMachine(run ? AnimationStateInputPlayStateRunning : AnimationStateInputPlayStatePaused, -1); 1156 1161 } 1157 1162 … … 1160 1165 // Returns the time at which next service is required. -1 means no service is required. 0 means 1161 1166 // service is required now, and > 0 means service is required that many seconds in the future. 1162 if (paused() || isNew() )1167 if (paused() || isNew() || m_animState == AnimationStateFillingForwards) 1163 1168 return -1; 1164 1169 … … 1185 1190 dur *= m_animation->iterationCount(); 1186 1191 1187 if (postActive() || !m_animation->duration() || (m_animation->iterationCount() > 0 && elapsedTime >= dur))1192 if (postActive() || !m_animation->duration()) 1188 1193 return 1.0; 1194 if (m_animation->iterationCount() > 0 && elapsedTime >= dur) 1195 return (m_animation->iterationCount() % 2) ? 1.0 : 0.0; 1189 1196 1190 1197 // Compute the fractional time, taking into account direction. -
trunk/WebCore/page/animation/AnimationBase.h
r52017 r55576 72 72 AnimationStatePausedWaitResponse, // animation paused when in STARTING state 73 73 AnimationStatePausedRun, // animation paused when in LOOPING or ENDING state 74 AnimationStateDone // end timer fired, animation finished and removed 74 AnimationStateDone, // end timer fired, animation finished and removed 75 AnimationStateFillingForwards // animation has ended and is retaining its final value 75 76 }; 76 77 … … 86 87 AnimationStateInputPauseOverride, // pause an animation due to override 87 88 AnimationStateInputResumeOverride, // resume an overridden animation 88 AnimationStateInputPlayStateRunn ning,// play state paused -> running89 AnimationStateInputPlayStateRunning, // play state paused -> running 89 90 AnimationStateInputPlayStatePaused, // play state running -> paused 90 91 AnimationStateInputEndAnimation // force an end from any state -
trunk/WebCore/page/animation/KeyframeAnimation.cpp
r52618 r55576 121 121 122 122 // If we are waiting for the start timer, we don't want to change the style yet. 123 // Special case - if the delay time is 0, then we do want to set the first frame of the123 // Special case 1 - if the delay time is 0, then we do want to set the first frame of the 124 124 // animation right away. This avoids a flash when the animation starts. 125 if (waitingToStart() && m_animation->delay() > 0) 125 // Special case 2 - if there is a backwards fill mode, then we want to continue 126 // through to the style blend so that we get the fromStyle. 127 if (waitingToStart() && m_animation->delay() > 0 && !m_animation->fillsBackwards()) 126 128 return; 127 129 … … 261 263 { 262 264 sendAnimationEvent(eventNames().webkitAnimationEndEvent, elapsedTime); 263 endAnimation(); 265 // End the animation if we don't fill forwards. Forward filling 266 // animations are ended properly in the class destructor. 267 if (!m_animation->fillsForwards()) 268 endAnimation(); 264 269 } 265 270 -
trunk/WebCore/platform/animation/Animation.cpp
r40923 r55576 33 33 , m_timingFunction(initialAnimationTimingFunction()) 34 34 , m_direction(initialAnimationDirection()) 35 , m_fillMode(initialAnimationFillMode()) 35 36 , m_playState(initialAnimationPlayState()) 36 37 , m_delaySet(false) 37 38 , m_directionSet(false) 38 39 , m_durationSet(false) 40 , m_fillModeSet(false) 39 41 , m_iterationCountSet(false) 40 42 , m_nameSet(false) … … 55 57 , m_timingFunction(o.m_timingFunction) 56 58 , m_direction(o.m_direction) 59 , m_fillMode(o.m_fillMode) 57 60 , m_playState(o.m_playState) 58 61 , m_delaySet(o.m_delaySet) 59 62 , m_directionSet(o.m_directionSet) 60 63 , m_durationSet(o.m_durationSet) 64 , m_fillModeSet(o.m_fillModeSet) 61 65 , m_iterationCountSet(o.m_iterationCountSet) 62 66 , m_nameSet(o.m_nameSet) … … 77 81 m_timingFunction = o.m_timingFunction; 78 82 m_direction = o.m_direction; 83 m_fillMode = o.m_fillMode; 79 84 m_playState = o.m_playState; 80 85 … … 82 87 m_directionSet = o.m_directionSet; 83 88 m_durationSet = o.m_durationSet; 89 m_fillModeSet = o.m_fillModeSet; 84 90 m_iterationCountSet = o.m_iterationCountSet; 85 91 m_nameSet = o.m_nameSet; … … 108 114 m_timingFunction == o->m_timingFunction && 109 115 m_direction == o->m_direction && 116 m_fillMode == o->m_fillMode && 110 117 m_delaySet == o->m_delaySet && 111 118 m_directionSet == o->m_directionSet && 112 119 m_durationSet == o->m_durationSet && 120 m_fillModeSet == o->m_fillModeSet && 113 121 m_iterationCountSet == o->m_iterationCountSet && 114 122 m_nameSet == o->m_nameSet && -
trunk/WebCore/platform/animation/Animation.h
r46547 r55576 45 45 bool isDirectionSet() const { return m_directionSet; } 46 46 bool isDurationSet() const { return m_durationSet; } 47 bool isFillModeSet() const { return m_fillModeSet; } 47 48 bool isIterationCountSet() const { return m_iterationCountSet; } 48 49 bool isNameSet() const { return m_nameSet; } … … 59 60 bool isEmpty() const 60 61 { 61 return (!m_directionSet && !m_durationSet && !m_nameSet && !m_playStateSet && 62 !m_iterationCountSet && !m_delaySet && !m_timingFunctionSet && !m_propertySet); 62 return (!m_directionSet && !m_durationSet && !m_fillModeSet 63 && !m_nameSet && !m_playStateSet && !m_iterationCountSet 64 && !m_delaySet && !m_timingFunctionSet && !m_propertySet); 63 65 } 64 66 … … 71 73 void clearDirection() { m_directionSet = false; } 72 74 void clearDuration() { m_durationSet = false; } 75 void clearFillMode() { m_fillModeSet = false; } 73 76 void clearIterationCount() { m_iterationCountSet = false; } 74 77 void clearName() { m_nameSet = false; } … … 81 84 enum AnimationDirection { AnimationDirectionNormal, AnimationDirectionAlternate }; 82 85 AnimationDirection direction() const { return m_direction; } 86 87 enum AnimationFillMode { AnimationFillModeNone, AnimationFillModeForwards, AnimationFillModeBackwards, AnimationFillModeBoth }; 88 AnimationFillMode fillMode() const { return m_fillMode; } 83 89 84 90 double duration() const { return m_duration; } … … 94 100 void setDirection(AnimationDirection d) { m_direction = d; m_directionSet = true; } 95 101 void setDuration(double d) { ASSERT(d >= 0); m_duration = d; m_durationSet = true; } 102 void setFillMode(AnimationFillMode f) { m_fillMode = f; m_fillModeSet = true; } 96 103 void setIterationCount(int c) { m_iterationCount = c; m_iterationCountSet = true; } 97 104 void setName(const String& n) { m_name = n; m_nameSet = true; } … … 111 118 bool operator!=(const Animation& o) const { return !(*this == o); } 112 119 120 bool fillsBackwards() const { return m_fillModeSet && (m_fillMode == AnimationFillModeBackwards || m_fillMode == AnimationFillModeBoth); } 121 bool fillsForwards() const { return m_fillModeSet && (m_fillMode == AnimationFillModeForwards || m_fillMode == AnimationFillModeBoth); } 122 113 123 private: 114 124 Animation(); … … 122 132 TimingFunction m_timingFunction; 123 133 AnimationDirection m_direction : 1; 134 AnimationFillMode m_fillMode : 2; 124 135 125 136 unsigned m_playState : 2; … … 128 139 bool m_directionSet : 1; 129 140 bool m_durationSet : 1; 141 bool m_fillModeSet : 1; 130 142 bool m_iterationCountSet : 1; 131 143 bool m_nameSet : 1; … … 140 152 static AnimationDirection initialAnimationDirection() { return AnimationDirectionNormal; } 141 153 static double initialAnimationDuration() { return 0; } 154 static AnimationFillMode initialAnimationFillMode() { return AnimationFillModeNone; } 142 155 static int initialAnimationIterationCount() { return 1; } 143 156 static String initialAnimationName() { return String("none"); } -
trunk/WebCore/platform/animation/AnimationList.cpp
r39382 r55576 38 38 FILL_UNSET_PROPERTY(isDirectionSet, direction, setDirection); 39 39 FILL_UNSET_PROPERTY(isDurationSet, duration, setDuration); 40 FILL_UNSET_PROPERTY(isFillModeSet, fillMode, setFillMode); 40 41 FILL_UNSET_PROPERTY(isIterationCountSet, iterationCount, setIterationCount); 41 42 FILL_UNSET_PROPERTY(isPlayStateSet, playState, setPlayState); -
trunk/WebCore/platform/graphics/mac/GraphicsLayerCA.mm
r55412 r55576 1860 1860 repeatCount /= 2; 1861 1861 1862 NSString* fillMode = 0; 1863 switch (anim->fillMode()) { 1864 case Animation::AnimationFillModeNone: 1865 fillMode = kCAFillModeRemoved; 1866 break; 1867 case Animation::AnimationFillModeBackwards: 1868 fillMode = kCAFillModeBackwards; 1869 break; 1870 case Animation::AnimationFillModeForwards: 1871 fillMode = kCAFillModeForwards; 1872 break; 1873 case Animation::AnimationFillModeBoth: 1874 fillMode = kCAFillModeBoth; 1875 break; 1876 } 1877 1862 1878 [propertyAnim setDuration:duration]; 1863 1879 [propertyAnim setRepeatCount:repeatCount]; … … 1865 1881 [propertyAnim setRemovedOnCompletion:NO]; 1866 1882 [propertyAnim setAdditive:additive]; 1867 [propertyAnim setFillMode: @"extended"];1883 [propertyAnim setFillMode:fillMode]; 1868 1884 1869 1885 [propertyAnim setDelegate:m_animationDelegate.get()];
Note: See TracChangeset
for help on using the changeset viewer.