OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007, 2008 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 * | 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 13 matching lines...) Expand all Loading... |
24 | 24 |
25 #include "SVGNames.h" | 25 #include "SVGNames.h" |
26 #include "core/rendering/svg/RenderSVGHiddenContainer.h" | 26 #include "core/rendering/svg/RenderSVGHiddenContainer.h" |
27 #include "core/rendering/svg/RenderSVGResource.h" | 27 #include "core/rendering/svg/RenderSVGResource.h" |
28 #include "core/rendering/svg/RenderSVGTransformableContainer.h" | 28 #include "core/rendering/svg/RenderSVGTransformableContainer.h" |
29 #include "core/svg/SVGElementInstance.h" | 29 #include "core/svg/SVGElementInstance.h" |
30 | 30 |
31 namespace WebCore { | 31 namespace WebCore { |
32 | 32 |
33 // Animated property definitions | 33 // Animated property definitions |
34 DEFINE_ANIMATED_BOOLEAN(SVGGElement, SVGNames::externalResourcesRequiredAttr, Ex
ternalResourcesRequired, externalResourcesRequired) | |
35 | 34 |
36 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGGElement) | 35 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGGElement) |
37 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | |
38 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) | 36 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) |
39 END_REGISTER_ANIMATED_PROPERTIES | 37 END_REGISTER_ANIMATED_PROPERTIES |
40 | 38 |
41 SVGGElement::SVGGElement(Document& document, ConstructionType constructionType) | 39 SVGGElement::SVGGElement(Document& document, ConstructionType constructionType) |
42 : SVGGraphicsElement(SVGNames::gTag, document, constructionType) | 40 : SVGGraphicsElement(SVGNames::gTag, document, constructionType) |
43 { | 41 { |
44 ScriptWrappable::init(this); | 42 ScriptWrappable::init(this); |
45 registerAnimatedPropertiesForSVGGElement(); | 43 registerAnimatedPropertiesForSVGGElement(); |
46 } | 44 } |
47 | 45 |
48 PassRefPtr<SVGGElement> SVGGElement::create(Document& document) | 46 PassRefPtr<SVGGElement> SVGGElement::create(Document& document) |
49 { | 47 { |
50 return adoptRef(new SVGGElement(document)); | 48 return adoptRef(new SVGGElement(document)); |
51 } | 49 } |
52 | 50 |
53 bool SVGGElement::isSupportedAttribute(const QualifiedName& attrName) | 51 bool SVGGElement::isSupportedAttribute(const QualifiedName& attrName) |
54 { | 52 { |
55 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 53 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
56 if (supportedAttributes.isEmpty()) | |
57 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | |
58 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 54 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
59 } | 55 } |
60 | 56 |
61 void SVGGElement::parseAttribute(const QualifiedName& name, const AtomicString&
value) | 57 void SVGGElement::parseAttribute(const QualifiedName& name, const AtomicString&
value) |
62 { | 58 { |
63 if (!isSupportedAttribute(name)) { | 59 if (!isSupportedAttribute(name)) { |
64 SVGGraphicsElement::parseAttribute(name, value); | 60 SVGGraphicsElement::parseAttribute(name, value); |
65 return; | 61 return; |
66 } else if (SVGExternalResourcesRequired::parseAttribute(name, value)) { | |
67 return; | |
68 } | 62 } |
69 | 63 |
70 ASSERT_NOT_REACHED(); | 64 ASSERT_NOT_REACHED(); |
71 } | 65 } |
72 | 66 |
73 void SVGGElement::svgAttributeChanged(const QualifiedName& attrName) | 67 void SVGGElement::svgAttributeChanged(const QualifiedName& attrName) |
74 { | 68 { |
75 if (!isSupportedAttribute(attrName)) { | 69 if (!isSupportedAttribute(attrName)) { |
76 SVGGraphicsElement::svgAttributeChanged(attrName); | 70 SVGGraphicsElement::svgAttributeChanged(attrName); |
77 return; | 71 return; |
(...skipping 18 matching lines...) Expand all Loading... |
96 } | 90 } |
97 | 91 |
98 bool SVGGElement::rendererIsNeeded(const RenderStyle&) | 92 bool SVGGElement::rendererIsNeeded(const RenderStyle&) |
99 { | 93 { |
100 // Unlike SVGElement::rendererIsNeeded(), we still create renderers, even if | 94 // Unlike SVGElement::rendererIsNeeded(), we still create renderers, even if |
101 // display is set to 'none' - which is special to SVG <g> container elements
. | 95 // display is set to 'none' - which is special to SVG <g> container elements
. |
102 return parentOrShadowHostElement() && parentOrShadowHostElement()->isSVGElem
ent(); | 96 return parentOrShadowHostElement() && parentOrShadowHostElement()->isSVGElem
ent(); |
103 } | 97 } |
104 | 98 |
105 } | 99 } |
OLD | NEW |