Changeset 35568 in webkit
- Timestamp:
- Aug 5, 2008 12:08:45 PM (16 years ago)
- Location:
- trunk/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/WebCore/ChangeLog
r35567 r35568 1 2008-08-05 Dean Jackson <dino@apple.com> 2 3 Reviewed by Dave Hyatt 4 5 Add support for CSS Animation properties to RenderStyle 6 https://bugs.webkit.org/show_bug.cgi?id=20068 7 8 (also fix some minor whitespace issues and remove debugging code) 9 10 * css/CSSComputedStyleDeclaration.cpp: 11 * css/CSSStyleSelector.cpp: 12 * page/AnimationController.cpp: 13 * rendering/style/RenderStyle.cpp: 14 * rendering/style/RenderStyle.h: 15 1 16 2008-08-05 Kevin McCullough <kmccullough@apple.com> 2 17 -
trunk/WebCore/css/CSSComputedStyleDeclaration.cpp
r35545 r35568 1069 1069 } 1070 1070 else 1071 list->append(CSSPrimitiveValue::create(RenderStyle::initial Delay(), CSSPrimitiveValue::CSS_S));1071 list->append(CSSPrimitiveValue::create(RenderStyle::initialAnimationDelay(), CSSPrimitiveValue::CSS_S)); 1072 1072 return list.release(); 1073 1073 } … … 1080 1080 } 1081 1081 else 1082 list->append(CSSPrimitiveValue::create(RenderStyle::initial Duration(), CSSPrimitiveValue::CSS_S));1082 list->append(CSSPrimitiveValue::create(RenderStyle::initialAnimationDuration(), CSSPrimitiveValue::CSS_S)); 1083 1083 return list.release(); 1084 1084 } … … 1093 1093 } 1094 1094 else { 1095 const TimingFunction& tf = RenderStyle::initial TimingFunction();1095 const TimingFunction& tf = RenderStyle::initialAnimationTimingFunction(); 1096 1096 list->append(CSSTimingFunctionValue::create(tf.x1(), tf.y1(), tf.x2(), tf.y2())); 1097 1097 } -
trunk/WebCore/css/CSSStyleSelector.cpp
r35545 r35568 200 200 if (isInitial) { \ 201 201 AnimationList* list = m_style->accessTransitions(); \ 202 (*list)[0]->set##Prop(RenderStyle::initial ##Prop()); \202 (*list)[0]->set##Prop(RenderStyle::initialAnimation##Prop()); \ 203 203 for (size_t i = 1; i < list->size(); ++i) \ 204 204 (*list)[0]->clear##Prop(); \ … … 5005 5005 { 5006 5006 if (value->cssValueType() == CSSValue::CSS_INITIAL) { 5007 transition->setDuration(RenderStyle::initial Duration());5007 transition->setDuration(RenderStyle::initialAnimationDuration()); 5008 5008 return; 5009 5009 } … … 5022 5022 { 5023 5023 if (value->cssValueType() == CSSValue::CSS_INITIAL) { 5024 transition->setDelay(RenderStyle::initial Delay());5024 transition->setDelay(RenderStyle::initialAnimationDelay()); 5025 5025 return; 5026 5026 } … … 5040 5040 { 5041 5041 if (value->cssValueType() == CSSValue::CSS_INITIAL) { 5042 transition->setTimingFunction(RenderStyle::initial TimingFunction());5042 transition->setTimingFunction(RenderStyle::initialAnimationTimingFunction()); 5043 5043 return; 5044 5044 } … … 5075 5075 { 5076 5076 if (value->cssValueType() == CSSValue::CSS_INITIAL) { 5077 transition->setProperty(RenderStyle::initial Property());5077 transition->setProperty(RenderStyle::initialAnimationProperty()); 5078 5078 return; 5079 5079 } -
trunk/WebCore/page/AnimationController.cpp
r35545 r35568 112 112 } 113 113 114 void startTimer(Element* element, const AtomicString& name, int property, bool reset, 114 void startTimer(Element* element, const AtomicString& name, int property, bool reset, 115 115 const AtomicString& eventType, double elapsedTime) 116 116 { … … 192 192 void suspendAnimations(); 193 193 void resumeAnimations(); 194 bool suspended() const 194 bool suspended() const { return m_suspended; } 195 195 196 196 void overrideImplicitAnimations(int property); … … 216 216 class AnimationBase : public Noncopyable { 217 217 public: 218 AnimationBase(const Animation* transition, RenderObject* renderer, CompositeAnimation* compAnim); 218 AnimationBase(const Animation* transition, RenderObject* renderer, CompositeAnimation* compAnim); 219 219 virtual ~AnimationBase() 220 220 { … … 309 309 310 310 void animationTimerCallbackFired(const AtomicString& eventType, double elapsedTime); 311 void animationEventDispatcherFired(Element* element, const AtomicString& name, int property, bool reset, 311 void animationEventDispatcherFired(Element* element, const AtomicString& name, int property, bool reset, 312 312 const AtomicString& eventType, double elapsedTime); 313 313 … … 699 699 } 700 700 701 void AnimationBase::animationEventDispatcherFired(Element* element, const AtomicString& name, int property, 701 void AnimationBase::animationEventDispatcherFired(Element* element, const AtomicString& name, int property, 702 702 bool reset, const AtomicString& eventType, double elapsedTime) 703 703 { … … 1741 1741 void AnimationController::suspendAnimations(Document* document) 1742 1742 { 1743 #ifdef DEBUG_STATE_MACHINE1744 fprintf(stderr, "AnimationController %p suspendAnimations for document %p\n", this, document);1745 #endif1746 1743 m_data->suspendAnimations(document); 1747 1744 } … … 1749 1746 void AnimationController::resumeAnimations(Document* document) 1750 1747 { 1751 #ifdef DEBUG_STATE_MACHINE1752 fprintf(stderr, "AnimationController %p resumeAnimations for document %p\n", this, document);1753 #endif1754 1748 m_data->resumeAnimations(document); 1755 1749 } -
trunk/WebCore/rendering/style/RenderStyle.cpp
r35545 r35568 665 665 } 666 666 667 bool KeyframeList::operator==(const KeyframeList& o) const 668 { 669 if (m_keyframes.size() != o.m_keyframes.size()) 670 return false; 671 672 Vector<KeyframeValue>::const_iterator it2 = o.m_keyframes.begin(); 673 for (Vector<KeyframeValue>::const_iterator it1 = m_keyframes.begin(); it1 != m_keyframes.end(); ++it1) { 674 if (it1->key != it2->key) 675 return false; 676 const RenderStyle& style1 = it1->style; 677 const RenderStyle& style2 = it2->style; 678 if (!(style1 == style2)) 679 return false; 680 ++it2; 681 } 682 683 return true; 684 } 685 686 void 687 KeyframeList::insert(float inKey, const RenderStyle& inStyle) 688 { 689 if (inKey < 0 || inKey > 1) 690 return; 691 692 for (size_t i = 0; i < m_keyframes.size(); ++i) { 693 if (m_keyframes[i].key == inKey) { 694 m_keyframes[i].style = inStyle; 695 return; 696 } 697 if (m_keyframes[i].key > inKey) { 698 // insert before 699 m_keyframes.insert(i, KeyframeValue()); 700 m_keyframes[i].key = inKey; 701 m_keyframes[i].style = inStyle; 702 return; 703 } 704 } 705 706 // append 707 m_keyframes.append(KeyframeValue()); 708 m_keyframes[m_keyframes.size()-1].key = inKey; 709 m_keyframes[m_keyframes.size()-1].style = inStyle; 710 } 711 667 712 Animation::Animation() 668 : m_duration(RenderStyle::initialDuration()) 669 , m_timingFunction(RenderStyle::initialTimingFunction()) 670 , m_delay(RenderStyle::initialDelay()) 671 , m_property(RenderStyle::initialProperty()) 713 : m_delay(RenderStyle::initialAnimationDelay()) 714 , m_direction(RenderStyle::initialAnimationDirection()) 715 , m_duration(RenderStyle::initialAnimationDuration()) 716 , m_iterationCount(RenderStyle::initialAnimationIterationCount()) 717 , m_name(RenderStyle::initialAnimationName()) 718 , m_property(RenderStyle::initialAnimationProperty()) 719 , m_timingFunction(RenderStyle::initialAnimationTimingFunction()) 720 , m_playState(RenderStyle::initialAnimationPlayState()) 721 , m_delaySet(false) 722 , m_directionSet(false) 672 723 , m_durationSet(false) 724 , m_iterationCountSet(false) 725 , m_nameSet(false) 726 , m_playStateSet(false) 727 , m_propertySet(false) 673 728 , m_timingFunctionSet(false) 674 , m_delaySet(false) 675 , m_propertySet(false) 729 , m_isNone(false) 676 730 { 677 731 } … … 679 733 Animation::Animation(const Animation& o) 680 734 : RefCounted<Animation>() 735 , m_delay(o.m_delay) 736 , m_direction(o.m_direction) 681 737 , m_duration(o.m_duration) 738 , m_iterationCount(o.m_iterationCount) 739 , m_name(o.m_name) 740 , m_property(o.m_property) 682 741 , m_timingFunction(o.m_timingFunction) 683 , m_delay(o.m_delay) 684 , m_property(o.m_property) 742 , m_playState(o.m_playState) 743 , m_delaySet(o.m_delaySet) 744 , m_directionSet(o.m_directionSet) 685 745 , m_durationSet(o.m_durationSet) 746 , m_iterationCountSet(o.m_iterationCountSet) 747 , m_nameSet(o.m_nameSet) 748 , m_playStateSet(o.m_playStateSet) 749 , m_propertySet(o.m_propertySet) 686 750 , m_timingFunctionSet(o.m_timingFunctionSet) 687 , m_delaySet(o.m_delaySet) 688 , m_propertySet(o.m_propertySet) 751 , m_isNone(o.m_isNone) 689 752 { 690 753 } … … 693 756 { 694 757 m_delay = o.m_delay; 758 m_direction = o.m_direction; 695 759 m_duration = o.m_duration; 760 m_iterationCount = o.m_iterationCount; 761 m_name = o.m_name; 762 m_playState = o.m_playState; 763 m_property = o.m_property; 696 764 m_timingFunction = o.m_timingFunction; 697 m_property = o.m_property;698 765 699 766 m_delaySet = o.m_delaySet; 767 m_directionSet = o.m_directionSet; 700 768 m_durationSet = o.m_durationSet; 769 m_iterationCountSet = o.m_iterationCountSet; 770 m_nameSet = o.m_nameSet; 771 m_playStateSet = o.m_playStateSet; 772 m_propertySet = o.m_propertySet; 701 773 m_timingFunctionSet = o.m_timingFunctionSet; 702 m_propertySet = o.m_propertySet; 774 775 m_isNone = o.m_isNone; 703 776 704 777 return *this; 705 778 } 706 779 707 bool Animation::animationsMatch(const Animation* o ) const780 bool Animation::animationsMatch(const Animation* o, bool matchPlayStates /* = true */) const 708 781 { 709 782 if (!o) 710 783 return false; 711 784 712 bool result = m_duration == o->m_duration && 785 bool result = m_delay == o->m_delay && 786 m_direction == o->m_direction && 787 m_duration == o->m_duration && 788 m_iterationCount == o->m_iterationCount && 789 m_name == o->m_name && 790 m_property == o->m_property && 713 791 m_timingFunction == o->m_timingFunction && 714 m_delay == o->m_delay &&715 m_property == o->m_property &&716 m_durationSet == o->m_durationSet &&717 m_timingFunctionSet == o->m_timingFunctionSet &&718 792 m_delaySet == o->m_delaySet && 719 m_propertySet == o->m_propertySet; 720 721 return result; 793 m_directionSet == o->m_directionSet && 794 m_durationSet == o->m_durationSet && 795 m_iterationCountSet == o->m_iterationCountSet && 796 m_nameSet == o->m_nameSet && 797 m_propertySet == o->m_propertySet && 798 m_timingFunctionSet == o->m_timingFunctionSet && 799 m_isNone == o->m_isNone; 800 801 if (!result) 802 return false; 803 804 if (matchPlayStates && (m_playState != o->m_playState || m_playStateSet != o->m_playStateSet)) 805 return false; 806 807 // now check keyframes 808 if ((m_keyframeList.get() && !o->m_keyframeList.get()) || (!m_keyframeList.get() && o->m_keyframeList.get())) 809 return false; 810 if (!(m_keyframeList.get())) 811 return true; 812 return *m_keyframeList == *o->m_keyframeList; 722 813 } 723 814 … … 733 824 size_t i; 734 825 FILL_UNSET_PROPERTY(isDelaySet, delay, setDelay); 826 FILL_UNSET_PROPERTY(isDirectionSet, direction, setDirection); 735 827 FILL_UNSET_PROPERTY(isDurationSet, duration, setDuration); 828 FILL_UNSET_PROPERTY(isIterationCountSet, iterationCount, setIterationCount); 829 FILL_UNSET_PROPERTY(isPlayStateSet, playState, setPlayState); 830 FILL_UNSET_PROPERTY(isNameSet, name, setName); 736 831 FILL_UNSET_PROPERTY(isTimingFunctionSet, timingFunction, setTimingFunction); 737 832 FILL_UNSET_PROPERTY(isPropertySet, property, setProperty); … … 761 856 , m_borderFit(RenderStyle::initialBorderFit()) 762 857 , m_boxShadow(0) 858 , m_animations(0) 763 859 , m_transitions(0) 764 860 , m_mask(FillLayer(MaskFillLayer)) … … 788 884 , m_boxShadow(o.m_boxShadow ? new ShadowData(*o.m_boxShadow) : 0) 789 885 , m_boxReflect(o.m_boxReflect) 886 , m_animations(o.m_animations ? new AnimationList(*o.m_animations) : 0) 790 887 , m_transitions(o.m_transitions ? new AnimationList(*o.m_transitions) : 0) 791 888 , m_mask(o.m_mask) … … 841 938 && shadowDataEquivalent(o) 842 939 && reflectionDataEquivalent(o) 940 && animationDataEquivalent(o) 843 941 && transitionDataEquivalent(o) 844 942 && m_mask == o.m_mask … … 868 966 return true; 869 967 968 } 969 970 void StyleRareNonInheritedData::updateKeyframes(const CSSStyleSelector* styleSelector) 971 { 972 if (m_animations) { 973 for (size_t i = 0; i < m_animations->size(); ++i) { 974 if ((*m_animations)[i]->isValidAnimation()) { 975 // When keyframes have been parsed, execute this code. 976 // RefPtr<KeyframeList> keyframe = styleSelector->findKeyframeRule((*m_animations)[i]->name()); 977 // (*m_animations)[i]->setAnimationKeyframe(keyframe); 978 } 979 } 980 } 981 } 982 983 bool StyleRareNonInheritedData::animationDataEquivalent(const StyleRareNonInheritedData& o) const 984 { 985 if (!m_animations && o.m_animations || m_animations && !o.m_animations) 986 return false; 987 if (m_animations && o.m_animations && (*m_animations != *o.m_animations)) 988 return false; 989 return true; 870 990 } 871 991 … … 1844 1964 #endif 1845 1965 1966 void RenderStyle::adjustAnimations() 1967 { 1968 AnimationList* animationList = rareNonInheritedData->m_animations; 1969 if (!animationList) 1970 return; 1971 1972 if (animationList->size() == 0) { 1973 clearAnimations(); 1974 return; 1975 } 1976 1977 // get rid of empty transitions and anything beyond them 1978 for (size_t i = 0; i < animationList->size(); ++i) { 1979 if ((*animationList)[i]->isEmpty()) { 1980 animationList->resize(i); 1981 break; 1982 } 1983 } 1984 1985 if (animationList->size() == 0) { 1986 clearAnimations(); 1987 return; 1988 } 1989 1990 // Repeat patterns into layers that don't have some properties set. 1991 animationList->fillUnsetProperties(); 1992 } 1993 1846 1994 void RenderStyle::adjustTransitions() 1847 1995 { … … 1884 2032 } 1885 2033 2034 AnimationList* RenderStyle::accessAnimations() 2035 { 2036 AnimationList* list = rareNonInheritedData.access()->m_animations; 2037 if (!list) 2038 rareNonInheritedData.access()->m_animations = new AnimationList(); 2039 return rareNonInheritedData->m_animations; 2040 } 2041 1886 2042 AnimationList* RenderStyle::accessTransitions() 1887 2043 { … … 1892 2048 } 1893 2049 1894 } 2050 const Animation* RenderStyle::transitionForProperty(int property) 2051 { 2052 if (transitions()) { 2053 for (size_t i = 0; i < transitions()->size(); ++i) { 2054 const Animation* p = (*transitions())[i].get(); 2055 if (p->property() == cAnimateAll || p->property() == property) { 2056 return p; 2057 } 2058 } 2059 } 2060 return 0; 2061 } 2062 2063 } -
trunk/WebCore/rendering/style/RenderStyle.h
r35545 r35568 73 73 class CachedResource; 74 74 class CursorList; 75 class KeyframeList; 75 76 class Pair; 76 77 class RenderArena; … … 1258 1259 }; 1259 1260 1261 enum EAnimPlayState { 1262 AnimPlayStatePlaying = 0x0, 1263 AnimPlayStatePaused = 0x1 1264 }; 1265 1260 1266 class Animation : public RefCounted<Animation> { 1261 1267 public: … … 1264 1270 1265 1271 bool isDelaySet() const { return m_delaySet; } 1272 bool isDirectionSet() const { return m_directionSet; } 1266 1273 bool isDurationSet() const { return m_durationSet; } 1274 bool isIterationCountSet() const { return m_iterationCountSet; } 1275 bool isNameSet() const { return m_nameSet; } 1276 bool isPlayStateSet() const { return m_playStateSet; } 1277 bool isPropertySet() const { return m_propertySet; } 1267 1278 bool isTimingFunctionSet() const { return m_timingFunctionSet; } 1268 bool isPropertySet() const { return m_propertySet; } 1279 1280 // Flags this to be the special "none" animation (animation-name: none) 1281 bool isNoneAnimation() const { return m_isNone; } 1282 // We can make placeholder Animation objects to keep the comma-separated lists 1283 // of properties in sync. isValidAnimation means this is not a placeholder. 1284 bool isValidAnimation() const { return !m_isNone && !m_name.isEmpty(); } 1269 1285 1270 1286 bool isEmpty() const 1271 1287 { 1272 return (!m_durationSet && !m_delaySet && !m_timingFunctionSet && !m_propertySet); 1288 return (!m_directionSet && !m_durationSet && !m_nameSet && !m_playStateSet && 1289 !m_iterationCountSet && !m_delaySet && !m_timingFunctionSet && !m_propertySet); 1273 1290 } 1274 1291 … … 1279 1296 1280 1297 void clearDelay() { m_delaySet = false; } 1298 void clearDirection() { m_directionSet = false; } 1281 1299 void clearDuration() { m_durationSet = false; } 1300 void clearIterationCount() { m_iterationCountSet = false; } 1301 void clearName() { m_nameSet = false; } 1302 void clearPlayState() { m_playStateSet = AnimPlayStatePlaying; } 1303 void clearProperty() { m_propertySet = false; } 1282 1304 void clearTimingFunction() { m_timingFunctionSet = false; } 1283 1305 1284 void clearProperty() { m_propertySet = false; }1285 1286 1306 double delay() const { return m_delay; } 1307 bool direction() const { return m_direction; } 1287 1308 double duration() const { return m_duration; } 1309 int iterationCount() const { return m_iterationCount; } 1310 const String& name() const { return m_name; } 1311 unsigned playState() const { return m_playState; } 1312 int property() const { return m_property; } 1288 1313 const TimingFunction& timingFunction() const { return m_timingFunction; } 1289 int property() const { return m_property; } 1314 1315 const RefPtr<KeyframeList>& keyframeList() const { return m_keyframeList; } 1290 1316 1291 1317 void setDelay(double c) { m_delay = c; m_delaySet = true; } 1318 void setDirection(bool d) { m_direction = d; m_directionSet = true; } 1292 1319 void setDuration(double d) { ASSERT(d >= 0); m_duration = d; m_durationSet = true; } 1320 void setIterationCount(int c) { m_iterationCount = c; m_iterationCountSet = true; } 1321 void setName(const String& n) { m_name = n; m_nameSet = true; } 1322 void setPlayState(unsigned d) { m_playState = d; m_playStateSet = true; } 1323 void setProperty(int t) { m_property = t; m_propertySet = true; } 1293 1324 void setTimingFunction(const TimingFunction& f) { m_timingFunction = f; m_timingFunctionSet = true; } 1294 void setProperty(int t) { m_property = t; m_propertySet = true; } 1325 1326 void setIsNoneAnimation(bool n) { m_isNone = n; } 1327 1328 void setAnimationKeyframe(const RefPtr<KeyframeList> keyframe) { m_keyframeList = keyframe; } 1295 1329 1296 1330 Animation& operator=(const Animation& o); 1297 1331 1298 1332 // return true if all members of this class match (excluding m_next) 1299 bool animationsMatch(const Animation* t ) const;1333 bool animationsMatch(const Animation* t, bool matchPlayStates=true) const; 1300 1334 1301 1335 // return true every Animation in the chain (defined by m_next) match … … 1307 1341 Animation(const Animation& o); 1308 1342 1343 double m_delay; 1344 bool m_direction; 1309 1345 double m_duration; 1346 int m_iterationCount; 1347 String m_name; 1348 int m_property; 1310 1349 TimingFunction m_timingFunction; 1311 double m_delay; 1312 int m_property; 1313 1350 1351 RefPtr<KeyframeList> m_keyframeList; 1352 1353 unsigned m_playState : 2; 1354 1355 bool m_delaySet : 1; 1356 bool m_directionSet : 1; 1314 1357 bool m_durationSet : 1; 1358 bool m_iterationCountSet : 1; 1359 bool m_nameSet : 1; 1360 bool m_playStateSet : 1; 1361 bool m_propertySet : 1; 1315 1362 bool m_timingFunctionSet : 1; 1316 bool m_delaySet : 1;1317 bool m_ propertySet: 1;1363 1364 bool m_isNone : 1; 1318 1365 }; 1319 1366 … … 1377 1424 bool shadowDataEquivalent(const StyleRareNonInheritedData& o) const; 1378 1425 bool reflectionDataEquivalent(const StyleRareNonInheritedData& o) const; 1426 bool animationDataEquivalent(const StyleRareNonInheritedData&) const; 1379 1427 bool transitionDataEquivalent(const StyleRareNonInheritedData&) const; 1428 void updateKeyframes(const CSSStyleSelector* styleSelector); 1380 1429 1381 1430 int lineClamp; // An Apple extension. … … 1404 1453 RefPtr<StyleReflection> m_boxReflect; 1405 1454 1455 AnimationList* m_animations; 1406 1456 AnimationList* m_transitions; 1407 1457 … … 2102 2152 2103 2153 // Apple-specific property getter methods 2154 const AnimationList* animations() const { return rareNonInheritedData->m_animations; } 2155 const AnimationList* transitions() const { return rareNonInheritedData->m_transitions; } 2156 2157 AnimationList* accessAnimations(); 2104 2158 AnimationList* accessTransitions(); 2105 const AnimationList* transitions() const { return rareNonInheritedData->m_transitions; } 2159 2160 bool hasAnimations() const { return rareNonInheritedData->m_animations && rareNonInheritedData->m_animations->size() > 0; } 2106 2161 bool hasTransitions() const { return rareNonInheritedData->m_transitions && rareNonInheritedData->m_transitions->size() > 0; } 2162 2163 // return the first found Animation (including 'all' transitions) 2164 const Animation* transitionForProperty(int property); 2107 2165 2108 2166 int lineClamp() const { return rareNonInheritedData->lineClamp; } … … 2369 2427 2370 2428 // Apple-specific property setters 2429 void clearAnimations() 2430 { 2431 if (rareNonInheritedData.access()->m_animations) { 2432 delete rareNonInheritedData.access()->m_animations; 2433 rareNonInheritedData.access()->m_animations = 0; 2434 } 2435 } 2371 2436 void clearTransitions() 2372 2437 { … … 2377 2442 } 2378 2443 2444 void inheritAnimations(const AnimationList* parent) { clearAnimations(); if (parent) rareNonInheritedData.access()->m_animations = new AnimationList(*parent); } 2379 2445 void inheritTransitions(const AnimationList* parent) { clearTransitions(); if (parent) rareNonInheritedData.access()->m_transitions = new AnimationList(*parent); } 2446 void adjustAnimations(); 2380 2447 void adjustTransitions(); 2448 void updateKeyframes(const CSSStyleSelector* styleSelector) { if (rareNonInheritedData.get()) rareNonInheritedData.access()->updateKeyframes(styleSelector); } 2449 2381 2450 void setLineClamp(int c) { SET_VAR(rareNonInheritedData, lineClamp, c); } 2382 2451 void setTextSizeAdjust(bool b) { SET_VAR(rareInheritedData, textSizeAdjust, b); } … … 2535 2604 2536 2605 // Keep these at the end. 2537 static float initialDelay() { return 0; } 2538 static double initialDuration() { return 0; } 2539 static TimingFunction initialTimingFunction() { return TimingFunction(); } 2540 static int initialProperty() { return cAnimateAll; } 2606 static float initialAnimationDelay() { return 0; } 2607 static bool initialAnimationDirection() { return false; } 2608 static double initialAnimationDuration() { return 0; } 2609 static int initialAnimationIterationCount() { return 1; } 2610 static String initialAnimationName() { return String(); } 2611 static unsigned initialAnimationPlayState() { return AnimPlayStatePlaying; } 2612 static int initialAnimationProperty() { return cAnimateAll; } 2613 static TimingFunction initialAnimationTimingFunction() { return TimingFunction(); } 2541 2614 static int initialLineClamp() { return -1; } 2542 2615 static bool initialTextSizeAdjust() { return true; } … … 2548 2621 }; 2549 2622 2623 #pragma mark - 2624 2625 class KeyframeValue { 2626 public: 2627 KeyframeValue() : key(-1) { } 2628 float key; 2629 RenderStyle style; 2630 }; 2631 2632 class KeyframeList : public RefCounted<KeyframeList> { 2633 public: 2634 static PassRefPtr<KeyframeList> create(const AtomicString& inAnimName) { return adoptRef(new KeyframeList(inAnimName)); } 2635 2636 bool operator==(const KeyframeList& o) const; 2637 bool operator!=(const KeyframeList& o) const { return !(*this == o); } 2638 2639 const AtomicString& animationName() const { return m_animationName; } 2640 2641 void insert(float inKey, const RenderStyle& inStyle); 2642 2643 void addProperty(int prop) { m_properties.add(prop); } 2644 bool containsProperty(int prop) const { return m_properties.contains(prop); } 2645 HashSet<int>::const_iterator beginProperties() { return m_properties.begin(); } 2646 HashSet<int>::const_iterator endProperties() { return m_properties.end(); } 2647 2648 void clear() { m_keyframes.clear(); m_properties.clear(); } 2649 bool isEmpty() const { return m_keyframes.isEmpty(); } 2650 Vector<KeyframeValue>::const_iterator beginKeyframes() const { return m_keyframes.begin(); } 2651 Vector<KeyframeValue>::const_iterator endKeyframes() const { return m_keyframes.end(); } 2652 2653 private: 2654 KeyframeList(const AtomicString& inAnimName) 2655 : m_animationName(inAnimName) 2656 { 2657 insert(0, RenderStyle()); 2658 insert(1, RenderStyle()); 2659 } 2660 2661 protected: 2662 AtomicString m_animationName; 2663 Vector<KeyframeValue> m_keyframes; 2664 HashSet<int> m_properties; // the properties being animated 2665 }; 2666 2550 2667 } // namespace WebCore 2551 2668
Note: See TracChangeset
for help on using the changeset viewer.