Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(738)

Side by Side Diff: Source/core/svg/SVGGraphicsElement.cpp

Issue 18328007: Move SVGTests attributes parsing to SVGGraphicsElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix issue in SVGSVGElement::svgAttributeChanged() Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGGElement.cpp ('k') | Source/core/svg/SVGImageElement.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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, 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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 AffineTransform* SVGGraphicsElement::supplementalTransform() 86 AffineTransform* SVGGraphicsElement::supplementalTransform()
87 { 87 {
88 if (!m_supplementalTransform) 88 if (!m_supplementalTransform)
89 m_supplementalTransform = adoptPtr(new AffineTransform); 89 m_supplementalTransform = adoptPtr(new AffineTransform);
90 return m_supplementalTransform.get(); 90 return m_supplementalTransform.get();
91 } 91 }
92 92
93 bool SVGGraphicsElement::isSupportedAttribute(const QualifiedName& attrName) 93 bool SVGGraphicsElement::isSupportedAttribute(const QualifiedName& attrName)
94 { 94 {
95 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 95 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
96 if (supportedAttributes.isEmpty()) 96 if (supportedAttributes.isEmpty()) {
97 SVGTests::addSupportedAttributes(supportedAttributes);
97 supportedAttributes.add(SVGNames::transformAttr); 98 supportedAttributes.add(SVGNames::transformAttr);
99 }
98 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); 100 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
99 } 101 }
100 102
101 void SVGGraphicsElement::parseAttribute(const QualifiedName& name, const AtomicS tring& value) 103 void SVGGraphicsElement::parseAttribute(const QualifiedName& name, const AtomicS tring& value)
102 { 104 {
103 if (!isSupportedAttribute(name)) { 105 if (!isSupportedAttribute(name)) {
104 SVGStyledElement::parseAttribute(name, value); 106 SVGStyledElement::parseAttribute(name, value);
105 return; 107 return;
106 } 108 }
107 109
108 if (name == SVGNames::transformAttr) { 110 if (name == SVGNames::transformAttr) {
109 SVGTransformList newList; 111 SVGTransformList newList;
110 newList.parse(value); 112 newList.parse(value);
111 detachAnimatedTransformListWrappers(newList.size()); 113 detachAnimatedTransformListWrappers(newList.size());
112 setTransformBaseValue(newList); 114 setTransformBaseValue(newList);
113 return; 115 return;
116 } else if (SVGTests::parseAttribute(name, value)) {
117 return;
114 } 118 }
115 119
116 ASSERT_NOT_REACHED(); 120 ASSERT_NOT_REACHED();
117 } 121 }
118 122
119 void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName) 123 void SVGGraphicsElement::svgAttributeChanged(const QualifiedName& attrName)
120 { 124 {
121 if (!isSupportedAttribute(attrName)) { 125 if (!isSupportedAttribute(attrName)) {
122 SVGStyledElement::svgAttributeChanged(attrName); 126 SVGStyledElement::svgAttributeChanged(attrName);
123 return; 127 return;
124 } 128 }
125 129
126 SVGElementInstance::InvalidationGuard invalidationGuard(this); 130 SVGElementInstance::InvalidationGuard invalidationGuard(this);
127 131
132 if (SVGTests::handleAttributeChange(this, attrName))
133 return;
134
128 RenderObject* object = renderer(); 135 RenderObject* object = renderer();
129 if (!object) 136 if (!object)
130 return; 137 return;
131 138
132 if (attrName == SVGNames::transformAttr) { 139 if (attrName == SVGNames::transformAttr) {
133 object->setNeedsTransformUpdate(); 140 object->setNeedsTransformUpdate();
134 RenderSVGResource::markForLayoutAndParentResourceInvalidation(object); 141 RenderSVGResource::markForLayoutAndParentResourceInvalidation(object);
135 return; 142 return;
136 } 143 }
137 144
(...skipping 22 matching lines...) Expand all
160 } 167 }
161 168
162 void SVGGraphicsElement::toClipPath(Path& path) 169 void SVGGraphicsElement::toClipPath(Path& path)
163 { 170 {
164 updatePathFromGraphicsElement(this, path); 171 updatePathFromGraphicsElement(this, path);
165 // FIXME: How do we know the element has done a layout? 172 // FIXME: How do we know the element has done a layout?
166 path.transform(animatedLocalTransform()); 173 path.transform(animatedLocalTransform());
167 } 174 }
168 175
169 } 176 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGGElement.cpp ('k') | Source/core/svg/SVGImageElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698