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 27 matching lines...) Expand all Loading... |
38 #include "core/svg/SVGSVGElement.h" | 38 #include "core/svg/SVGSVGElement.h" |
39 #include "core/svg/SVGURIReference.h" | 39 #include "core/svg/SVGURIReference.h" |
40 #include "core/svg/animation/SMILTimeContainer.h" | 40 #include "core/svg/animation/SMILTimeContainer.h" |
41 #include "platform/FloatConversion.h" | 41 #include "platform/FloatConversion.h" |
42 #include "wtf/MathExtras.h" | 42 #include "wtf/MathExtras.h" |
43 #include "wtf/StdLibExtras.h" | 43 #include "wtf/StdLibExtras.h" |
44 #include "wtf/Vector.h" | 44 #include "wtf/Vector.h" |
45 | 45 |
46 namespace blink { | 46 namespace blink { |
47 | 47 |
48 class RepeatEvent FINAL : public Event { | 48 class RepeatEvent final : public Event { |
49 public: | 49 public: |
50 static PassRefPtrWillBeRawPtr<RepeatEvent> create(const AtomicString& type,
int repeat) | 50 static PassRefPtrWillBeRawPtr<RepeatEvent> create(const AtomicString& type,
int repeat) |
51 { | 51 { |
52 return adoptRefWillBeNoop(new RepeatEvent(type, false, false, repeat)); | 52 return adoptRefWillBeNoop(new RepeatEvent(type, false, false, repeat)); |
53 } | 53 } |
54 | 54 |
55 virtual ~RepeatEvent() { } | 55 virtual ~RepeatEvent() { } |
56 | 56 |
57 int repeat() const { return m_repeat; } | 57 int repeat() const { return m_repeat; } |
58 | 58 |
59 virtual void trace(Visitor* visitor) OVERRIDE | 59 virtual void trace(Visitor* visitor) override |
60 { | 60 { |
61 Event::trace(visitor); | 61 Event::trace(visitor); |
62 } | 62 } |
63 | 63 |
64 protected: | 64 protected: |
65 RepeatEvent(const AtomicString& type, bool canBubble, bool cancelable, int r
epeat = -1) | 65 RepeatEvent(const AtomicString& type, bool canBubble, bool cancelable, int r
epeat = -1) |
66 : Event(type, canBubble, cancelable) | 66 : Event(type, canBubble, cancelable) |
67 , m_repeat(repeat) | 67 , m_repeat(repeat) |
68 { | 68 { |
69 } | 69 } |
(...skipping 28 matching lines...) Expand all Loading... |
98 | 98 |
99 static SMILEventSender& smilRepeatNEventSender() | 99 static SMILEventSender& smilRepeatNEventSender() |
100 { | 100 { |
101 DEFINE_STATIC_LOCAL(SMILEventSender, sender, (AtomicString("repeatn", Atomic
String::ConstructFromLiteral))); | 101 DEFINE_STATIC_LOCAL(SMILEventSender, sender, (AtomicString("repeatn", Atomic
String::ConstructFromLiteral))); |
102 return sender; | 102 return sender; |
103 } | 103 } |
104 | 104 |
105 // This is used for duration type time values that can't be negative. | 105 // This is used for duration type time values that can't be negative. |
106 static const double invalidCachedTime = -1.; | 106 static const double invalidCachedTime = -1.; |
107 | 107 |
108 class ConditionEventListener FINAL : public EventListener { | 108 class ConditionEventListener final : public EventListener { |
109 public: | 109 public: |
110 static PassRefPtr<ConditionEventListener> create(SVGSMILElement* animation,
SVGSMILElement::Condition* condition) | 110 static PassRefPtr<ConditionEventListener> create(SVGSMILElement* animation,
SVGSMILElement::Condition* condition) |
111 { | 111 { |
112 return adoptRef(new ConditionEventListener(animation, condition)); | 112 return adoptRef(new ConditionEventListener(animation, condition)); |
113 } | 113 } |
114 | 114 |
115 static const ConditionEventListener* cast(const EventListener* listener) | 115 static const ConditionEventListener* cast(const EventListener* listener) |
116 { | 116 { |
117 return listener->type() == ConditionEventListenerType | 117 return listener->type() == ConditionEventListenerType |
118 ? static_cast<const ConditionEventListener*>(listener) | 118 ? static_cast<const ConditionEventListener*>(listener) |
119 : 0; | 119 : 0; |
120 } | 120 } |
121 | 121 |
122 virtual bool operator==(const EventListener& other) OVERRIDE; | 122 virtual bool operator==(const EventListener& other) override; |
123 | 123 |
124 void disconnectAnimation() | 124 void disconnectAnimation() |
125 { | 125 { |
126 m_animation = 0; | 126 m_animation = 0; |
127 } | 127 } |
128 | 128 |
129 private: | 129 private: |
130 ConditionEventListener(SVGSMILElement* animation, SVGSMILElement::Condition*
condition) | 130 ConditionEventListener(SVGSMILElement* animation, SVGSMILElement::Condition*
condition) |
131 : EventListener(ConditionEventListenerType) | 131 : EventListener(ConditionEventListenerType) |
132 , m_animation(animation) | 132 , m_animation(animation) |
133 , m_condition(condition) | 133 , m_condition(condition) |
134 { | 134 { |
135 } | 135 } |
136 | 136 |
137 virtual void handleEvent(ExecutionContext*, Event*) OVERRIDE; | 137 virtual void handleEvent(ExecutionContext*, Event*) override; |
138 | 138 |
139 SVGSMILElement* m_animation; | 139 SVGSMILElement* m_animation; |
140 SVGSMILElement::Condition* m_condition; | 140 SVGSMILElement::Condition* m_condition; |
141 }; | 141 }; |
142 | 142 |
143 bool ConditionEventListener::operator==(const EventListener& listener) | 143 bool ConditionEventListener::operator==(const EventListener& listener) |
144 { | 144 { |
145 if (const ConditionEventListener* conditionEventListener = ConditionEventLis
tener::cast(&listener)) | 145 if (const ConditionEventListener* conditionEventListener = ConditionEventLis
tener::cast(&listener)) |
146 return m_animation == conditionEventListener->m_animation && m_condition
== conditionEventListener->m_condition; | 146 return m_animation == conditionEventListener->m_animation && m_condition
== conditionEventListener->m_condition; |
147 return false; | 147 return false; |
(...skipping 1214 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1362 #if ENABLE(OILPAN) | 1362 #if ENABLE(OILPAN) |
1363 visitor->trace(m_targetElement); | 1363 visitor->trace(m_targetElement); |
1364 visitor->trace(m_timeContainer); | 1364 visitor->trace(m_timeContainer); |
1365 visitor->trace(m_conditions); | 1365 visitor->trace(m_conditions); |
1366 visitor->trace(m_syncBaseDependents); | 1366 visitor->trace(m_syncBaseDependents); |
1367 #endif | 1367 #endif |
1368 SVGElement::trace(visitor); | 1368 SVGElement::trace(visitor); |
1369 } | 1369 } |
1370 | 1370 |
1371 } | 1371 } |
OLD | NEW |