| 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 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 | 202 |
| 203 if (svgTarget && !svgTarget->isConnected()) | 203 if (svgTarget && !svgTarget->isConnected()) |
| 204 svgTarget = nullptr; | 204 svgTarget = nullptr; |
| 205 | 205 |
| 206 if (svgTarget != targetElement()) | 206 if (svgTarget != targetElement()) |
| 207 setTargetElement(svgTarget); | 207 setTargetElement(svgTarget); |
| 208 | 208 |
| 209 if (!svgTarget) { | 209 if (!svgTarget) { |
| 210 // Do not register as pending if we are already pending this resource. | 210 // Do not register as pending if we are already pending this resource. |
| 211 if (treeScope().ensureSVGTreeScopedResources().isElementPendingResource( | 211 if (treeScope().ensureSVGTreeScopedResources().isElementPendingResource( |
| 212 this, id)) | 212 *this, id)) |
| 213 return; | 213 return; |
| 214 if (!id.isEmpty()) { | 214 if (!id.isEmpty()) { |
| 215 treeScope().ensureSVGTreeScopedResources().addPendingResource(id, this); | 215 treeScope().ensureSVGTreeScopedResources().addPendingResource(id, *this); |
| 216 DCHECK(hasPendingResources()); | 216 DCHECK(hasPendingResources()); |
| 217 } | 217 } |
| 218 } else { | 218 } else { |
| 219 // Register us with the target in the dependencies map. Any change of | 219 // Register us with the target in the dependencies map. Any change of |
| 220 // hrefElement that leads to relayout/repainting now informs us, so we can | 220 // hrefElement that leads to relayout/repainting now informs us, so we can |
| 221 // react to it. | 221 // react to it. |
| 222 addReferenceTo(svgTarget); | 222 addReferenceTo(svgTarget); |
| 223 } | 223 } |
| 224 connectEventBaseConditions(); | 224 connectEventBaseConditions(); |
| 225 } | 225 } |
| (...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 disconnectEventBaseConditions(); | 565 disconnectEventBaseConditions(); |
| 566 for (unsigned n = 0; n < m_conditions.size(); ++n) { | 566 for (unsigned n = 0; n < m_conditions.size(); ++n) { |
| 567 Condition* condition = m_conditions[n].get(); | 567 Condition* condition = m_conditions[n].get(); |
| 568 if (condition->getType() == Condition::EventBase) { | 568 if (condition->getType() == Condition::EventBase) { |
| 569 ASSERT(!condition->syncBase()); | 569 ASSERT(!condition->syncBase()); |
| 570 SVGElement* eventBase = eventBaseFor(*condition); | 570 SVGElement* eventBase = eventBaseFor(*condition); |
| 571 if (!eventBase) { | 571 if (!eventBase) { |
| 572 if (!condition->baseID().isEmpty() && | 572 if (!condition->baseID().isEmpty() && |
| 573 !treeScope() | 573 !treeScope() |
| 574 .ensureSVGTreeScopedResources() | 574 .ensureSVGTreeScopedResources() |
| 575 .isElementPendingResource(this, | 575 .isElementPendingResource(*this, |
| 576 AtomicString(condition->baseID()))) | 576 AtomicString(condition->baseID()))) { |
| 577 treeScope().ensureSVGTreeScopedResources().addPendingResource( | 577 treeScope().ensureSVGTreeScopedResources().addPendingResource( |
| 578 AtomicString(condition->baseID()), this); | 578 AtomicString(condition->baseID()), *this); |
| 579 } |
| 579 continue; | 580 continue; |
| 580 } | 581 } |
| 581 ASSERT(!condition->eventListener()); | 582 ASSERT(!condition->eventListener()); |
| 582 condition->setEventListener( | 583 condition->setEventListener( |
| 583 ConditionEventListener::create(this, condition)); | 584 ConditionEventListener::create(this, condition)); |
| 584 eventBase->addEventListener(AtomicString(condition->name()), | 585 eventBase->addEventListener(AtomicString(condition->name()), |
| 585 condition->eventListener(), false); | 586 condition->eventListener(), false); |
| 586 addReferenceTo(eventBase); | 587 addReferenceTo(eventBase); |
| 587 } | 588 } |
| 588 } | 589 } |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1311 DEFINE_TRACE(SVGSMILElement) { | 1312 DEFINE_TRACE(SVGSMILElement) { |
| 1312 visitor->trace(m_targetElement); | 1313 visitor->trace(m_targetElement); |
| 1313 visitor->trace(m_timeContainer); | 1314 visitor->trace(m_timeContainer); |
| 1314 visitor->trace(m_conditions); | 1315 visitor->trace(m_conditions); |
| 1315 visitor->trace(m_syncBaseDependents); | 1316 visitor->trace(m_syncBaseDependents); |
| 1316 SVGElement::trace(visitor); | 1317 SVGElement::trace(visitor); |
| 1317 SVGTests::trace(visitor); | 1318 SVGTests::trace(visitor); |
| 1318 } | 1319 } |
| 1319 | 1320 |
| 1320 } // namespace blink | 1321 } // namespace blink |
| OLD | NEW |