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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
203 #if !ENABLE(OILPAN) | 203 #if !ENABLE(OILPAN) |
204 clearConditions(); | 204 clearConditions(); |
205 | 205 |
206 if (m_timeContainer && m_targetElement && hasValidAttributeName()) | 206 if (m_timeContainer && m_targetElement && hasValidAttributeName()) |
207 m_timeContainer->unschedule(this, m_targetElement, m_attributeName); | 207 m_timeContainer->unschedule(this, m_targetElement, m_attributeName); |
208 #endif | 208 #endif |
209 } | 209 } |
210 | 210 |
211 void SVGSMILElement::clearResourceAndEventBaseReferences() | 211 void SVGSMILElement::clearResourceAndEventBaseReferences() |
212 { | 212 { |
213 document().accessSVGExtensions().removeAllTargetReferencesForElement(this); | 213 removeAllOutgoingReferences(); |
214 } | 214 } |
215 | 215 |
216 void SVGSMILElement::clearConditions() | 216 void SVGSMILElement::clearConditions() |
217 { | 217 { |
218 disconnectSyncBaseConditions(); | 218 disconnectSyncBaseConditions(); |
219 disconnectEventBaseConditions(); | 219 disconnectEventBaseConditions(); |
220 m_conditions.clear(); | 220 m_conditions.clear(); |
221 } | 221 } |
222 | 222 |
223 void SVGSMILElement::buildPendingResource() | 223 void SVGSMILElement::buildPendingResource() |
(...skipping 26 matching lines...) Expand all Loading... |
250 if (document().accessSVGExtensions().isElementPendingResource(this, id)) | 250 if (document().accessSVGExtensions().isElementPendingResource(this, id)) |
251 return; | 251 return; |
252 | 252 |
253 if (!id.isEmpty()) { | 253 if (!id.isEmpty()) { |
254 document().accessSVGExtensions().addPendingResource(id, this); | 254 document().accessSVGExtensions().addPendingResource(id, this); |
255 ASSERT(hasPendingResources()); | 255 ASSERT(hasPendingResources()); |
256 } | 256 } |
257 } else { | 257 } else { |
258 // Register us with the target in the dependencies map. Any change of hr
efElement | 258 // Register us with the target in the dependencies map. Any change of hr
efElement |
259 // that leads to relayout/repainting now informs us, so we can react to
it. | 259 // that leads to relayout/repainting now informs us, so we can react to
it. |
260 document().accessSVGExtensions().addElementReferencingTarget(this, svgTa
rget); | 260 addReferenceTo(svgTarget); |
261 } | 261 } |
262 connectEventBaseConditions(); | 262 connectEventBaseConditions(); |
263 } | 263 } |
264 | 264 |
265 static inline QualifiedName constructQualifiedName(const SVGElement* svgElement,
const AtomicString& attributeName) | 265 static inline QualifiedName constructQualifiedName(const SVGElement* svgElement,
const AtomicString& attributeName) |
266 { | 266 { |
267 ASSERT(svgElement); | 267 ASSERT(svgElement); |
268 if (attributeName.isEmpty()) | 268 if (attributeName.isEmpty()) |
269 return anyQName(); | 269 return anyQName(); |
270 if (!attributeName.contains(':')) | 270 if (!attributeName.contains(':')) |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 ASSERT(!condition->syncBase()); | 633 ASSERT(!condition->syncBase()); |
634 SVGElement* eventBase = eventBaseFor(*condition); | 634 SVGElement* eventBase = eventBaseFor(*condition); |
635 if (!eventBase) { | 635 if (!eventBase) { |
636 if (!condition->baseID().isEmpty() && !document().accessSVGExten
sions().isElementPendingResource(this, AtomicString(condition->baseID()))) | 636 if (!condition->baseID().isEmpty() && !document().accessSVGExten
sions().isElementPendingResource(this, AtomicString(condition->baseID()))) |
637 document().accessSVGExtensions().addPendingResource(AtomicSt
ring(condition->baseID()), this); | 637 document().accessSVGExtensions().addPendingResource(AtomicSt
ring(condition->baseID()), this); |
638 continue; | 638 continue; |
639 } | 639 } |
640 ASSERT(!condition->eventListener()); | 640 ASSERT(!condition->eventListener()); |
641 condition->setEventListener(ConditionEventListener::create(this, con
dition)); | 641 condition->setEventListener(ConditionEventListener::create(this, con
dition)); |
642 eventBase->addEventListener(AtomicString(condition->name()), conditi
on->eventListener(), false); | 642 eventBase->addEventListener(AtomicString(condition->name()), conditi
on->eventListener(), false); |
643 document().accessSVGExtensions().addElementReferencingTarget(this, e
ventBase); | 643 addReferenceTo(eventBase); |
644 } | 644 } |
645 } | 645 } |
646 } | 646 } |
647 | 647 |
648 void SVGSMILElement::disconnectEventBaseConditions() | 648 void SVGSMILElement::disconnectEventBaseConditions() |
649 { | 649 { |
650 for (unsigned n = 0; n < m_conditions.size(); ++n) { | 650 for (unsigned n = 0; n < m_conditions.size(); ++n) { |
651 Condition* condition = m_conditions[n].get(); | 651 Condition* condition = m_conditions[n].get(); |
652 if (condition->type() == Condition::EventBase) { | 652 if (condition->type() == Condition::EventBase) { |
653 ASSERT(!condition->syncBase()); | 653 ASSERT(!condition->syncBase()); |
(...skipping 690 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1344 void SVGSMILElement::trace(Visitor* visitor) | 1344 void SVGSMILElement::trace(Visitor* visitor) |
1345 { | 1345 { |
1346 visitor->trace(m_targetElement); | 1346 visitor->trace(m_targetElement); |
1347 visitor->trace(m_timeContainer); | 1347 visitor->trace(m_timeContainer); |
1348 visitor->trace(m_conditions); | 1348 visitor->trace(m_conditions); |
1349 visitor->trace(m_syncBaseDependents); | 1349 visitor->trace(m_syncBaseDependents); |
1350 SVGElement::trace(visitor); | 1350 SVGElement::trace(visitor); |
1351 } | 1351 } |
1352 | 1352 |
1353 } | 1353 } |
OLD | NEW |