| 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 21 matching lines...) Expand all Loading... |
| 32 #include "core/dom/Document.h" | 32 #include "core/dom/Document.h" |
| 33 #include "core/events/Event.h" | 33 #include "core/events/Event.h" |
| 34 #include "core/events/EventListener.h" | 34 #include "core/events/EventListener.h" |
| 35 #include "core/events/EventSender.h" | 35 #include "core/events/EventSender.h" |
| 36 #include "core/frame/UseCounter.h" | 36 #include "core/frame/UseCounter.h" |
| 37 #include "core/svg/SVGDocumentExtensions.h" | 37 #include "core/svg/SVGDocumentExtensions.h" |
| 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 "platform/heap/Handle.h" |
| 42 #include "wtf/MathExtras.h" | 43 #include "wtf/MathExtras.h" |
| 43 #include "wtf/StdLibExtras.h" | 44 #include "wtf/StdLibExtras.h" |
| 44 #include "wtf/Vector.h" | 45 #include "wtf/Vector.h" |
| 45 | 46 |
| 46 namespace blink { | 47 namespace blink { |
| 47 | 48 |
| 48 class RepeatEvent final : public Event { | 49 class RepeatEvent final : public Event { |
| 49 public: | 50 public: |
| 50 static PassRefPtrWillBeRawPtr<RepeatEvent> create(const AtomicString& type,
int repeat) | 51 static PassRefPtrWillBeRawPtr<RepeatEvent> create(const AtomicString& type,
int repeat) |
| 51 { | 52 { |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 bool operator==(const EventListener& other) const override; | 123 bool operator==(const EventListener& other) const override; |
| 123 | 124 |
| 124 void disconnectAnimation() | 125 void disconnectAnimation() |
| 125 { | 126 { |
| 126 m_animation = nullptr; | 127 m_animation = nullptr; |
| 127 } | 128 } |
| 128 | 129 |
| 129 DEFINE_INLINE_VIRTUAL_TRACE() | 130 DEFINE_INLINE_VIRTUAL_TRACE() |
| 130 { | 131 { |
| 131 visitor->trace(m_animation); | 132 visitor->trace(m_animation); |
| 133 visitor->trace(m_condition); |
| 132 EventListener::trace(visitor); | 134 EventListener::trace(visitor); |
| 133 } | 135 } |
| 134 | 136 |
| 135 private: | 137 private: |
| 136 ConditionEventListener(SVGSMILElement* animation, SVGSMILElement::Condition*
condition) | 138 ConditionEventListener(SVGSMILElement* animation, SVGSMILElement::Condition*
condition) |
| 137 : EventListener(ConditionEventListenerType) | 139 : EventListener(ConditionEventListenerType) |
| 138 , m_animation(animation) | 140 , m_animation(animation) |
| 139 , m_condition(condition) | 141 , m_condition(condition) |
| 140 { | 142 { |
| 141 } | 143 } |
| 142 | 144 |
| 143 void handleEvent(ExecutionContext*, Event*) override; | 145 void handleEvent(ExecutionContext*, Event*) override; |
| 144 | 146 |
| 145 RawPtrWillBeMember<SVGSMILElement> m_animation; | 147 RawPtrWillBeMember<SVGSMILElement> m_animation; |
| 146 SVGSMILElement::Condition* m_condition; | 148 RawPtrWillBeMember<SVGSMILElement::Condition> m_condition; |
| 147 }; | 149 }; |
| 148 | 150 |
| 149 bool ConditionEventListener::operator==(const EventListener& listener) const | 151 bool ConditionEventListener::operator==(const EventListener& listener) const |
| 150 { | 152 { |
| 151 if (const ConditionEventListener* conditionEventListener = ConditionEventLis
tener::cast(&listener)) | 153 if (const ConditionEventListener* conditionEventListener = ConditionEventLis
tener::cast(&listener)) |
| 152 return m_animation == conditionEventListener->m_animation && m_condition
== conditionEventListener->m_condition; | 154 return m_animation == conditionEventListener->m_animation && m_condition
== conditionEventListener->m_condition; |
| 153 return false; | 155 return false; |
| 154 } | 156 } |
| 155 | 157 |
| 156 void ConditionEventListener::handleEvent(ExecutionContext*, Event* event) | 158 void ConditionEventListener::handleEvent(ExecutionContext*, Event* event) |
| (...skipping 1204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1361 visitor->trace(m_targetElement); | 1363 visitor->trace(m_targetElement); |
| 1362 visitor->trace(m_timeContainer); | 1364 visitor->trace(m_timeContainer); |
| 1363 visitor->trace(m_conditions); | 1365 visitor->trace(m_conditions); |
| 1364 visitor->trace(m_syncBaseDependents); | 1366 visitor->trace(m_syncBaseDependents); |
| 1365 #endif | 1367 #endif |
| 1366 SVGElement::trace(visitor); | 1368 SVGElement::trace(visitor); |
| 1367 SVGTests::trace(visitor); | 1369 SVGTests::trace(visitor); |
| 1368 } | 1370 } |
| 1369 | 1371 |
| 1370 } // namespace blink | 1372 } // namespace blink |
| OLD | NEW |