OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. | 3 * Copyright (C) Research In Motion Limited 2010. All rights reserved. |
4 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved. | 4 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
11 * This library is distributed in the hope that it will be useful, | 11 * This library is distributed in the hope that it will be useful, |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 12 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | 13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
14 * Library General Public License for more details. | 14 * Library General Public License for more details. |
15 * | 15 * |
16 * You should have received a copy of the GNU Library General Public License | 16 * You should have received a copy of the GNU Library General Public License |
17 * along with this library; see the file COPYING.LIB. If not, write to | 17 * along with this library; see the file COPYING.LIB. If not, write to |
18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 18 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
19 * Boston, MA 02110-1301, USA. | 19 * Boston, MA 02110-1301, USA. |
20 */ | 20 */ |
21 | 21 |
22 #include "config.h" | 22 #include "config.h" |
23 | 23 |
24 #include "core/svg/SVGElementInstance.h" | 24 #include "core/svg/SVGElementInstance.h" |
25 | 25 |
26 #include "core/dom/ContainerNodeAlgorithms.h" | 26 #include "core/dom/ContainerNodeAlgorithms.h" |
27 #include "core/events/Event.h" | 27 #include "core/events/Event.h" |
28 #include "core/events/EventListener.h" | 28 #include "core/events/EventListener.h" |
| 29 #include "core/svg/SVGDocumentExtensions.h" |
29 #include "core/svg/SVGElement.h" | 30 #include "core/svg/SVGElement.h" |
30 #include "core/svg/SVGUseElement.h" | 31 #include "core/svg/SVGUseElement.h" |
31 | 32 |
32 #include "wtf/RefCountedLeakCounter.h" | 33 #include "wtf/RefCountedLeakCounter.h" |
33 | 34 |
34 namespace WebCore { | 35 namespace WebCore { |
35 | 36 |
36 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, instanceCounter, ("WebCoreS
VGElementInstance")); | 37 DEFINE_DEBUG_ONLY_GLOBAL(WTF::RefCountedLeakCounter, instanceCounter, ("WebCoreS
VGElementInstance")); |
37 | 38 |
38 // EventTarget API | 39 // EventTarget API |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 137 |
137 for (SVGElementInstance* node = firstChild(); node; node = node->nextSibling
()) | 138 for (SVGElementInstance* node = firstChild(); node; node = node->nextSibling
()) |
138 node->detach(); | 139 node->detach(); |
139 | 140 |
140 // Deregister as instance for passed element, if we haven't already. | 141 // Deregister as instance for passed element, if we haven't already. |
141 if (shadowTreeElement() && m_element->instancesForElement().contains(shadowT
reeElement())) | 142 if (shadowTreeElement() && m_element->instancesForElement().contains(shadowT
reeElement())) |
142 m_element->removeInstanceMapping(shadowTreeElement()); | 143 m_element->removeInstanceMapping(shadowTreeElement()); |
143 | 144 |
144 m_shadowTreeElement = nullptr; | 145 m_shadowTreeElement = nullptr; |
145 | 146 |
| 147 // SMIL animations need to be restarted in order to exclude |shadowTreeEleme
nt()|. |
| 148 m_element->document().accessSVGExtensions().rebuildSMILElementReferencesForT
arget(m_element.get()); |
| 149 |
146 m_directUseElement = nullptr; | 150 m_directUseElement = nullptr; |
147 m_correspondingUseElement = nullptr; | 151 m_correspondingUseElement = nullptr; |
148 | 152 |
149 #if !ENABLE(OILPAN) | 153 #if !ENABLE(OILPAN) |
150 removeDetachedChildrenInContainer<SVGElementInstance, SVGElementInstance>(*t
his); | 154 removeDetachedChildrenInContainer<SVGElementInstance, SVGElementInstance>(*t
his); |
151 #endif | 155 #endif |
152 } | 156 } |
153 | 157 |
154 void SVGElementInstance::setShadowTreeElement(SVGElement* element) | 158 void SVGElementInstance::setShadowTreeElement(SVGElement* element) |
155 { | 159 { |
156 ASSERT(element); | 160 ASSERT(element); |
157 m_shadowTreeElement = element; | 161 m_shadowTreeElement = element; |
158 // Register as instance for passed element. | 162 // Register as instance for passed element. |
159 m_element->mapInstanceToElement(shadowTreeElement()); | 163 m_element->mapInstanceToElement(shadowTreeElement()); |
160 | 164 |
| 165 // SMIL animations need to be restarted in order to include |shadowTreeEleme
nt()|. |
| 166 m_element->document().accessSVGExtensions().rebuildSMILElementReferencesForT
arget(m_element.get()); |
161 } | 167 } |
162 | 168 |
163 void SVGElementInstance::appendChild(PassRefPtr<SVGElementInstance> child) | 169 void SVGElementInstance::appendChild(PassRefPtr<SVGElementInstance> child) |
164 { | 170 { |
165 appendChildToContainer<SVGElementInstance, SVGElementInstance>(*child, *this
); | 171 appendChildToContainer<SVGElementInstance, SVGElementInstance>(*child, *this
); |
166 } | 172 } |
167 | 173 |
168 const AtomicString& SVGElementInstance::interfaceName() const | 174 const AtomicString& SVGElementInstance::interfaceName() const |
169 { | 175 { |
170 return EventTargetNames::SVGElementInstance; | 176 return EventTargetNames::SVGElementInstance; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 visitor->trace(m_directUseElement); | 236 visitor->trace(m_directUseElement); |
231 visitor->trace(m_element); | 237 visitor->trace(m_element); |
232 visitor->trace(m_shadowTreeElement); | 238 visitor->trace(m_shadowTreeElement); |
233 visitor->trace(m_previousSibling); | 239 visitor->trace(m_previousSibling); |
234 visitor->trace(m_nextSibling); | 240 visitor->trace(m_nextSibling); |
235 visitor->trace(m_firstChild); | 241 visitor->trace(m_firstChild); |
236 visitor->trace(m_lastChild); | 242 visitor->trace(m_lastChild); |
237 } | 243 } |
238 | 244 |
239 } | 245 } |
OLD | NEW |