| 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 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> | 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> |
| 5 * Copyright (C) 2010 Apple Inc. All rights reserved. | 5 * Copyright (C) 2010 Apple Inc. All rights reserved. |
| 6 * | 6 * |
| 7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
| 8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
| 9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
| 10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 #include "platform/PlatformMouseEvent.h" | 50 #include "platform/PlatformMouseEvent.h" |
| 51 #include "platform/network/ResourceRequest.h" | 51 #include "platform/network/ResourceRequest.h" |
| 52 | 52 |
| 53 namespace WebCore { | 53 namespace WebCore { |
| 54 | 54 |
| 55 using namespace HTMLNames; | 55 using namespace HTMLNames; |
| 56 | 56 |
| 57 // Animated property definitions | 57 // Animated property definitions |
| 58 DEFINE_ANIMATED_STRING(SVGAElement, SVGNames::targetAttr, SVGTarget, svgTarget) | 58 DEFINE_ANIMATED_STRING(SVGAElement, SVGNames::targetAttr, SVGTarget, svgTarget) |
| 59 DEFINE_ANIMATED_STRING(SVGAElement, XLinkNames::hrefAttr, Href, href) | 59 DEFINE_ANIMATED_STRING(SVGAElement, XLinkNames::hrefAttr, Href, href) |
| 60 DEFINE_ANIMATED_BOOLEAN(SVGAElement, SVGNames::externalResourcesRequiredAttr, Ex
ternalResourcesRequired, externalResourcesRequired) | |
| 61 | 60 |
| 62 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAElement) | 61 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAElement) |
| 63 REGISTER_LOCAL_ANIMATED_PROPERTY(svgTarget) | 62 REGISTER_LOCAL_ANIMATED_PROPERTY(svgTarget) |
| 64 REGISTER_LOCAL_ANIMATED_PROPERTY(href) | 63 REGISTER_LOCAL_ANIMATED_PROPERTY(href) |
| 65 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | |
| 66 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) | 64 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) |
| 67 END_REGISTER_ANIMATED_PROPERTIES | 65 END_REGISTER_ANIMATED_PROPERTIES |
| 68 | 66 |
| 69 inline SVGAElement::SVGAElement(const QualifiedName& tagName, Document& document
) | 67 inline SVGAElement::SVGAElement(const QualifiedName& tagName, Document& document
) |
| 70 : SVGGraphicsElement(tagName, document) | 68 : SVGGraphicsElement(tagName, document) |
| 71 { | 69 { |
| 72 ASSERT(hasTagName(SVGNames::aTag)); | 70 ASSERT(hasTagName(SVGNames::aTag)); |
| 73 ScriptWrappable::init(this); | 71 ScriptWrappable::init(this); |
| 74 registerAnimatedPropertiesForSVGAElement(); | 72 registerAnimatedPropertiesForSVGAElement(); |
| 75 } | 73 } |
| (...skipping 12 matching lines...) Expand all Loading... |
| 88 | 86 |
| 89 // Otherwise, use the title of this element. | 87 // Otherwise, use the title of this element. |
| 90 return SVGElement::title(); | 88 return SVGElement::title(); |
| 91 } | 89 } |
| 92 | 90 |
| 93 bool SVGAElement::isSupportedAttribute(const QualifiedName& attrName) | 91 bool SVGAElement::isSupportedAttribute(const QualifiedName& attrName) |
| 94 { | 92 { |
| 95 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 93 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 96 if (supportedAttributes.isEmpty()) { | 94 if (supportedAttributes.isEmpty()) { |
| 97 SVGURIReference::addSupportedAttributes(supportedAttributes); | 95 SVGURIReference::addSupportedAttributes(supportedAttributes); |
| 98 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | |
| 99 supportedAttributes.add(SVGNames::targetAttr); | 96 supportedAttributes.add(SVGNames::targetAttr); |
| 100 } | 97 } |
| 101 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 98 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 102 } | 99 } |
| 103 | 100 |
| 104 void SVGAElement::parseAttribute(const QualifiedName& name, const AtomicString&
value) | 101 void SVGAElement::parseAttribute(const QualifiedName& name, const AtomicString&
value) |
| 105 { | 102 { |
| 106 if (!isSupportedAttribute(name)) { | 103 if (!isSupportedAttribute(name)) { |
| 107 SVGGraphicsElement::parseAttribute(name, value); | 104 SVGGraphicsElement::parseAttribute(name, value); |
| 108 return; | 105 return; |
| 109 } | 106 } |
| 110 | 107 |
| 111 if (name == SVGNames::targetAttr) { | 108 if (name == SVGNames::targetAttr) { |
| 112 setSVGTargetBaseValue(value); | 109 setSVGTargetBaseValue(value); |
| 113 return; | 110 return; |
| 114 } | 111 } |
| 115 | 112 |
| 116 if (SVGURIReference::parseAttribute(name, value)) | 113 if (SVGURIReference::parseAttribute(name, value)) |
| 117 return; | 114 return; |
| 118 if (SVGExternalResourcesRequired::parseAttribute(name, value)) | |
| 119 return; | |
| 120 | 115 |
| 121 ASSERT_NOT_REACHED(); | 116 ASSERT_NOT_REACHED(); |
| 122 } | 117 } |
| 123 | 118 |
| 124 void SVGAElement::svgAttributeChanged(const QualifiedName& attrName) | 119 void SVGAElement::svgAttributeChanged(const QualifiedName& attrName) |
| 125 { | 120 { |
| 126 if (!isSupportedAttribute(attrName)) { | 121 if (!isSupportedAttribute(attrName)) { |
| 127 SVGGraphicsElement::svgAttributeChanged(attrName); | 122 SVGGraphicsElement::svgAttributeChanged(attrName); |
| 128 return; | 123 return; |
| 129 } | 124 } |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 // The 'a' element may contain any element that its parent may contain, exce
pt itself. | 227 // The 'a' element may contain any element that its parent may contain, exce
pt itself. |
| 233 if (child.hasTagName(SVGNames::aTag)) | 228 if (child.hasTagName(SVGNames::aTag)) |
| 234 return false; | 229 return false; |
| 235 if (parentNode() && parentNode()->isSVGElement()) | 230 if (parentNode() && parentNode()->isSVGElement()) |
| 236 return parentNode()->childShouldCreateRenderer(child); | 231 return parentNode()->childShouldCreateRenderer(child); |
| 237 | 232 |
| 238 return SVGElement::childShouldCreateRenderer(child); | 233 return SVGElement::childShouldCreateRenderer(child); |
| 239 } | 234 } |
| 240 | 235 |
| 241 } // namespace WebCore | 236 } // namespace WebCore |
| OLD | NEW |