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

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

Issue 21042009: [SVG2] Merge SVGStyledElement into SVGElement (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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/SVGGlyphRefElement.idl ('k') | Source/core/svg/SVGGradientElement.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 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006 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 SVGGradientElement_h 21 #ifndef SVGGradientElement_h
22 #define SVGGradientElement_h 22 #define SVGGradientElement_h
23 23
24 #include "SVGNames.h" 24 #include "SVGNames.h"
25 #include "core/platform/graphics/Gradient.h" 25 #include "core/platform/graphics/Gradient.h"
26 #include "core/svg/SVGAnimatedBoolean.h" 26 #include "core/svg/SVGAnimatedBoolean.h"
27 #include "core/svg/SVGAnimatedEnumeration.h" 27 #include "core/svg/SVGAnimatedEnumeration.h"
28 #include "core/svg/SVGAnimatedTransformList.h" 28 #include "core/svg/SVGAnimatedTransformList.h"
29 #include "core/svg/SVGElement.h"
29 #include "core/svg/SVGExternalResourcesRequired.h" 30 #include "core/svg/SVGExternalResourcesRequired.h"
30 #include "core/svg/SVGStyledElement.h"
31 #include "core/svg/SVGURIReference.h" 31 #include "core/svg/SVGURIReference.h"
32 #include "core/svg/SVGUnitTypes.h" 32 #include "core/svg/SVGUnitTypes.h"
33 33
34 namespace WebCore { 34 namespace WebCore {
35 35
36 enum SVGSpreadMethodType { 36 enum SVGSpreadMethodType {
37 SVGSpreadMethodUnknown = 0, 37 SVGSpreadMethodUnknown = 0,
38 SVGSpreadMethodPad, 38 SVGSpreadMethodPad,
39 SVGSpreadMethodReflect, 39 SVGSpreadMethodReflect,
40 SVGSpreadMethodRepeat 40 SVGSpreadMethodRepeat
(...skipping 25 matching lines...) Expand all
66 if (value == "pad") 66 if (value == "pad")
67 return SVGSpreadMethodPad; 67 return SVGSpreadMethodPad;
68 if (value == "reflect") 68 if (value == "reflect")
69 return SVGSpreadMethodReflect; 69 return SVGSpreadMethodReflect;
70 if (value == "repeat") 70 if (value == "repeat")
71 return SVGSpreadMethodRepeat; 71 return SVGSpreadMethodRepeat;
72 return SVGSpreadMethodUnknown; 72 return SVGSpreadMethodUnknown;
73 } 73 }
74 }; 74 };
75 75
76 class SVGGradientElement : public SVGStyledElement, 76 class SVGGradientElement : public SVGElement,
77 public SVGURIReference, 77 public SVGURIReference,
78 public SVGExternalResourcesRequired { 78 public SVGExternalResourcesRequired {
79 public: 79 public:
80 enum { 80 enum {
81 SVG_SPREADMETHOD_UNKNOWN = SVGSpreadMethodUnknown, 81 SVG_SPREADMETHOD_UNKNOWN = SVGSpreadMethodUnknown,
82 SVG_SPREADMETHOD_PAD = SVGSpreadMethodReflect, 82 SVG_SPREADMETHOD_PAD = SVGSpreadMethodReflect,
83 SVG_SPREADMETHOD_REFLECT = SVGSpreadMethodRepeat, 83 SVG_SPREADMETHOD_REFLECT = SVGSpreadMethodRepeat,
84 SVG_SPREADMETHOD_REPEAT = SVGSpreadMethodUnknown 84 SVG_SPREADMETHOD_REPEAT = SVGSpreadMethodUnknown
85 }; 85 };
86 86
87 Vector<Gradient::ColorStop> buildStops(); 87 Vector<Gradient::ColorStop> buildStops();
88 88
89 protected: 89 protected:
90 SVGGradientElement(const QualifiedName&, Document*); 90 SVGGradientElement(const QualifiedName&, Document*);
91 91
92 bool isSupportedAttribute(const QualifiedName&); 92 bool isSupportedAttribute(const QualifiedName&);
93 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE; 93 virtual void parseAttribute(const QualifiedName&, const AtomicString&) OVERR IDE;
94 virtual void svgAttributeChanged(const QualifiedName&); 94 virtual void svgAttributeChanged(const QualifiedName&);
95 95
96 virtual bool rendererIsNeeded(const NodeRenderingContext& context) OVERRIDE { return rendererIsNeededInternal(context); }
97
96 private: 98 private:
97 virtual bool needsPendingResourceHandling() const { return false; } 99 virtual bool needsPendingResourceHandling() const { return false; }
98 100
99 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0); 101 virtual void childrenChanged(bool changedByParser = false, Node* beforeChang e = 0, Node* afterChange = 0, int childCountDelta = 0);
100 102
101 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGradientElement) 103 BEGIN_DECLARE_ANIMATED_PROPERTIES(SVGGradientElement)
102 DECLARE_ANIMATED_ENUMERATION(SpreadMethod, spreadMethod, SVGSpreadMethod Type) 104 DECLARE_ANIMATED_ENUMERATION(SpreadMethod, spreadMethod, SVGSpreadMethod Type)
103 DECLARE_ANIMATED_ENUMERATION(GradientUnits, gradientUnits, SVGUnitTypes: :SVGUnitType) 105 DECLARE_ANIMATED_ENUMERATION(GradientUnits, gradientUnits, SVGUnitTypes: :SVGUnitType)
104 DECLARE_ANIMATED_TRANSFORM_LIST(GradientTransform, gradientTransform) 106 DECLARE_ANIMATED_TRANSFORM_LIST(GradientTransform, gradientTransform)
105 DECLARE_ANIMATED_STRING(Href, href) 107 DECLARE_ANIMATED_STRING(Href, href)
106 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesReq uired) 108 DECLARE_ANIMATED_BOOLEAN(ExternalResourcesRequired, externalResourcesReq uired)
107 END_DECLARE_ANIMATED_PROPERTIES 109 END_DECLARE_ANIMATED_PROPERTIES
108 }; 110 };
109 111
110 inline SVGGradientElement* toSVGGradientElement(Node* node) 112 inline SVGGradientElement* toSVGGradientElement(Node* node)
111 { 113 {
112 ASSERT_WITH_SECURITY_IMPLICATION(!node || (node->hasTagName(SVGNames::radial GradientTag) || node->hasTagName(SVGNames::linearGradientTag))); 114 ASSERT_WITH_SECURITY_IMPLICATION(!node || (node->hasTagName(SVGNames::radial GradientTag) || node->hasTagName(SVGNames::linearGradientTag)));
113 return static_cast<SVGGradientElement*>(node); 115 return static_cast<SVGGradientElement*>(node);
114 } 116 }
115 117
116 } // namespace WebCore 118 } // namespace WebCore
117 119
118 #endif 120 #endif
OLDNEW
« no previous file with comments | « Source/core/svg/SVGGlyphRefElement.idl ('k') | Source/core/svg/SVGGradientElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698