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 * | 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 12 matching lines...) Expand all Loading... | |
23 #include "core/svg/SVGSymbolElement.h" | 23 #include "core/svg/SVGSymbolElement.h" |
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/svg/SVGElementInstance.h" | 27 #include "core/svg/SVGElementInstance.h" |
28 #include "core/svg/SVGFitToViewBox.h" | 28 #include "core/svg/SVGFitToViewBox.h" |
29 | 29 |
30 namespace WebCore { | 30 namespace WebCore { |
31 | 31 |
32 // Animated property definitions | 32 // Animated property definitions |
33 DEFINE_ANIMATED_BOOLEAN(SVGSymbolElement, SVGNames::externalResourcesRequiredAtt r, ExternalResourcesRequired, externalResourcesRequired) | |
34 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGSymbolElement, SVGNames::preserveAspectRa tioAttr, PreserveAspectRatio, preserveAspectRatio) | 33 DEFINE_ANIMATED_PRESERVEASPECTRATIO(SVGSymbolElement, SVGNames::preserveAspectRa tioAttr, PreserveAspectRatio, preserveAspectRatio) |
35 DEFINE_ANIMATED_RECT(SVGSymbolElement, SVGNames::viewBoxAttr, ViewBox, viewBox) | 34 DEFINE_ANIMATED_RECT(SVGSymbolElement, SVGNames::viewBoxAttr, ViewBox, viewBox) |
36 | 35 |
37 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGSymbolElement) | 36 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGSymbolElement) |
38 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | |
39 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) | 37 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) |
40 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) | 38 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) |
41 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) | 39 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) |
42 END_REGISTER_ANIMATED_PROPERTIES | 40 END_REGISTER_ANIMATED_PROPERTIES |
43 | 41 |
44 inline SVGSymbolElement::SVGSymbolElement(const QualifiedName& tagName, Document & document) | 42 inline SVGSymbolElement::SVGSymbolElement(const QualifiedName& tagName, Document & document) |
45 : SVGElement(tagName, document) | 43 : SVGElement(tagName, document) |
46 { | 44 { |
47 ASSERT(hasTagName(SVGNames::symbolTag)); | 45 ASSERT(hasTagName(SVGNames::symbolTag)); |
48 ScriptWrappable::init(this); | 46 ScriptWrappable::init(this); |
49 registerAnimatedPropertiesForSVGSymbolElement(); | 47 registerAnimatedPropertiesForSVGSymbolElement(); |
50 } | 48 } |
51 | 49 |
52 PassRefPtr<SVGSymbolElement> SVGSymbolElement::create(const QualifiedName& tagNa me, Document& document) | 50 PassRefPtr<SVGSymbolElement> SVGSymbolElement::create(const QualifiedName& tagNa me, Document& document) |
53 { | 51 { |
54 return adoptRef(new SVGSymbolElement(tagName, document)); | 52 return adoptRef(new SVGSymbolElement(tagName, document)); |
55 } | 53 } |
56 | 54 |
57 bool SVGSymbolElement::isSupportedAttribute(const QualifiedName& attrName) | 55 bool SVGSymbolElement::isSupportedAttribute(const QualifiedName& attrName) |
58 { | 56 { |
59 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 57 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
60 if (supportedAttributes.isEmpty()) { | 58 if (supportedAttributes.isEmpty()) { |
Stephen Chennney
2013/11/06 16:45:43
Remove braces.
Erik Dahlström (inactive)
2013/11/07 09:38:04
Done.
| |
61 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes ); | |
62 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); | 59 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); |
63 } | 60 } |
64 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 61 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
65 } | 62 } |
66 | 63 |
67 void SVGSymbolElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value) | 64 void SVGSymbolElement::parseAttribute(const QualifiedName& name, const AtomicStr ing& value) |
68 { | 65 { |
69 if (!isSupportedAttribute(name)) { | 66 if (!isSupportedAttribute(name)) { |
70 SVGElement::parseAttribute(name, value); | 67 SVGElement::parseAttribute(name, value); |
71 return; | 68 return; |
72 } | 69 } |
73 | 70 |
74 if (SVGExternalResourcesRequired::parseAttribute(name, value)) | |
75 return; | |
76 if (SVGFitToViewBox::parseAttribute(this, name, value)) | 71 if (SVGFitToViewBox::parseAttribute(this, name, value)) |
77 return; | 72 return; |
78 | 73 |
79 ASSERT_NOT_REACHED(); | 74 ASSERT_NOT_REACHED(); |
80 } | 75 } |
81 | 76 |
82 void SVGSymbolElement::svgAttributeChanged(const QualifiedName& attrName) | 77 void SVGSymbolElement::svgAttributeChanged(const QualifiedName& attrName) |
83 { | 78 { |
84 if (!isSupportedAttribute(attrName)) { | 79 if (!isSupportedAttribute(attrName)) { |
85 SVGElement::svgAttributeChanged(attrName); | 80 SVGElement::svgAttributeChanged(attrName); |
(...skipping 11 matching lines...) Expand all Loading... | |
97 { | 92 { |
98 return hasAttribute(SVGNames::viewBoxAttr); | 93 return hasAttribute(SVGNames::viewBoxAttr); |
99 } | 94 } |
100 | 95 |
101 RenderObject* SVGSymbolElement::createRenderer(RenderStyle*) | 96 RenderObject* SVGSymbolElement::createRenderer(RenderStyle*) |
102 { | 97 { |
103 return new RenderSVGHiddenContainer(this); | 98 return new RenderSVGHiddenContainer(this); |
104 } | 99 } |
105 | 100 |
106 } | 101 } |
OLD | NEW |