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

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

Issue 181713003: Have Document::accessSVGExtensions() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 10 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/SVGMPathElement.cpp ('k') | Source/core/svg/SVGSVGElement.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, 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 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 return; 205 return;
206 } 206 }
207 207
208 SVGParsingError parseError = NoError; 208 SVGParsingError parseError = NoError;
209 209
210 if (name == SVGNames::dAttr) { 210 if (name == SVGNames::dAttr) {
211 m_pathSegList->setBaseValueAsString(value, parseError); 211 m_pathSegList->setBaseValueAsString(value, parseError);
212 } else if (name == SVGNames::pathLengthAttr) { 212 } else if (name == SVGNames::pathLengthAttr) {
213 m_pathLength->setBaseValueAsString(value, parseError); 213 m_pathLength->setBaseValueAsString(value, parseError);
214 if (parseError == NoError && m_pathLength->baseValue()->value() < 0) 214 if (parseError == NoError && m_pathLength->baseValue()->value() < 0)
215 document().accessSVGExtensions()->reportError("A negative value for path attribute <pathLength> is not allowed"); 215 document().accessSVGExtensions().reportError("A negative value for p ath attribute <pathLength> is not allowed");
216 } else { 216 } else {
217 ASSERT_NOT_REACHED(); 217 ASSERT_NOT_REACHED();
218 } 218 }
219 219
220 reportAttributeParsingError(parseError, name, value); 220 reportAttributeParsingError(parseError, name, value);
221 } 221 }
222 222
223 void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName) 223 void SVGPathElement::svgAttributeChanged(const QualifiedName& attrName)
224 { 224 {
225 if (!isSupportedAttribute(attrName)) { 225 if (!isSupportedAttribute(attrName)) {
(...skipping 13 matching lines...) Expand all
239 } 239 }
240 240
241 if (renderer) 241 if (renderer)
242 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer); 242 RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
243 } 243 }
244 244
245 void SVGPathElement::invalidateMPathDependencies() 245 void SVGPathElement::invalidateMPathDependencies()
246 { 246 {
247 // <mpath> can only reference <path> but this dependency is not handled in 247 // <mpath> can only reference <path> but this dependency is not handled in
248 // markForLayoutAndParentResourceInvalidation so we update any mpath depende ncies manually. 248 // markForLayoutAndParentResourceInvalidation so we update any mpath depende ncies manually.
249 if (HashSet<SVGElement*>* dependencies = document().accessSVGExtensions()->s etOfElementsReferencingTarget(this)) { 249 if (HashSet<SVGElement*>* dependencies = document().accessSVGExtensions().se tOfElementsReferencingTarget(this)) {
250 HashSet<SVGElement*>::iterator end = dependencies->end(); 250 HashSet<SVGElement*>::iterator end = dependencies->end();
251 for (HashSet<SVGElement*>::iterator it = dependencies->begin(); it != en d; ++it) { 251 for (HashSet<SVGElement*>::iterator it = dependencies->begin(); it != en d; ++it) {
252 if ((*it)->hasTagName(SVGNames::mpathTag)) 252 if ((*it)->hasTagName(SVGNames::mpathTag))
253 toSVGMPathElement(*it)->targetPathChanged(); 253 toSVGMPathElement(*it)->targetPathChanged();
254 } 254 }
255 } 255 }
256 } 256 }
257 257
258 Node::InsertionNotificationRequest SVGPathElement::insertedInto(ContainerNode* r ootParent) 258 Node::InsertionNotificationRequest SVGPathElement::insertedInto(ContainerNode* r ootParent)
259 { 259 {
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
291 291
292 // FIXME: Eventually we should support getBBox for detached elements. 292 // FIXME: Eventually we should support getBBox for detached elements.
293 if (!renderer()) 293 if (!renderer())
294 return FloatRect(); 294 return FloatRect();
295 295
296 RenderSVGPath* renderer = toRenderSVGPath(this->renderer()); 296 RenderSVGPath* renderer = toRenderSVGPath(this->renderer());
297 return renderer->path().boundingRect(); 297 return renderer->path().boundingRect();
298 } 298 }
299 299
300 } 300 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGMPathElement.cpp ('k') | Source/core/svg/SVGSVGElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698