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

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

Issue 109433003: SVGLangSpace interface should be removed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Avoid running into ASSERT for Debug Created 7 years 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
« no previous file with comments | « Source/core/svg/SVGGElement.cpp ('k') | Source/core/svg/SVGLangSpace.h » ('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, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008, 2009 Rob Buis <buis@kde.org>
4 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org> 4 * Copyright (C) 2006 Alexander Kellett <lypanov@kde.org>
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 } 78 }
79 } 79 }
80 80
81 return true; 81 return true;
82 } 82 }
83 83
84 bool SVGImageElement::isSupportedAttribute(const QualifiedName& attrName) 84 bool SVGImageElement::isSupportedAttribute(const QualifiedName& attrName)
85 { 85 {
86 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 86 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
87 if (supportedAttributes.isEmpty()) { 87 if (supportedAttributes.isEmpty()) {
88 SVGLangSpace::addSupportedAttributes(supportedAttributes);
89 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes ); 88 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes );
90 SVGURIReference::addSupportedAttributes(supportedAttributes); 89 SVGURIReference::addSupportedAttributes(supportedAttributes);
91 supportedAttributes.add(SVGNames::xAttr); 90 supportedAttributes.add(SVGNames::xAttr);
92 supportedAttributes.add(SVGNames::yAttr); 91 supportedAttributes.add(SVGNames::yAttr);
93 supportedAttributes.add(SVGNames::widthAttr); 92 supportedAttributes.add(SVGNames::widthAttr);
94 supportedAttributes.add(SVGNames::heightAttr); 93 supportedAttributes.add(SVGNames::heightAttr);
95 supportedAttributes.add(SVGNames::preserveAspectRatioAttr); 94 supportedAttributes.add(SVGNames::preserveAspectRatioAttr);
96 } 95 }
97 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); 96 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
98 } 97 }
(...skipping 26 matching lines...) Expand all
125 else if (name == SVGNames::yAttr) 124 else if (name == SVGNames::yAttr)
126 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)) ; 125 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)) ;
127 else if (name == SVGNames::preserveAspectRatioAttr) { 126 else if (name == SVGNames::preserveAspectRatioAttr) {
128 SVGPreserveAspectRatio preserveAspectRatio; 127 SVGPreserveAspectRatio preserveAspectRatio;
129 preserveAspectRatio.parse(value); 128 preserveAspectRatio.parse(value);
130 setPreserveAspectRatioBaseValue(preserveAspectRatio); 129 setPreserveAspectRatioBaseValue(preserveAspectRatio);
131 } else if (name == SVGNames::widthAttr) 130 } else if (name == SVGNames::widthAttr)
132 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro r, ForbidNegativeLengths)); 131 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro r, ForbidNegativeLengths));
133 else if (name == SVGNames::heightAttr) 132 else if (name == SVGNames::heightAttr)
134 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr ror, ForbidNegativeLengths)); 133 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr ror, ForbidNegativeLengths));
135 else if (SVGLangSpace::parseAttribute(name, value) 134 else if (SVGExternalResourcesRequired::parseAttribute(name, value)
136 || SVGExternalResourcesRequired::parseAttribute(name, value)
137 || SVGURIReference::parseAttribute(name, value)) { 135 || SVGURIReference::parseAttribute(name, value)) {
138 } else 136 } else
139 ASSERT_NOT_REACHED(); 137 ASSERT_NOT_REACHED();
140 138
141 reportAttributeParsingError(parseError, name, value); 139 reportAttributeParsingError(parseError, name, value);
142 } 140 }
143 141
144 void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName) 142 void SVGImageElement::svgAttributeChanged(const QualifiedName& attrName)
145 { 143 {
146 if (!isSupportedAttribute(attrName)) { 144 if (!isSupportedAttribute(attrName)) {
(...skipping 20 matching lines...) Expand all
167 if (!renderer) 165 if (!renderer)
168 return; 166 return;
169 167
170 if (isLengthAttribute) { 168 if (isLengthAttribute) {
171 if (toRenderSVGImage(renderer)->updateImageViewport()) 169 if (toRenderSVGImage(renderer)->updateImageViewport())
172 RenderSVGResource::markForLayoutAndParentResourceInvalidation(render er); 170 RenderSVGResource::markForLayoutAndParentResourceInvalidation(render er);
173 return; 171 return;
174 } 172 }
175 173
176 if (attrName == SVGNames::preserveAspectRatioAttr 174 if (attrName == SVGNames::preserveAspectRatioAttr
177 || SVGLangSpace::isKnownAttribute(attrName)
178 || SVGExternalResourcesRequired::isKnownAttribute(attrName)) { 175 || SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
179 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); 176 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
180 return; 177 return;
181 } 178 }
182 179
183 ASSERT_NOT_REACHED(); 180 ASSERT_NOT_REACHED();
184 } 181 }
185 182
186 bool SVGImageElement::selfHasRelativeLengths() const 183 bool SVGImageElement::selfHasRelativeLengths() const
187 { 184 {
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 addSubresourceURL(urls, document().completeURL(hrefCurrentValue())); 233 addSubresourceURL(urls, document().completeURL(hrefCurrentValue()));
237 } 234 }
238 235
239 void SVGImageElement::didMoveToNewDocument(Document& oldDocument) 236 void SVGImageElement::didMoveToNewDocument(Document& oldDocument)
240 { 237 {
241 m_imageLoader.elementDidMoveToNewDocument(); 238 m_imageLoader.elementDidMoveToNewDocument();
242 SVGGraphicsElement::didMoveToNewDocument(oldDocument); 239 SVGGraphicsElement::didMoveToNewDocument(oldDocument);
243 } 240 }
244 241
245 } 242 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGGElement.cpp ('k') | Source/core/svg/SVGLangSpace.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698