| 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 1166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 // As the set here records SVGSMILElements on the stack, it is acceptable to | 1177 // As the set here records SVGSMILElements on the stack, it is acceptable to |
| 1178 // use a HashSet of untraced heap references -- any conservative GC which | 1178 // use a HashSet of untraced heap references -- any conservative GC which |
| 1179 // strikes before unwinding will find these elements on the stack. | 1179 // strikes before unwinding will find these elements on the stack. |
| 1180 DEFINE_STATIC_LOCAL(HashSet<UntracedMember<SVGSMILElement>>, loopBreaker, ()); | 1180 DEFINE_STATIC_LOCAL(HashSet<UntracedMember<SVGSMILElement>>, loopBreaker, ()); |
| 1181 if (!loopBreaker.insert(this).isNewEntry) | 1181 if (!loopBreaker.insert(this).isNewEntry) |
| 1182 return; | 1182 return; |
| 1183 | 1183 |
| 1184 for (SVGSMILElement* element : m_syncBaseDependents) | 1184 for (SVGSMILElement* element : m_syncBaseDependents) |
| 1185 element->createInstanceTimesFromSyncbase(this); | 1185 element->createInstanceTimesFromSyncbase(this); |
| 1186 | 1186 |
| 1187 loopBreaker.remove(this); | 1187 loopBreaker.erase(this); |
| 1188 } | 1188 } |
| 1189 | 1189 |
| 1190 void SVGSMILElement::createInstanceTimesFromSyncbase(SVGSMILElement* syncBase) { | 1190 void SVGSMILElement::createInstanceTimesFromSyncbase(SVGSMILElement* syncBase) { |
| 1191 // FIXME: To be really correct, this should handle updating exising interval | 1191 // FIXME: To be really correct, this should handle updating exising interval |
| 1192 // by changing the associated times instead of creating new ones. | 1192 // by changing the associated times instead of creating new ones. |
| 1193 for (unsigned n = 0; n < m_conditions.size(); ++n) { | 1193 for (unsigned n = 0; n < m_conditions.size(); ++n) { |
| 1194 Condition* condition = m_conditions[n].get(); | 1194 Condition* condition = m_conditions[n].get(); |
| 1195 if (condition->getType() == Condition::Syncbase && | 1195 if (condition->getType() == Condition::Syncbase && |
| 1196 condition->syncBase() == syncBase) { | 1196 condition->syncBase() == syncBase) { |
| 1197 ASSERT(condition->name() == "begin" || condition->name() == "end"); | 1197 ASSERT(condition->name() == "begin" || condition->name() == "end"); |
| (...skipping 17 matching lines...) Expand all Loading... |
| 1215 } | 1215 } |
| 1216 } | 1216 } |
| 1217 | 1217 |
| 1218 void SVGSMILElement::addSyncBaseDependent(SVGSMILElement* animation) { | 1218 void SVGSMILElement::addSyncBaseDependent(SVGSMILElement* animation) { |
| 1219 m_syncBaseDependents.insert(animation); | 1219 m_syncBaseDependents.insert(animation); |
| 1220 if (m_interval.begin.isFinite()) | 1220 if (m_interval.begin.isFinite()) |
| 1221 animation->createInstanceTimesFromSyncbase(this); | 1221 animation->createInstanceTimesFromSyncbase(this); |
| 1222 } | 1222 } |
| 1223 | 1223 |
| 1224 void SVGSMILElement::removeSyncBaseDependent(SVGSMILElement* animation) { | 1224 void SVGSMILElement::removeSyncBaseDependent(SVGSMILElement* animation) { |
| 1225 m_syncBaseDependents.remove(animation); | 1225 m_syncBaseDependents.erase(animation); |
| 1226 } | 1226 } |
| 1227 | 1227 |
| 1228 void SVGSMILElement::handleConditionEvent(Event* event, Condition* condition) { | 1228 void SVGSMILElement::handleConditionEvent(Event* event, Condition* condition) { |
| 1229 if (event->type() == "repeatn" && | 1229 if (event->type() == "repeatn" && |
| 1230 toRepeatEvent(event)->repeat() != condition->repeat()) | 1230 toRepeatEvent(event)->repeat() != condition->repeat()) |
| 1231 return; | 1231 return; |
| 1232 | 1232 |
| 1233 SMILTime elapsed = this->elapsed(); | 1233 SMILTime elapsed = this->elapsed(); |
| 1234 if (elapsed.isUnresolved()) | 1234 if (elapsed.isUnresolved()) |
| 1235 return; | 1235 return; |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 DEFINE_TRACE(SVGSMILElement) { | 1311 DEFINE_TRACE(SVGSMILElement) { |
| 1312 visitor->trace(m_targetElement); | 1312 visitor->trace(m_targetElement); |
| 1313 visitor->trace(m_timeContainer); | 1313 visitor->trace(m_timeContainer); |
| 1314 visitor->trace(m_conditions); | 1314 visitor->trace(m_conditions); |
| 1315 visitor->trace(m_syncBaseDependents); | 1315 visitor->trace(m_syncBaseDependents); |
| 1316 SVGElement::trace(visitor); | 1316 SVGElement::trace(visitor); |
| 1317 SVGTests::trace(visitor); | 1317 SVGTests::trace(visitor); |
| 1318 } | 1318 } |
| 1319 | 1319 |
| 1320 } // namespace blink | 1320 } // namespace blink |
| OLD | NEW |