| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
| 3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2007 Rob Buis <buis@kde.org> |
| 4 * | 4 * |
| 5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
| 6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
| 7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
| 8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
| 9 * | 9 * |
| 10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 | 36 |
| 37 // Animated property definitions | 37 // Animated property definitions |
| 38 DEFINE_ANIMATED_STRING(SVGScriptElement, XLinkNames::hrefAttr, Href, href) | 38 DEFINE_ANIMATED_STRING(SVGScriptElement, XLinkNames::hrefAttr, Href, href) |
| 39 DEFINE_ANIMATED_BOOLEAN(SVGScriptElement, SVGNames::externalResourcesRequiredAtt
r, ExternalResourcesRequired, externalResourcesRequired) | 39 DEFINE_ANIMATED_BOOLEAN(SVGScriptElement, SVGNames::externalResourcesRequiredAtt
r, ExternalResourcesRequired, externalResourcesRequired) |
| 40 | 40 |
| 41 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGScriptElement) | 41 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGScriptElement) |
| 42 REGISTER_LOCAL_ANIMATED_PROPERTY(href) | 42 REGISTER_LOCAL_ANIMATED_PROPERTY(href) |
| 43 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | 43 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) |
| 44 END_REGISTER_ANIMATED_PROPERTIES | 44 END_REGISTER_ANIMATED_PROPERTIES |
| 45 | 45 |
| 46 inline SVGScriptElement::SVGScriptElement(const QualifiedName& tagName, Document
& document, bool wasInsertedByParser, bool alreadyStarted) | 46 inline SVGScriptElement::SVGScriptElement(Document& document, bool wasInsertedBy
Parser, bool alreadyStarted) |
| 47 : SVGElement(tagName, document) | 47 : SVGElement(SVGNames::scriptTag, document) |
| 48 , m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired) | 48 , m_svgLoadEventTimer(this, &SVGElement::svgLoadEventTimerFired) |
| 49 , m_loader(ScriptLoader::create(this, wasInsertedByParser, alreadyStarted)) | 49 , m_loader(ScriptLoader::create(this, wasInsertedByParser, alreadyStarted)) |
| 50 { | 50 { |
| 51 ASSERT(hasTagName(SVGNames::scriptTag)); | |
| 52 ScriptWrappable::init(this); | 51 ScriptWrappable::init(this); |
| 53 registerAnimatedPropertiesForSVGScriptElement(); | 52 registerAnimatedPropertiesForSVGScriptElement(); |
| 54 } | 53 } |
| 55 | 54 |
| 56 PassRefPtr<SVGScriptElement> SVGScriptElement::create(const QualifiedName& tagNa
me, Document& document, bool insertedByParser) | 55 PassRefPtr<SVGScriptElement> SVGScriptElement::create(Document& document, bool i
nsertedByParser) |
| 57 { | 56 { |
| 58 return adoptRef(new SVGScriptElement(tagName, document, insertedByParser, fa
lse)); | 57 return adoptRef(new SVGScriptElement(document, insertedByParser, false)); |
| 59 } | 58 } |
| 60 | 59 |
| 61 bool SVGScriptElement::isSupportedAttribute(const QualifiedName& attrName) | 60 bool SVGScriptElement::isSupportedAttribute(const QualifiedName& attrName) |
| 62 { | 61 { |
| 63 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 62 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 64 if (supportedAttributes.isEmpty()) { | 63 if (supportedAttributes.isEmpty()) { |
| 65 SVGURIReference::addSupportedAttributes(supportedAttributes); | 64 SVGURIReference::addSupportedAttributes(supportedAttributes); |
| 66 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | 65 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); |
| 67 supportedAttributes.add(SVGNames::typeAttr); | 66 supportedAttributes.add(SVGNames::typeAttr); |
| 68 supportedAttributes.add(HTMLNames::onerrorAttr); | 67 supportedAttributes.add(HTMLNames::onerrorAttr); |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 return false; | 203 return false; |
| 205 } | 204 } |
| 206 | 205 |
| 207 bool SVGScriptElement::hasSourceAttribute() const | 206 bool SVGScriptElement::hasSourceAttribute() const |
| 208 { | 207 { |
| 209 return hasAttribute(XLinkNames::hrefAttr); | 208 return hasAttribute(XLinkNames::hrefAttr); |
| 210 } | 209 } |
| 211 | 210 |
| 212 PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren() | 211 PassRefPtr<Element> SVGScriptElement::cloneElementWithoutAttributesAndChildren() |
| 213 { | 212 { |
| 214 return adoptRef(new SVGScriptElement(tagQName(), document(), false, m_loader
->alreadyStarted())); | 213 return adoptRef(new SVGScriptElement(document(), false, m_loader->alreadySta
rted())); |
| 215 } | 214 } |
| 216 | 215 |
| 217 void SVGScriptElement::setHaveFiredLoadEvent(bool haveFiredLoadEvent) | 216 void SVGScriptElement::setHaveFiredLoadEvent(bool haveFiredLoadEvent) |
| 218 { | 217 { |
| 219 m_loader->setHaveFiredLoadEvent(haveFiredLoadEvent); | 218 m_loader->setHaveFiredLoadEvent(haveFiredLoadEvent); |
| 220 } | 219 } |
| 221 | 220 |
| 222 bool SVGScriptElement::isParserInserted() const | 221 bool SVGScriptElement::isParserInserted() const |
| 223 { | 222 { |
| 224 return m_loader->isParserInserted(); | 223 return m_loader->isParserInserted(); |
| 225 } | 224 } |
| 226 | 225 |
| 227 bool SVGScriptElement::haveFiredLoadEvent() const | 226 bool SVGScriptElement::haveFiredLoadEvent() const |
| 228 { | 227 { |
| 229 return m_loader->haveFiredLoadEvent(); | 228 return m_loader->haveFiredLoadEvent(); |
| 230 } | 229 } |
| 231 | 230 |
| 232 Timer<SVGElement>* SVGScriptElement::svgLoadEventTimer() | 231 Timer<SVGElement>* SVGScriptElement::svgLoadEventTimer() |
| 233 { | 232 { |
| 234 return &m_svgLoadEventTimer; | 233 return &m_svgLoadEventTimer; |
| 235 } | 234 } |
| 236 | 235 |
| 237 } | 236 } |
| OLD | NEW |