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

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

Issue 327633004: Apply DEFINE/DECLARE_NODE_FACTORY(T) macro to element factories with single Document& argument. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 6 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/SVGPathElement.h ('k') | Source/core/svg/SVGPatternElement.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 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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 #include "core/svg/SVGPathSegLinetoRel.h" 42 #include "core/svg/SVGPathSegLinetoRel.h"
43 #include "core/svg/SVGPathSegLinetoVerticalAbs.h" 43 #include "core/svg/SVGPathSegLinetoVerticalAbs.h"
44 #include "core/svg/SVGPathSegLinetoVerticalRel.h" 44 #include "core/svg/SVGPathSegLinetoVerticalRel.h"
45 #include "core/svg/SVGPathSegMovetoAbs.h" 45 #include "core/svg/SVGPathSegMovetoAbs.h"
46 #include "core/svg/SVGPathSegMovetoRel.h" 46 #include "core/svg/SVGPathSegMovetoRel.h"
47 #include "core/svg/SVGPathUtilities.h" 47 #include "core/svg/SVGPathUtilities.h"
48 #include "core/svg/SVGPointTearOff.h" 48 #include "core/svg/SVGPointTearOff.h"
49 49
50 namespace WebCore { 50 namespace WebCore {
51 51
52 SVGPathElement::SVGPathElement(Document& document) 52 inline SVGPathElement::SVGPathElement(Document& document)
53 : SVGGeometryElement(SVGNames::pathTag, document) 53 : SVGGeometryElement(SVGNames::pathTag, document)
54 , m_pathLength(SVGAnimatedNumber::create(this, SVGNames::pathLengthAttr, SVG Number::create())) 54 , m_pathLength(SVGAnimatedNumber::create(this, SVGNames::pathLengthAttr, SVG Number::create()))
55 , m_pathSegList(SVGAnimatedPath::create(this, SVGNames::dAttr)) 55 , m_pathSegList(SVGAnimatedPath::create(this, SVGNames::dAttr))
56 { 56 {
57 ScriptWrappable::init(this); 57 ScriptWrappable::init(this);
58 58
59 addToPropertyMap(m_pathLength); 59 addToPropertyMap(m_pathLength);
60 addToPropertyMap(m_pathSegList); 60 addToPropertyMap(m_pathSegList);
61 } 61 }
62 62
63 DEFINE_NODE_FACTORY(SVGPathElement)
64
63 float SVGPathElement::getTotalLength() 65 float SVGPathElement::getTotalLength()
64 { 66 {
65 float totalLength = 0; 67 float totalLength = 0;
66 getTotalLengthOfSVGPathByteStream(pathByteStream(), totalLength); 68 getTotalLengthOfSVGPathByteStream(pathByteStream(), totalLength);
67 return totalLength; 69 return totalLength;
68 } 70 }
69 71
70 PassRefPtr<SVGPointTearOff> SVGPathElement::getPointAtLength(float length) 72 PassRefPtr<SVGPointTearOff> SVGPathElement::getPointAtLength(float length)
71 { 73 {
72 FloatPoint point; 74 FloatPoint point;
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
279 281
280 // FIXME: Eventually we should support getBBox for detached elements. 282 // FIXME: Eventually we should support getBBox for detached elements.
281 if (!renderer()) 283 if (!renderer())
282 return FloatRect(); 284 return FloatRect();
283 285
284 RenderSVGPath* renderer = toRenderSVGPath(this->renderer()); 286 RenderSVGPath* renderer = toRenderSVGPath(this->renderer());
285 return renderer->path().boundingRect(); 287 return renderer->path().boundingRect();
286 } 288 }
287 289
288 } 290 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGPathElement.h ('k') | Source/core/svg/SVGPatternElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698