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

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

Issue 23823006: [SVG] Handle repeat(n) event for svg animations (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaselined Created 7 years, 3 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 107
108 unsigned documentOrderIndex() const { return m_documentOrderIndex; } 108 unsigned documentOrderIndex() const { return m_documentOrderIndex; }
109 void setDocumentOrderIndex(unsigned index) { m_documentOrderIndex = index; } 109 void setDocumentOrderIndex(unsigned index) { m_documentOrderIndex = index; }
110 110
111 virtual bool isAdditive() const = 0; 111 virtual bool isAdditive() const = 0;
112 virtual void resetAnimatedType() = 0; 112 virtual void resetAnimatedType() = 0;
113 virtual void clearAnimatedType(SVGElement* targetElement) = 0; 113 virtual void clearAnimatedType(SVGElement* targetElement) = 0;
114 virtual void applyResultsToTarget() = 0; 114 virtual void applyResultsToTarget() = 0;
115 115
116 void connectConditions(); 116 void connectConditions();
117 bool hasConditionsConnected() const { return m_conditionsConnected; }
118 117
119 void dispatchPendingEvent(SMILEventSender*); 118 void dispatchPendingEvent(SMILEventSender*);
119 void dispatchRepeatEvents(unsigned);
120 120
121 protected: 121 protected:
122 void addBeginTime(SMILTime eventTime, SMILTime endTime, SMILTimeWithOrigin:: Origin = SMILTimeWithOrigin::ParserOrigin); 122 void addBeginTime(SMILTime eventTime, SMILTime endTime, SMILTimeWithOrigin:: Origin = SMILTimeWithOrigin::ParserOrigin);
123 void addEndTime(SMILTime eventTime, SMILTime endTime, SMILTimeWithOrigin::Or igin = SMILTimeWithOrigin::ParserOrigin); 123 void addEndTime(SMILTime eventTime, SMILTime endTime, SMILTimeWithOrigin::Or igin = SMILTimeWithOrigin::ParserOrigin);
124 124
125 void setInactive() { m_activeState = Inactive; } 125 void setInactive() { m_activeState = Inactive; }
126 126
127 // Sub-classes may need to take action when the target is changed. 127 // Sub-classes may need to take action when the target is changed.
128 virtual void setTargetElement(SVGElement*); 128 virtual void setTargetElement(SVGElement*);
129 virtual void setAttributeName(const QualifiedName&); 129 virtual void setAttributeName(const QualifiedName&);
(...skipping 25 matching lines...) Expand all
155 155
156 // This represents conditions on elements begin or end list that need to be resolved on runtime 156 // This represents conditions on elements begin or end list that need to be resolved on runtime
157 // for example <animate begin="otherElement.begin + 8s; button.click" ... /> 157 // for example <animate begin="otherElement.begin + 8s; button.click" ... />
158 struct Condition { 158 struct Condition {
159 enum Type { 159 enum Type {
160 EventBase, 160 EventBase,
161 Syncbase, 161 Syncbase,
162 AccessKey 162 AccessKey
163 }; 163 };
164 164
165 Condition(Type, BeginOrEnd, const String& baseID, const String& name, SM ILTime offset, int repeats = -1); 165 Condition(Type, BeginOrEnd, const String& baseID, const String& name, SM ILTime offset);
166 Type m_type; 166 Type m_type;
167 BeginOrEnd m_beginOrEnd; 167 BeginOrEnd m_beginOrEnd;
168 String m_baseID; 168 String m_baseID;
169 String m_name; 169 String m_name;
170 SMILTime m_offset; 170 SMILTime m_offset;
171 int m_repeats;
172 RefPtr<Element> m_syncbase; 171 RefPtr<Element> m_syncbase;
173 RefPtr<ConditionEventListener> m_eventListener; 172 RefPtr<ConditionEventListener> m_eventListener;
174 }; 173 };
175 bool parseCondition(const String&, BeginOrEnd beginOrEnd); 174 bool parseCondition(const String&, BeginOrEnd beginOrEnd);
176 void parseBeginOrEnd(const String&, BeginOrEnd beginOrEnd); 175 void parseBeginOrEnd(const String&, BeginOrEnd beginOrEnd);
177 Element* eventBaseFor(const Condition&); 176 Element* eventBaseFor(const Condition&);
178 177
179 void disconnectConditions(); 178 void disconnectConditions();
180 179
181 // Event base timing 180 // Event base timing
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
227 226
228 ActiveState m_activeState; 227 ActiveState m_activeState;
229 float m_lastPercent; 228 float m_lastPercent;
230 unsigned m_lastRepeat; 229 unsigned m_lastRepeat;
231 230
232 SMILTime m_nextProgressTime; 231 SMILTime m_nextProgressTime;
233 232
234 RefPtr<SMILTimeContainer> m_timeContainer; 233 RefPtr<SMILTimeContainer> m_timeContainer;
235 unsigned m_documentOrderIndex; 234 unsigned m_documentOrderIndex;
236 235
236 Vector<unsigned> m_repeatEventCountList;
237
237 mutable SMILTime m_cachedDur; 238 mutable SMILTime m_cachedDur;
238 mutable SMILTime m_cachedRepeatDur; 239 mutable SMILTime m_cachedRepeatDur;
239 mutable SMILTime m_cachedRepeatCount; 240 mutable SMILTime m_cachedRepeatCount;
240 mutable SMILTime m_cachedMin; 241 mutable SMILTime m_cachedMin;
241 mutable SMILTime m_cachedMax; 242 mutable SMILTime m_cachedMax;
242 243
243 friend class ConditionEventListener; 244 friend class ConditionEventListener;
244 }; 245 };
245 246
246 inline SVGSMILElement* toSVGSMILElement(Element* element) 247 inline SVGSMILElement* toSVGSMILElement(Element* element)
247 { 248 {
248 ASSERT_WITH_SECURITY_IMPLICATION(!element || SVGSMILElement::isSMILElement(e lement)); 249 ASSERT_WITH_SECURITY_IMPLICATION(!element || SVGSMILElement::isSMILElement(e lement));
249 return static_cast<SVGSMILElement*>(element); 250 return static_cast<SVGSMILElement*>(element);
250 } 251 }
251 252
252 } 253 }
253 254
254 #endif // SVGSMILElement_h 255 #endif // SVGSMILElement_h
OLDNEW
« no previous file with comments | « Source/core/svg/animation/SMILTimeContainer.cpp ('k') | Source/core/svg/animation/SVGSMILElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698