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 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 | 48 |
49 PassRefPtr<SVGGElement> SVGGElement::create(const QualifiedName& tagName, Docume
nt* document) | 49 PassRefPtr<SVGGElement> SVGGElement::create(const QualifiedName& tagName, Docume
nt* document) |
50 { | 50 { |
51 return adoptRef(new SVGGElement(tagName, document)); | 51 return adoptRef(new SVGGElement(tagName, document)); |
52 } | 52 } |
53 | 53 |
54 bool SVGGElement::isSupportedAttribute(const QualifiedName& attrName) | 54 bool SVGGElement::isSupportedAttribute(const QualifiedName& attrName) |
55 { | 55 { |
56 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 56 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
57 if (supportedAttributes.isEmpty()) { | 57 if (supportedAttributes.isEmpty()) { |
58 SVGTests::addSupportedAttributes(supportedAttributes); | |
59 SVGLangSpace::addSupportedAttributes(supportedAttributes); | 58 SVGLangSpace::addSupportedAttributes(supportedAttributes); |
60 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | 59 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); |
61 } | 60 } |
62 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 61 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
63 } | 62 } |
64 | 63 |
65 void SVGGElement::parseAttribute(const QualifiedName& name, const AtomicString&
value) | 64 void SVGGElement::parseAttribute(const QualifiedName& name, const AtomicString&
value) |
66 { | 65 { |
67 if (!isSupportedAttribute(name)) { | 66 if (!isSupportedAttribute(name)) { |
68 SVGGraphicsElement::parseAttribute(name, value); | 67 SVGGraphicsElement::parseAttribute(name, value); |
69 return; | 68 return; |
70 } | 69 } |
71 | 70 |
72 if (SVGTests::parseAttribute(name, value)) | |
73 return; | |
74 if (SVGLangSpace::parseAttribute(name, value)) | 71 if (SVGLangSpace::parseAttribute(name, value)) |
75 return; | 72 return; |
76 if (SVGExternalResourcesRequired::parseAttribute(name, value)) | 73 if (SVGExternalResourcesRequired::parseAttribute(name, value)) |
77 return; | 74 return; |
78 | 75 |
79 ASSERT_NOT_REACHED(); | 76 ASSERT_NOT_REACHED(); |
80 } | 77 } |
81 | 78 |
82 void SVGGElement::svgAttributeChanged(const QualifiedName& attrName) | 79 void SVGGElement::svgAttributeChanged(const QualifiedName& attrName) |
83 { | 80 { |
84 if (!isSupportedAttribute(attrName)) { | 81 if (!isSupportedAttribute(attrName)) { |
85 SVGGraphicsElement::svgAttributeChanged(attrName); | 82 SVGGraphicsElement::svgAttributeChanged(attrName); |
86 return; | 83 return; |
87 } | 84 } |
88 | 85 |
89 SVGElementInstance::InvalidationGuard invalidationGuard(this); | 86 SVGElementInstance::InvalidationGuard invalidationGuard(this); |
90 | |
91 if (SVGTests::handleAttributeChange(this, attrName)) | |
92 return; | |
93 | 87 |
94 if (RenderObject* renderer = this->renderer()) | 88 if (RenderObject* renderer = this->renderer()) |
95 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); | 89 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); |
96 } | 90 } |
97 | 91 |
98 RenderObject* SVGGElement::createRenderer(RenderStyle* style) | 92 RenderObject* SVGGElement::createRenderer(RenderStyle* style) |
99 { | 93 { |
100 // SVG 1.1 testsuite explicitely uses constructs like <g display="none"><lin
earGradient> | 94 // SVG 1.1 testsuite explicitely uses constructs like <g display="none"><lin
earGradient> |
101 // We still have to create renderers for the <g> & <linearGradient> element,
though the | 95 // We still have to create renderers for the <g> & <linearGradient> element,
though the |
102 // subtree may be hidden - we only want the resource renderers to exist so t
hey can be | 96 // subtree may be hidden - we only want the resource renderers to exist so t
hey can be |
103 // referenced from somewhere else. | 97 // referenced from somewhere else. |
104 if (style->display() == NONE) | 98 if (style->display() == NONE) |
105 return new (document()->renderArena()) RenderSVGHiddenContainer(this); | 99 return new (document()->renderArena()) RenderSVGHiddenContainer(this); |
106 | 100 |
107 return new (document()->renderArena()) RenderSVGTransformableContainer(this)
; | 101 return new (document()->renderArena()) RenderSVGTransformableContainer(this)
; |
108 } | 102 } |
109 | 103 |
110 bool SVGGElement::rendererIsNeeded(const NodeRenderingContext&) | 104 bool SVGGElement::rendererIsNeeded(const NodeRenderingContext&) |
111 { | 105 { |
112 // Unlike SVGStyledElement::rendererIsNeeded(), we still create renderers, e
ven if | 106 // Unlike SVGStyledElement::rendererIsNeeded(), we still create renderers, e
ven if |
113 // display is set to 'none' - which is special to SVG <g> container elements
. | 107 // display is set to 'none' - which is special to SVG <g> container elements
. |
114 return parentOrShadowHostElement() && parentOrShadowHostElement()->isSVGElem
ent(); | 108 return parentOrShadowHostElement() && parentOrShadowHostElement()->isSVGElem
ent(); |
115 } | 109 } |
116 | 110 |
117 } | 111 } |
OLD | NEW |