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

Side by Side Diff: Source/core/svg/SVGTextContentElement.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/SVGSVGElement.cpp ('k') | Source/core/svg/SVGUseElement.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, 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, 2007, 2008 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
206 for (unsigned i = 0; i < nchars; ++i) 206 for (unsigned i = 0; i < nchars; ++i)
207 end = end.next(); 207 end = end.next();
208 208
209 document().frame()->selection().setSelection(VisibleSelection(start, end)); 209 document().frame()->selection().setSelection(VisibleSelection(start, end));
210 } 210 }
211 211
212 bool SVGTextContentElement::isSupportedAttribute(const QualifiedName& attrName) 212 bool SVGTextContentElement::isSupportedAttribute(const QualifiedName& attrName)
213 { 213 {
214 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 214 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
215 if (supportedAttributes.isEmpty()) { 215 if (supportedAttributes.isEmpty()) {
216 SVGLangSpace::addSupportedAttributes(supportedAttributes);
217 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes ); 216 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes );
218 supportedAttributes.add(SVGNames::lengthAdjustAttr); 217 supportedAttributes.add(SVGNames::lengthAdjustAttr);
219 supportedAttributes.add(SVGNames::textLengthAttr); 218 supportedAttributes.add(SVGNames::textLengthAttr);
219 supportedAttributes.add(XMLNames::spaceAttr);
220 } 220 }
221 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); 221 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
222 } 222 }
223 223
224 bool SVGTextContentElement::isPresentationAttribute(const QualifiedName& name) c onst 224 bool SVGTextContentElement::isPresentationAttribute(const QualifiedName& name) c onst
225 { 225 {
226 if (name.matches(XMLNames::spaceAttr)) 226 if (name.matches(XMLNames::spaceAttr))
227 return true; 227 return true;
228 return SVGGraphicsElement::isPresentationAttribute(name); 228 return SVGGraphicsElement::isPresentationAttribute(name);
229 } 229 }
(...skipping 18 matching lines...) Expand all
248 248
249 if (!isSupportedAttribute(name)) 249 if (!isSupportedAttribute(name))
250 SVGGraphicsElement::parseAttribute(name, value); 250 SVGGraphicsElement::parseAttribute(name, value);
251 else if (name == SVGNames::lengthAdjustAttr) { 251 else if (name == SVGNames::lengthAdjustAttr) {
252 SVGLengthAdjustType propertyValue = SVGPropertyTraits<SVGLengthAdjustTyp e>::fromString(value); 252 SVGLengthAdjustType propertyValue = SVGPropertyTraits<SVGLengthAdjustTyp e>::fromString(value);
253 if (propertyValue > 0) 253 if (propertyValue > 0)
254 setLengthAdjustBaseValue(propertyValue); 254 setLengthAdjustBaseValue(propertyValue);
255 } else if (name == SVGNames::textLengthAttr) { 255 } else if (name == SVGNames::textLengthAttr) {
256 m_textLength.value = SVGLength::construct(LengthModeOther, value, parseE rror, ForbidNegativeLengths); 256 m_textLength.value = SVGLength::construct(LengthModeOther, value, parseE rror, ForbidNegativeLengths);
257 } else if (SVGExternalResourcesRequired::parseAttribute(name, value)) { 257 } else if (SVGExternalResourcesRequired::parseAttribute(name, value)) {
258 } else if (SVGLangSpace::parseAttribute(name, value)) { 258 } else if (name.matches(XMLNames::spaceAttr)) {
259 } else 259 } else
260 ASSERT_NOT_REACHED(); 260 ASSERT_NOT_REACHED();
261 261
262 reportAttributeParsingError(parseError, name, value); 262 reportAttributeParsingError(parseError, name, value);
263 } 263 }
264 264
265 void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName) 265 void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName)
266 { 266 {
267 if (!isSupportedAttribute(attrName)) { 267 if (!isSupportedAttribute(attrName)) {
268 SVGGraphicsElement::svgAttributeChanged(attrName); 268 SVGGraphicsElement::svgAttributeChanged(attrName);
(...skipping 28 matching lines...) Expand all
297 SVGElement* element = toSVGElement(renderer->node()); 297 SVGElement* element = toSVGElement(renderer->node());
298 ASSERT(element); 298 ASSERT(element);
299 299
300 if (!element->isTextContent()) 300 if (!element->isTextContent())
301 return 0; 301 return 0;
302 302
303 return toSVGTextContentElement(element); 303 return toSVGTextContentElement(element);
304 } 304 }
305 305
306 } 306 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGSVGElement.cpp ('k') | Source/core/svg/SVGUseElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698