OLD | NEW |
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 16 matching lines...) Expand all Loading... |
27 #define SVGSMILElement_h | 27 #define SVGSMILElement_h |
28 | 28 |
29 #include "core/svg/SVGElement.h" | 29 #include "core/svg/SVGElement.h" |
30 #include "core/svg/animation/SMILTime.h" | 30 #include "core/svg/animation/SMILTime.h" |
31 #include "wtf/HashMap.h" | 31 #include "wtf/HashMap.h" |
32 | 32 |
33 namespace WebCore { | 33 namespace WebCore { |
34 | 34 |
35 class ConditionEventListener; | 35 class ConditionEventListener; |
36 class SMILTimeContainer; | 36 class SMILTimeContainer; |
| 37 class SVGSMILElement; |
| 38 |
| 39 template<typename T> class EventSender; |
| 40 typedef EventSender<SVGSMILElement> SMILEventSender; |
37 | 41 |
38 // This class implements SMIL interval timing model as needed for SVG animation. | 42 // This class implements SMIL interval timing model as needed for SVG animation. |
39 class SVGSMILElement : public SVGElement { | 43 class SVGSMILElement : public SVGElement { |
40 public: | 44 public: |
41 SVGSMILElement(const QualifiedName&, Document*); | 45 SVGSMILElement(const QualifiedName&, Document*); |
42 virtual ~SVGSMILElement(); | 46 virtual ~SVGSMILElement(); |
43 | 47 |
44 static bool isSMILElement(Node*); | 48 static bool isSMILElement(Node*); |
45 | 49 |
46 bool isSupportedAttribute(const QualifiedName&); | 50 bool isSupportedAttribute(const QualifiedName&); |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 bool isFrozen() const; | 106 bool isFrozen() const; |
103 | 107 |
104 unsigned documentOrderIndex() const { return m_documentOrderIndex; } | 108 unsigned documentOrderIndex() const { return m_documentOrderIndex; } |
105 void setDocumentOrderIndex(unsigned index) { m_documentOrderIndex = index; } | 109 void setDocumentOrderIndex(unsigned index) { m_documentOrderIndex = index; } |
106 | 110 |
107 virtual bool isAdditive() const = 0; | 111 virtual bool isAdditive() const = 0; |
108 virtual void resetAnimatedType() = 0; | 112 virtual void resetAnimatedType() = 0; |
109 virtual void clearAnimatedType(SVGElement* targetElement) = 0; | 113 virtual void clearAnimatedType(SVGElement* targetElement) = 0; |
110 virtual void applyResultsToTarget() = 0; | 114 virtual void applyResultsToTarget() = 0; |
111 | 115 |
| 116 void connectConditions(); |
| 117 bool hasConditionsConnected() const { return m_conditionsConnected; } |
| 118 |
| 119 void dispatchPendingEvent(SMILEventSender*); |
| 120 |
112 protected: | 121 protected: |
113 void addBeginTime(SMILTime eventTime, SMILTime endTime, SMILTimeWithOrigin::
Origin = SMILTimeWithOrigin::ParserOrigin); | 122 void addBeginTime(SMILTime eventTime, SMILTime endTime, SMILTimeWithOrigin::
Origin = SMILTimeWithOrigin::ParserOrigin); |
114 void addEndTime(SMILTime eventTime, SMILTime endTime, SMILTimeWithOrigin::Or
igin = SMILTimeWithOrigin::ParserOrigin); | 123 void addEndTime(SMILTime eventTime, SMILTime endTime, SMILTimeWithOrigin::Or
igin = SMILTimeWithOrigin::ParserOrigin); |
115 | 124 |
116 void setInactive() { m_activeState = Inactive; } | 125 void setInactive() { m_activeState = Inactive; } |
117 | 126 |
118 // 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. |
119 virtual void setTargetElement(SVGElement*); | 128 virtual void setTargetElement(SVGElement*); |
120 virtual void setAttributeName(const QualifiedName&); | 129 virtual void setAttributeName(const QualifiedName&); |
121 | 130 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
160 String m_name; | 169 String m_name; |
161 SMILTime m_offset; | 170 SMILTime m_offset; |
162 int m_repeats; | 171 int m_repeats; |
163 RefPtr<Element> m_syncbase; | 172 RefPtr<Element> m_syncbase; |
164 RefPtr<ConditionEventListener> m_eventListener; | 173 RefPtr<ConditionEventListener> m_eventListener; |
165 }; | 174 }; |
166 bool parseCondition(const String&, BeginOrEnd beginOrEnd); | 175 bool parseCondition(const String&, BeginOrEnd beginOrEnd); |
167 void parseBeginOrEnd(const String&, BeginOrEnd beginOrEnd); | 176 void parseBeginOrEnd(const String&, BeginOrEnd beginOrEnd); |
168 Element* eventBaseFor(const Condition&); | 177 Element* eventBaseFor(const Condition&); |
169 | 178 |
170 void connectConditions(); | |
171 void disconnectConditions(); | 179 void disconnectConditions(); |
172 | 180 |
173 // Event base timing | 181 // Event base timing |
174 void handleConditionEvent(Event*, Condition*); | 182 void handleConditionEvent(Event*, Condition*); |
175 | 183 |
176 // Syncbase timing | 184 // Syncbase timing |
177 enum NewOrExistingInterval { | 185 enum NewOrExistingInterval { |
178 NewInterval, | 186 NewInterval, |
179 ExistingInterval | 187 ExistingInterval |
180 }; | 188 }; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
237 | 245 |
238 inline SVGSMILElement* toSVGSMILElement(Element* element) | 246 inline SVGSMILElement* toSVGSMILElement(Element* element) |
239 { | 247 { |
240 ASSERT_WITH_SECURITY_IMPLICATION(!element || SVGSMILElement::isSMILElement(e
lement)); | 248 ASSERT_WITH_SECURITY_IMPLICATION(!element || SVGSMILElement::isSMILElement(e
lement)); |
241 return static_cast<SVGSMILElement*>(element); | 249 return static_cast<SVGSMILElement*>(element); |
242 } | 250 } |
243 | 251 |
244 } | 252 } |
245 | 253 |
246 #endif // SVGSMILElement_h | 254 #endif // SVGSMILElement_h |
OLD | NEW |