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

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

Issue 23886003: Have HTMLElements / SVGElements constructors take a Document reference in argument (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Another Android build fix Created 7 years, 3 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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 DEFINE_ANIMATED_NUMBER(SVGPathElement, SVGNames::pathLengthAttr, PathLength, pat hLength) 71 DEFINE_ANIMATED_NUMBER(SVGPathElement, SVGNames::pathLengthAttr, PathLength, pat hLength)
72 DEFINE_ANIMATED_BOOLEAN(SVGPathElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired) 72 DEFINE_ANIMATED_BOOLEAN(SVGPathElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
73 73
74 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPathElement) 74 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGPathElement)
75 REGISTER_LOCAL_ANIMATED_PROPERTY(d) 75 REGISTER_LOCAL_ANIMATED_PROPERTY(d)
76 REGISTER_LOCAL_ANIMATED_PROPERTY(pathLength) 76 REGISTER_LOCAL_ANIMATED_PROPERTY(pathLength)
77 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) 77 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
78 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) 78 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement)
79 END_REGISTER_ANIMATED_PROPERTIES 79 END_REGISTER_ANIMATED_PROPERTIES
80 80
81 inline SVGPathElement::SVGPathElement(const QualifiedName& tagName, Document* do cument) 81 inline SVGPathElement::SVGPathElement(const QualifiedName& tagName, Document& do cument)
82 : SVGGraphicsElement(tagName, document) 82 : SVGGraphicsElement(tagName, document)
83 , m_pathByteStream(SVGPathByteStream::create()) 83 , m_pathByteStream(SVGPathByteStream::create())
84 , m_pathSegList(PathSegUnalteredRole) 84 , m_pathSegList(PathSegUnalteredRole)
85 , m_isAnimValObserved(false) 85 , m_isAnimValObserved(false)
86 { 86 {
87 ASSERT(hasTagName(SVGNames::pathTag)); 87 ASSERT(hasTagName(SVGNames::pathTag));
88 ScriptWrappable::init(this); 88 ScriptWrappable::init(this);
89 registerAnimatedPropertiesForSVGPathElement(); 89 registerAnimatedPropertiesForSVGPathElement();
90 } 90 }
91 91
92 PassRefPtr<SVGPathElement> SVGPathElement::create(const QualifiedName& tagName, Document* document) 92 PassRefPtr<SVGPathElement> SVGPathElement::create(const QualifiedName& tagName, Document& document)
93 { 93 {
94 return adoptRef(new SVGPathElement(tagName, document)); 94 return adoptRef(new SVGPathElement(tagName, document));
95 } 95 }
96 96
97 float SVGPathElement::getTotalLength() 97 float SVGPathElement::getTotalLength()
98 { 98 {
99 float totalLength = 0; 99 float totalLength = 0;
100 getTotalLengthOfSVGPathByteStream(pathByteStream(), totalLength); 100 getTotalLengthOfSVGPathByteStream(pathByteStream(), totalLength);
101 return totalLength; 101 return totalLength;
102 } 102 }
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
399 return renderer->path().boundingRect(); 399 return renderer->path().boundingRect();
400 } 400 }
401 401
402 RenderObject* SVGPathElement::createRenderer(RenderStyle*) 402 RenderObject* SVGPathElement::createRenderer(RenderStyle*)
403 { 403 {
404 // By default, any subclass is expected to do path-based drawing 404 // By default, any subclass is expected to do path-based drawing
405 return new RenderSVGPath(this); 405 return new RenderSVGPath(this);
406 } 406 }
407 407
408 } 408 }
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