Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(268)

Side by Side Diff: third_party/WebKit/Source/core/svg/animation/SVGSMILElement.h

Issue 2602423002: Push attributeName handling down into SVGAnimateElement (Closed)
Patch Set: Remove excess space Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 SMILTimeWithOrigin::Origin = SMILTimeWithOrigin::ParserOrigin); 135 SMILTimeWithOrigin::Origin = SMILTimeWithOrigin::ParserOrigin);
136 void addEndTime( 136 void addEndTime(
137 SMILTime eventTime, 137 SMILTime eventTime,
138 SMILTime endTime, 138 SMILTime endTime,
139 SMILTimeWithOrigin::Origin = SMILTimeWithOrigin::ParserOrigin); 139 SMILTimeWithOrigin::Origin = SMILTimeWithOrigin::ParserOrigin);
140 140
141 void setInactive() { m_activeState = Inactive; } 141 void setInactive() { m_activeState = Inactive; }
142 142
143 // Sub-classes may need to take action when the target is changed. 143 // Sub-classes may need to take action when the target is changed.
144 virtual void setTargetElement(SVGElement*); 144 virtual void setTargetElement(SVGElement*);
145 virtual void setAttributeName(const QualifiedName&);
146 145
147 void schedule(); 146 void schedule();
148 void unscheduleIfScheduled(); 147 void unscheduleIfScheduled();
149 148
149 QualifiedName m_attributeName;
150
150 private: 151 private:
151 void buildPendingResource() override; 152 void buildPendingResource() override;
152 void clearResourceAndEventBaseReferences(); 153 void clearResourceAndEventBaseReferences();
153 void clearConditions(); 154 void clearConditions();
154 155
155 virtual void startedActiveInterval() = 0; 156 virtual void startedActiveInterval() = 0;
156 void endedActiveInterval(); 157 void endedActiveInterval();
157 virtual void updateAnimation(float percent, 158 virtual void updateAnimation(float percent,
158 unsigned repeat, 159 unsigned repeat,
159 SVGSMILElement* resultElement) = 0; 160 SVGSMILElement* resultElement) = 0;
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 // Event base timing 238 // Event base timing
238 void handleConditionEvent(Event*, Condition*); 239 void handleConditionEvent(Event*, Condition*);
239 240
240 void notifyDependentsIntervalChanged(); 241 void notifyDependentsIntervalChanged();
241 void createInstanceTimesFromSyncbase(SVGSMILElement* syncbase); 242 void createInstanceTimesFromSyncbase(SVGSMILElement* syncbase);
242 void addSyncBaseDependent(SVGSMILElement*); 243 void addSyncBaseDependent(SVGSMILElement*);
243 void removeSyncBaseDependent(SVGSMILElement*); 244 void removeSyncBaseDependent(SVGSMILElement*);
244 245
245 enum ActiveState { Inactive, Active, Frozen }; 246 enum ActiveState { Inactive, Active, Frozen };
246 247
247 QualifiedName m_attributeName;
248
249 ActiveState determineActiveState(SMILTime elapsed) const; 248 ActiveState determineActiveState(SMILTime elapsed) const;
250 float calculateAnimationPercentAndRepeat(double elapsed, 249 float calculateAnimationPercentAndRepeat(double elapsed,
251 unsigned& repeat) const; 250 unsigned& repeat) const;
252 SMILTime calculateNextProgressTime(double elapsed) const; 251 SMILTime calculateNextProgressTime(double elapsed) const;
253 252
254 Member<SVGElement> m_targetElement; 253 Member<SVGElement> m_targetElement;
255 254
256 HeapVector<Member<Condition>> m_conditions; 255 HeapVector<Member<Condition>> m_conditions;
257 bool m_syncBaseConditionsConnected; 256 bool m_syncBaseConditionsConnected;
258 bool m_hasEndEventConditions; 257 bool m_hasEndEventConditions;
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 element.hasTagName(SVGNames::animateMotionTag) || 299 element.hasTagName(SVGNames::animateMotionTag) ||
301 element.hasTagName(SVGNames::animateTransformTag) || 300 element.hasTagName(SVGNames::animateTransformTag) ||
302 element.hasTagName((SVGNames::discardTag)); 301 element.hasTagName((SVGNames::discardTag));
303 } 302 }
304 303
305 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGSMILElement); 304 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGSMILElement);
306 305
307 } // namespace blink 306 } // namespace blink
308 307
309 #endif // SVGSMILElement_h 308 #endif // SVGSMILElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698