| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006 Rob Buis <buis@kde.org> |
| 4 * Copyright (C) Research In Motion Limited 2011. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2011. 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 * |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 160 // Remove active listeners and clear the text content. | 160 // Remove active listeners and clear the text content. |
| 161 m_targetListener->detach(); | 161 m_targetListener->detach(); |
| 162 | 162 |
| 163 userAgentShadowRoot()->removeChildren(); | 163 userAgentShadowRoot()->removeChildren(); |
| 164 | 164 |
| 165 if (!inDocument()) | 165 if (!inDocument()) |
| 166 return; | 166 return; |
| 167 | 167 |
| 168 // Mark the referenced ID as pending. | 168 // Mark the referenced ID as pending. |
| 169 String id; | 169 String id; |
| 170 SVGURIReference::targetElementFromIRIString(hrefCurrentValue(), document(),
&id); | 170 SVGURIReference::targetElementFromIRIString(hrefCurrentValue(), &document(),
&id); |
| 171 if (!id.isEmpty()) | 171 if (!id.isEmpty()) |
| 172 document()->accessSVGExtensions()->addPendingResource(id, this); | 172 document().accessSVGExtensions()->addPendingResource(id, this); |
| 173 } | 173 } |
| 174 | 174 |
| 175 bool SVGTRefElement::isSupportedAttribute(const QualifiedName& attrName) | 175 bool SVGTRefElement::isSupportedAttribute(const QualifiedName& attrName) |
| 176 { | 176 { |
| 177 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 177 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 178 if (supportedAttributes.isEmpty()) | 178 if (supportedAttributes.isEmpty()) |
| 179 SVGURIReference::addSupportedAttributes(supportedAttributes); | 179 SVGURIReference::addSupportedAttributes(supportedAttributes); |
| 180 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 180 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 181 } | 181 } |
| 182 | 182 |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 void SVGTRefElement::buildPendingResource() | 240 void SVGTRefElement::buildPendingResource() |
| 241 { | 241 { |
| 242 // Remove any existing event listener. | 242 // Remove any existing event listener. |
| 243 m_targetListener->detach(); | 243 m_targetListener->detach(); |
| 244 | 244 |
| 245 // If we're not yet in a document, this function will be called again from i
nsertedInto(). | 245 // If we're not yet in a document, this function will be called again from i
nsertedInto(). |
| 246 if (!inDocument()) | 246 if (!inDocument()) |
| 247 return; | 247 return; |
| 248 | 248 |
| 249 String id; | 249 String id; |
| 250 RefPtr<Element> target = SVGURIReference::targetElementFromIRIString(hrefCur
rentValue(), document(), &id); | 250 RefPtr<Element> target = SVGURIReference::targetElementFromIRIString(hrefCur
rentValue(), &document(), &id); |
| 251 if (!target.get()) { | 251 if (!target.get()) { |
| 252 if (id.isEmpty()) | 252 if (id.isEmpty()) |
| 253 return; | 253 return; |
| 254 | 254 |
| 255 document()->accessSVGExtensions()->addPendingResource(id, this); | 255 document().accessSVGExtensions()->addPendingResource(id, this); |
| 256 ASSERT(hasPendingResources()); | 256 ASSERT(hasPendingResources()); |
| 257 return; | 257 return; |
| 258 } | 258 } |
| 259 | 259 |
| 260 // Don't set up event listeners if this is a shadow tree node. | 260 // Don't set up event listeners if this is a shadow tree node. |
| 261 // SVGUseElement::transferEventListenersToShadowTree() handles this task, an
d addEventListener() | 261 // SVGUseElement::transferEventListenersToShadowTree() handles this task, an
d addEventListener() |
| 262 // expects every element instance to have an associated shadow tree element
- which is not the | 262 // expects every element instance to have an associated shadow tree element
- which is not the |
| 263 // case when we land here from SVGUseElement::buildShadowTree(). | 263 // case when we land here from SVGUseElement::buildShadowTree(). |
| 264 if (!isInShadowTree()) | 264 if (!isInShadowTree()) |
| 265 m_targetListener->attach(target); | 265 m_targetListener->attach(target); |
| (...skipping 10 matching lines...) Expand all Loading... |
| 276 } | 276 } |
| 277 | 277 |
| 278 void SVGTRefElement::removedFrom(ContainerNode* rootParent) | 278 void SVGTRefElement::removedFrom(ContainerNode* rootParent) |
| 279 { | 279 { |
| 280 SVGElement::removedFrom(rootParent); | 280 SVGElement::removedFrom(rootParent); |
| 281 if (rootParent->inDocument()) | 281 if (rootParent->inDocument()) |
| 282 m_targetListener->detach(); | 282 m_targetListener->detach(); |
| 283 } | 283 } |
| 284 | 284 |
| 285 } | 285 } |
| OLD | NEW |