| 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 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 ~RepeatEvent() override {} |
| 56 | 56 |
| 57 int repeat() const { return m_repeat; } | 57 int repeat() const { return m_repeat; } |
| 58 | 58 |
| 59 DEFINE_INLINE_VIRTUAL_TRACE() | 59 DEFINE_INLINE_VIRTUAL_TRACE() |
| 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) |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 : nullptr; | 119 : nullptr; |
| 120 } | 120 } |
| 121 | 121 |
| 122 virtual bool operator==(const EventListener& other) override; | 122 bool operator==(const EventListener& other) override; |
| 123 | 123 |
| 124 void disconnectAnimation() | 124 void disconnectAnimation() |
| 125 { | 125 { |
| 126 m_animation = nullptr; | 126 m_animation = nullptr; |
| 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 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 1206 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1354 visitor->trace(m_targetElement); | 1354 visitor->trace(m_targetElement); |
| 1355 visitor->trace(m_timeContainer); | 1355 visitor->trace(m_timeContainer); |
| 1356 visitor->trace(m_conditions); | 1356 visitor->trace(m_conditions); |
| 1357 visitor->trace(m_syncBaseDependents); | 1357 visitor->trace(m_syncBaseDependents); |
| 1358 #endif | 1358 #endif |
| 1359 SVGElement::trace(visitor); | 1359 SVGElement::trace(visitor); |
| 1360 SVGTests::trace(visitor); | 1360 SVGTests::trace(visitor); |
| 1361 } | 1361 } |
| 1362 | 1362 |
| 1363 } // namespace blink | 1363 } // namespace blink |
| OLD | NEW |