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

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

Issue 109433003: SVGLangSpace interface should be removed (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Fix compile problem 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org> 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde .org>
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved.
5 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved. 5 * Copyright (C) 2011 Torch Mobile (Beijing) Co. Ltd. All rights reserved.
6 * Copyright (C) 2012 University of Szeged 6 * Copyright (C) 2012 University of Szeged
7 * Copyright (C) 2012 Renata Hodovan <reni@webkit.org> 7 * Copyright (C) 2012 Renata Hodovan <reni@webkit.org>
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after
115 SVGElementInstance* SVGUseElement::animatedInstanceRoot() const 115 SVGElementInstance* SVGUseElement::animatedInstanceRoot() const
116 { 116 {
117 // FIXME: Implement me. 117 // FIXME: Implement me.
118 return 0; 118 return 0;
119 } 119 }
120 120
121 bool SVGUseElement::isSupportedAttribute(const QualifiedName& attrName) 121 bool SVGUseElement::isSupportedAttribute(const QualifiedName& attrName)
122 { 122 {
123 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 123 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
124 if (supportedAttributes.isEmpty()) { 124 if (supportedAttributes.isEmpty()) {
125 SVGLangSpace::addSupportedAttributes(supportedAttributes);
126 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes ); 125 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes );
127 SVGURIReference::addSupportedAttributes(supportedAttributes); 126 SVGURIReference::addSupportedAttributes(supportedAttributes);
128 supportedAttributes.add(SVGNames::xAttr); 127 supportedAttributes.add(SVGNames::xAttr);
129 supportedAttributes.add(SVGNames::yAttr); 128 supportedAttributes.add(SVGNames::yAttr);
130 supportedAttributes.add(SVGNames::widthAttr); 129 supportedAttributes.add(SVGNames::widthAttr);
131 supportedAttributes.add(SVGNames::heightAttr); 130 supportedAttributes.add(SVGNames::heightAttr);
132 } 131 }
133 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); 132 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
134 } 133 }
135 134
136 void SVGUseElement::parseAttribute(const QualifiedName& name, const AtomicString & value) 135 void SVGUseElement::parseAttribute(const QualifiedName& name, const AtomicString & value)
137 { 136 {
138 SVGParsingError parseError = NoError; 137 SVGParsingError parseError = NoError;
139 138
140 if (!isSupportedAttribute(name)) 139 if (!isSupportedAttribute(name))
141 SVGGraphicsElement::parseAttribute(name, value); 140 SVGGraphicsElement::parseAttribute(name, value);
142 else if (name == SVGNames::xAttr) 141 else if (name == SVGNames::xAttr)
143 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError)); 142 setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError));
144 else if (name == SVGNames::yAttr) 143 else if (name == SVGNames::yAttr)
145 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)) ; 144 setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)) ;
146 else if (name == SVGNames::widthAttr) 145 else if (name == SVGNames::widthAttr)
147 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro r, ForbidNegativeLengths)); 146 setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseErro r, ForbidNegativeLengths));
148 else if (name == SVGNames::heightAttr) 147 else if (name == SVGNames::heightAttr)
149 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr ror, ForbidNegativeLengths)); 148 setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseEr ror, ForbidNegativeLengths));
150 else if (SVGLangSpace::parseAttribute(name, value) 149 else if (SVGExternalResourcesRequired::parseAttribute(name, value)
151 || SVGExternalResourcesRequired::parseAttribute(name, value)
152 || SVGURIReference::parseAttribute(name, value)) { 150 || SVGURIReference::parseAttribute(name, value)) {
153 } else 151 } else
154 ASSERT_NOT_REACHED(); 152 ASSERT_NOT_REACHED();
155 153
156 reportAttributeParsingError(parseError, name, value); 154 reportAttributeParsingError(parseError, name, value);
157 } 155 }
158 156
159 #if !ASSERT_DISABLED 157 #if !ASSERT_DISABLED
160 static inline bool isWellFormedDocument(Document* document) 158 static inline bool isWellFormedDocument(Document* document)
161 { 159 {
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 240
243 if (!m_wasInsertedByParser) 241 if (!m_wasInsertedByParser)
244 buildPendingResource(); 242 buildPendingResource();
245 243
246 return; 244 return;
247 } 245 }
248 246
249 if (!renderer) 247 if (!renderer)
250 return; 248 return;
251 249
252 if (SVGLangSpace::isKnownAttribute(attrName) 250 if (SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
253 || SVGExternalResourcesRequired::isKnownAttribute(attrName)) {
254 invalidateShadowTree(); 251 invalidateShadowTree();
255 return; 252 return;
256 } 253 }
257 254
258 ASSERT_NOT_REACHED(); 255 ASSERT_NOT_REACHED();
259 } 256 }
260 257
261 void SVGUseElement::attach(const AttachContext& context) 258 void SVGUseElement::attach(const AttachContext& context)
262 { 259 {
263 if (m_needsShadowTreeRecreation) 260 if (m_needsShadowTreeRecreation)
(...skipping 728 matching lines...) Expand 10 before | Expand all | Expand 10 after
992 989
993 if (m_resource) 990 if (m_resource)
994 m_resource->removeClient(this); 991 m_resource->removeClient(this);
995 992
996 m_resource = resource; 993 m_resource = resource;
997 if (m_resource) 994 if (m_resource)
998 m_resource->addClient(this); 995 m_resource->addClient(this);
999 } 996 }
1000 997
1001 } 998 }
OLDNEW
« Source/core/svg/SVGTextContentElement.cpp ('K') | « Source/core/svg/SVGTextContentElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698