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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGGeometryElement.h

Issue 2525233002: Move pathLength attribute from SVGPathElement to SVGGeometryElement. (Closed)
Patch Set: Align with review comments Created 4 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) 2013 Samsung Electronics. All rights reserved. 2 * Copyright (C) 2013 Samsung Electronics. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 13 matching lines...) Expand all
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29 */ 29 */
30 30
31 #ifndef SVGGeometryElement_h 31 #ifndef SVGGeometryElement_h
32 #define SVGGeometryElement_h 32 #define SVGGeometryElement_h
33 33
34 #include "core/svg/SVGAnimatedNumber.h"
34 #include "core/svg/SVGGraphicsElement.h" 35 #include "core/svg/SVGGraphicsElement.h"
35 36
36 namespace blink { 37 namespace blink {
37 38
38 class Path; 39 class Path;
39 class SVGPointTearOff; 40 class SVGPointTearOff;
40 41
41 class SVGGeometryElement : public SVGGraphicsElement { 42 class SVGGeometryElement : public SVGGraphicsElement {
42 DEFINE_WRAPPERTYPEINFO(); 43 DEFINE_WRAPPERTYPEINFO();
43 44
44 public: 45 public:
45 virtual Path asPath() const = 0; 46 virtual Path asPath() const = 0;
46 bool isPointInFill(SVGPointTearOff*) const; 47 bool isPointInFill(SVGPointTearOff*) const;
47 bool isPointInStroke(SVGPointTearOff*) const; 48 bool isPointInStroke(SVGPointTearOff*) const;
48 49
49 void toClipPath(Path&) const; 50 void toClipPath(Path&) const;
50 51
52 SVGAnimatedNumber* pathLength() const { return m_pathLength.get(); }
51 LayoutObject* createLayoutObject(const ComputedStyle&) override; 53 LayoutObject* createLayoutObject(const ComputedStyle&) override;
52 virtual float getTotalLength(); 54 virtual float getTotalLength();
53 virtual SVGPointTearOff* getPointAtLength(float distance); 55 virtual SVGPointTearOff* getPointAtLength(float distance);
56 float pathLengthScaleFactor() const;
57 virtual float computePathLength() const;
58
59 DECLARE_VIRTUAL_TRACE();
54 60
55 protected: 61 protected:
56 SVGGeometryElement(const QualifiedName&, 62 SVGGeometryElement(const QualifiedName&,
57 Document&, 63 Document&,
58 ConstructionType = CreateSVGElement); 64 ConstructionType = CreateSVGElement);
59 65
60 private: 66 private:
61 bool isSVGGeometryElement() const final { return true; } 67 bool isSVGGeometryElement() const final { return true; }
68
69 Member<SVGAnimatedNumber> m_pathLength;
62 }; 70 };
63 71
64 inline bool isSVGGeometryElement(const SVGElement& element) { 72 inline bool isSVGGeometryElement(const SVGElement& element) {
65 return element.isSVGGeometryElement(); 73 return element.isSVGGeometryElement();
66 } 74 }
67 75
68 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGGeometryElement); 76 DEFINE_SVGELEMENT_TYPE_CASTS_WITH_FUNCTION(SVGGeometryElement);
69 77
70 } // namespace blink 78 } // namespace blink
71 79
72 #endif // SVGGeometryElement_h 80 #endif // SVGGeometryElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698