| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) | 2 * Copyright (C) 1999 Antti Koivisto (koivisto@kde.org) |
| 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 13 * Library General Public License for more details. | 13 * Library General Public License for more details. |
| 14 * | 14 * |
| 15 * You should have received a copy of the GNU Library General Public License | 15 * You should have received a copy of the GNU Library General Public License |
| 16 * along with this library; see the file COPYING.LIB. If not, write to | 16 * along with this library; see the file COPYING.LIB. If not, write to |
| 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
| 18 * Boston, MA 02110-1301, USA. | 18 * Boston, MA 02110-1301, USA. |
| 19 * | 19 * |
| 20 */ | 20 */ |
| 21 | 21 |
| 22 #include "config.h" | 22 #include "config.h" |
| 23 #include "Animation.h" | 23 #include "PrimitiveAnimation.h" |
| 24 | 24 |
| 25 namespace WebCore { | 25 namespace WebCore { |
| 26 | 26 |
| 27 Animation::Animation() | 27 PrimitiveAnimation::PrimitiveAnimation() |
| 28 : m_name(initialAnimationName()) | 28 : m_name(initialAnimationName()) |
| 29 , m_property(CSSPropertyInvalid) | 29 , m_property(CSSPropertyInvalid) |
| 30 , m_mode(AnimateAll) | 30 , m_mode(AnimateAll) |
| 31 , m_iterationCount(initialAnimationIterationCount()) | 31 , m_iterationCount(initialAnimationIterationCount()) |
| 32 , m_delay(initialAnimationDelay()) | 32 , m_delay(initialAnimationDelay()) |
| 33 , m_duration(initialAnimationDuration()) | 33 , m_duration(initialAnimationDuration()) |
| 34 , m_timingFunction(initialAnimationTimingFunction()) | 34 , m_timingFunction(initialAnimationTimingFunction()) |
| 35 , m_direction(initialAnimationDirection()) | 35 , m_direction(initialAnimationDirection()) |
| 36 , m_fillMode(initialAnimationFillMode()) | 36 , m_fillMode(initialAnimationFillMode()) |
| 37 , m_playState(initialAnimationPlayState()) | 37 , m_playState(initialAnimationPlayState()) |
| 38 , m_delaySet(false) | 38 , m_delaySet(false) |
| 39 , m_directionSet(false) | 39 , m_directionSet(false) |
| 40 , m_durationSet(false) | 40 , m_durationSet(false) |
| 41 , m_fillModeSet(false) | 41 , m_fillModeSet(false) |
| 42 , m_iterationCountSet(false) | 42 , m_iterationCountSet(false) |
| 43 , m_nameSet(false) | 43 , m_nameSet(false) |
| 44 , m_playStateSet(false) | 44 , m_playStateSet(false) |
| 45 , m_propertySet(false) | 45 , m_propertySet(false) |
| 46 , m_timingFunctionSet(false) | 46 , m_timingFunctionSet(false) |
| 47 , m_isNone(false) | 47 , m_isNone(false) |
| 48 { | 48 { |
| 49 } | 49 } |
| 50 | 50 |
| 51 Animation::Animation(const Animation& o) | 51 PrimitiveAnimation::PrimitiveAnimation(const PrimitiveAnimation& o) |
| 52 : RefCounted<Animation>() | 52 : RefCounted<PrimitiveAnimation>() |
| 53 , m_name(o.m_name) | 53 , m_name(o.m_name) |
| 54 , m_property(o.m_property) | 54 , m_property(o.m_property) |
| 55 , m_mode(o.m_mode) | 55 , m_mode(o.m_mode) |
| 56 , m_iterationCount(o.m_iterationCount) | 56 , m_iterationCount(o.m_iterationCount) |
| 57 , m_delay(o.m_delay) | 57 , m_delay(o.m_delay) |
| 58 , m_duration(o.m_duration) | 58 , m_duration(o.m_duration) |
| 59 , m_timingFunction(o.m_timingFunction) | 59 , m_timingFunction(o.m_timingFunction) |
| 60 , m_direction(o.m_direction) | 60 , m_direction(o.m_direction) |
| 61 , m_fillMode(o.m_fillMode) | 61 , m_fillMode(o.m_fillMode) |
| 62 , m_playState(o.m_playState) | 62 , m_playState(o.m_playState) |
| 63 , m_delaySet(o.m_delaySet) | 63 , m_delaySet(o.m_delaySet) |
| 64 , m_directionSet(o.m_directionSet) | 64 , m_directionSet(o.m_directionSet) |
| 65 , m_durationSet(o.m_durationSet) | 65 , m_durationSet(o.m_durationSet) |
| 66 , m_fillModeSet(o.m_fillModeSet) | 66 , m_fillModeSet(o.m_fillModeSet) |
| 67 , m_iterationCountSet(o.m_iterationCountSet) | 67 , m_iterationCountSet(o.m_iterationCountSet) |
| 68 , m_nameSet(o.m_nameSet) | 68 , m_nameSet(o.m_nameSet) |
| 69 , m_playStateSet(o.m_playStateSet) | 69 , m_playStateSet(o.m_playStateSet) |
| 70 , m_propertySet(o.m_propertySet) | 70 , m_propertySet(o.m_propertySet) |
| 71 , m_timingFunctionSet(o.m_timingFunctionSet) | 71 , m_timingFunctionSet(o.m_timingFunctionSet) |
| 72 , m_isNone(o.m_isNone) | 72 , m_isNone(o.m_isNone) |
| 73 { | 73 { |
| 74 } | 74 } |
| 75 | 75 |
| 76 Animation& Animation::operator=(const Animation& o) | 76 PrimitiveAnimation& PrimitiveAnimation::operator=(const PrimitiveAnimation& o) |
| 77 { | 77 { |
| 78 m_name = o.m_name; | 78 m_name = o.m_name; |
| 79 m_property = o.m_property; | 79 m_property = o.m_property; |
| 80 m_mode = o.m_mode; | 80 m_mode = o.m_mode; |
| 81 m_iterationCount = o.m_iterationCount; | 81 m_iterationCount = o.m_iterationCount; |
| 82 m_delay = o.m_delay; | 82 m_delay = o.m_delay; |
| 83 m_duration = o.m_duration; | 83 m_duration = o.m_duration; |
| 84 m_timingFunction = o.m_timingFunction; | 84 m_timingFunction = o.m_timingFunction; |
| 85 m_direction = o.m_direction; | 85 m_direction = o.m_direction; |
| 86 m_fillMode = o.m_fillMode; | 86 m_fillMode = o.m_fillMode; |
| 87 m_playState = o.m_playState; | 87 m_playState = o.m_playState; |
| 88 | 88 |
| 89 m_delaySet = o.m_delaySet; | 89 m_delaySet = o.m_delaySet; |
| 90 m_directionSet = o.m_directionSet; | 90 m_directionSet = o.m_directionSet; |
| 91 m_durationSet = o.m_durationSet; | 91 m_durationSet = o.m_durationSet; |
| 92 m_fillModeSet = o.m_fillModeSet; | 92 m_fillModeSet = o.m_fillModeSet; |
| 93 m_iterationCountSet = o.m_iterationCountSet; | 93 m_iterationCountSet = o.m_iterationCountSet; |
| 94 m_nameSet = o.m_nameSet; | 94 m_nameSet = o.m_nameSet; |
| 95 m_playStateSet = o.m_playStateSet; | 95 m_playStateSet = o.m_playStateSet; |
| 96 m_propertySet = o.m_propertySet; | 96 m_propertySet = o.m_propertySet; |
| 97 m_timingFunctionSet = o.m_timingFunctionSet; | 97 m_timingFunctionSet = o.m_timingFunctionSet; |
| 98 m_isNone = o.m_isNone; | 98 m_isNone = o.m_isNone; |
| 99 | 99 |
| 100 return *this; | 100 return *this; |
| 101 } | 101 } |
| 102 | 102 |
| 103 Animation::~Animation() | 103 PrimitiveAnimation::~PrimitiveAnimation() |
| 104 { | 104 { |
| 105 } | 105 } |
| 106 | 106 |
| 107 bool Animation::animationsMatch(const Animation* o, bool matchPlayStates) const | 107 bool PrimitiveAnimation::animationsMatch(const PrimitiveAnimation* o, bool match
PlayStates) const |
| 108 { | 108 { |
| 109 if (!o) | 109 if (!o) |
| 110 return false; | 110 return false; |
| 111 | 111 |
| 112 bool result = m_name == o->m_name | 112 bool result = m_name == o->m_name |
| 113 && m_property == o->m_property | 113 && m_property == o->m_property |
| 114 && m_mode == o->m_mode | 114 && m_mode == o->m_mode |
| 115 && m_iterationCount == o->m_iterationCount | 115 && m_iterationCount == o->m_iterationCount |
| 116 && m_delay == o->m_delay | 116 && m_delay == o->m_delay |
| 117 && m_duration == o->m_duration | 117 && m_duration == o->m_duration |
| 118 && *(m_timingFunction.get()) == *(o->m_timingFunction.get()) | 118 && *(m_timingFunction.get()) == *(o->m_timingFunction.get()) |
| 119 && m_direction == o->m_direction | 119 && m_direction == o->m_direction |
| 120 && m_fillMode == o->m_fillMode | 120 && m_fillMode == o->m_fillMode |
| 121 && m_delaySet == o->m_delaySet | 121 && m_delaySet == o->m_delaySet |
| 122 && m_directionSet == o->m_directionSet | 122 && m_directionSet == o->m_directionSet |
| 123 && m_durationSet == o->m_durationSet | 123 && m_durationSet == o->m_durationSet |
| 124 && m_fillModeSet == o->m_fillModeSet | 124 && m_fillModeSet == o->m_fillModeSet |
| 125 && m_iterationCountSet == o->m_iterationCountSet | 125 && m_iterationCountSet == o->m_iterationCountSet |
| 126 && m_nameSet == o->m_nameSet | 126 && m_nameSet == o->m_nameSet |
| 127 && m_propertySet == o->m_propertySet | 127 && m_propertySet == o->m_propertySet |
| 128 && m_timingFunctionSet == o->m_timingFunctionSet | 128 && m_timingFunctionSet == o->m_timingFunctionSet |
| 129 && m_isNone == o->m_isNone; | 129 && m_isNone == o->m_isNone; |
| 130 | 130 |
| 131 if (!result) | 131 if (!result) |
| 132 return false; | 132 return false; |
| 133 | 133 |
| 134 return !matchPlayStates || (m_playState == o->m_playState && m_playStateSet
== o->m_playStateSet); | 134 return !matchPlayStates || (m_playState == o->m_playState && m_playStateSet
== o->m_playStateSet); |
| 135 } | 135 } |
| 136 | 136 |
| 137 const String& Animation::initialAnimationName() | 137 const String& PrimitiveAnimation::initialAnimationName() |
| 138 { | 138 { |
| 139 DEFINE_STATIC_LOCAL(String, initialValue, (ASCIILiteral("none"))); | 139 DEFINE_STATIC_LOCAL(String, initialValue, (ASCIILiteral("none"))); |
| 140 return initialValue; | 140 return initialValue; |
| 141 } | 141 } |
| 142 | 142 |
| 143 } // namespace WebCore | 143 } // namespace WebCore |
| OLD | NEW |