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

Side by Side Diff: Source/core/svg/SVGGraphicsElement.h

Issue 18053005: Introduce SVGGraphicsElement IDL interface (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 5 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
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2004, 2005, 2008 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005, 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,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details. 13 * Library General Public License for more details.
14 * 14 *
15 * You should have received a copy of the GNU Library General Public License 15 * You should have received a copy of the GNU Library General Public License
16 * along with this library; see the file COPYING.LIB. If not, write to 16 * along with this library; see the file COPYING.LIB. If not, write to
17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 17 * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA. 18 * Boston, MA 02110-1301, USA.
19 */ 19 */
20 20
21 #ifndef SVGStyledTransformableElement_h 21 #ifndef SVGGraphicsElement_h
22 #define SVGStyledTransformableElement_h 22 #define SVGGraphicsElement_h
23 23
24 #include "core/svg/SVGAnimatedTransformList.h" 24 #include "core/svg/SVGAnimatedTransformList.h"
25 #include "core/svg/SVGStyledLocatableElement.h" 25 #include "core/svg/SVGStyledLocatableElement.h"
26 #include "core/svg/SVGTests.h"
26 #include "core/svg/SVGTransformable.h" 27 #include "core/svg/SVGTransformable.h"
27 28
28 namespace WebCore { 29 namespace WebCore {
29 30
30 class AffineTransform; 31 class AffineTransform;
31 class Path; 32 class Path;
32 33
33 class SVGStyledTransformableElement : public SVGStyledLocatableElement, 34 class SVGGraphicsElement : public SVGStyledLocatableElement, public SVGTransform able, public SVGTests {
Stephen Chennney 2013/06/27 16:18:49 You're planning to get rid of the StyledLocatableE
34 public SVGTransformable {
35 public: 35 public:
36 virtual ~SVGStyledTransformableElement(); 36 virtual ~SVGGraphicsElement();
37 37
38 virtual AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate); 38 virtual AffineTransform getCTM(StyleUpdateStrategy = AllowStyleUpdate);
39 virtual AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate) ; 39 virtual AffineTransform getScreenCTM(StyleUpdateStrategy = AllowStyleUpdate) ;
40 virtual SVGElement* nearestViewportElement() const; 40 virtual SVGElement* nearestViewportElement() const;
41 virtual SVGElement* farthestViewportElement() const; 41 virtual SVGElement* farthestViewportElement() const;
42 42
43 virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const { return SVGTransformable::localCoordinateSpaceTransform(mode); } 43 virtual AffineTransform localCoordinateSpaceTransform(SVGLocatable::CTMScope mode) const { return SVGTransformable::localCoordinateSpaceTransform(mode); }
44 virtual AffineTransform animatedLocalTransform() const; 44 virtual AffineTransform animatedLocalTransform() const;
45 virtual AffineTransform* supplementalTransform(); 45 virtual AffineTransform* supplementalTransform();
46 46
47 virtual FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate); 47 virtual FloatRect getBBox(StyleUpdateStrategy = AllowStyleUpdate);
48 48
49 // "base class" methods for all the elements which render as paths 49 // "base class" methods for all the elements which render as paths
50 virtual void toClipPath(Path&); 50 virtual void toClipPath(Path&);
51 virtual RenderObject* createRenderer(RenderStyle*); 51 virtual RenderObject* createRenderer(RenderStyle*);
52 52
53 protected: 53 protected:
54 SVGStyledTransformableElement(const QualifiedName&, Document*, ConstructionT ype = CreateSVGElement); 54 SVGGraphicsElement(const QualifiedName&, Document*, ConstructionType = Creat eSVGElement);
55 55
56 bool isSupportedAttribute(const QualifiedName&); 56 bool isSupportedAttribute(const QualifiedName&);
57 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE; 57 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE;
58 virtual void svgAttributeChanged(const QualifiedName&); 58 virtual void svgAttributeChanged(const QualifiedName&);
59 59
60 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGStyledTransformableElement) 60 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGraphicsElement)
61 DECLARE_ANIMATED_TRANSFORM_LIST(Transform, transform) 61 DECLARE_ANIMATED_TRANSFORM_LIST(Transform, transform)
62 END_DECLARE_ANIMATED_PROPERTIES 62 END_DECLARE_ANIMATED_PROPERTIES
63 63
64 private: 64 private:
65 virtual bool isStyledTransformable() const OVERRIDE { return true; } 65 virtual bool isSVGGraphicsElement() const OVERRIDE { return true; }
66 66
67 // Used by <animateMotion> 67 // Used by <animateMotion>
68 OwnPtr<AffineTransform> m_supplementalTransform; 68 OwnPtr<AffineTransform> m_supplementalTransform;
69 }; 69 };
70 70
71 inline SVGStyledTransformableElement* toSVGStyledTransformableElement(Node* node ) 71 inline SVGGraphicsElement* toSVGGraphicsElement(Node* node)
72 { 72 {
73 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isSVGElement()); 73 ASSERT_WITH_SECURITY_IMPLICATION(!node || node->isSVGElement());
74 ASSERT_WITH_SECURITY_IMPLICATION(!node || toSVGElement(node)->isStyledTransf ormable()); 74 ASSERT_WITH_SECURITY_IMPLICATION(!node || toSVGElement(node)->isSVGGraphicsE lement());
75 return static_cast<SVGStyledTransformableElement*>(node); 75 return static_cast<SVGGraphicsElement*>(node);
76 } 76 }
77 77
78 } // namespace WebCore 78 } // namespace WebCore
79 79
80 #endif // SVGStyledTransformableElement_h 80 #endif // SVGGraphicsElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698