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

Side by Side Diff: Source/core/svg/SVGRadialGradientElement.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/SVGRadialGradientElement.h ('k') | Source/core/svg/SVGRectElement.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 * Copyright (C) 2008 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2008 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org> 5 * Copyright (C) 2008 Dirk Schulze <krit@webkit.org>
6 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 6 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
7 * 7 *
8 * This library is free software; you can redistribute it and/or 8 * This library is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU Library General Public 9 * modify it under the terms of the GNU Library General Public
10 * License as published by the Free Software Foundation; either 10 * License as published by the Free Software Foundation; either
(...skipping 13 matching lines...) Expand all
24 #include "config.h" 24 #include "config.h"
25 25
26 #include "core/svg/SVGRadialGradientElement.h" 26 #include "core/svg/SVGRadialGradientElement.h"
27 27
28 #include "core/rendering/svg/RenderSVGResourceRadialGradient.h" 28 #include "core/rendering/svg/RenderSVGResourceRadialGradient.h"
29 #include "core/svg/RadialGradientAttributes.h" 29 #include "core/svg/RadialGradientAttributes.h"
30 #include "core/svg/SVGTransformList.h" 30 #include "core/svg/SVGTransformList.h"
31 31
32 namespace WebCore { 32 namespace WebCore {
33 33
34 SVGRadialGradientElement::SVGRadialGradientElement(Document& document) 34 inline SVGRadialGradientElement::SVGRadialGradientElement(Document& document)
35 : SVGGradientElement(SVGNames::radialGradientTag, document) 35 : SVGGradientElement(SVGNames::radialGradientTag, document)
36 , m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(L engthModeWidth), AllowNegativeLengths)) 36 , m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(L engthModeWidth), AllowNegativeLengths))
37 , m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(L engthModeHeight), AllowNegativeLengths)) 37 , m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(L engthModeHeight), AllowNegativeLengths))
38 , m_r(SVGAnimatedLength::create(this, SVGNames::rAttr, SVGLength::create(Len gthModeOther), ForbidNegativeLengths)) 38 , m_r(SVGAnimatedLength::create(this, SVGNames::rAttr, SVGLength::create(Len gthModeOther), ForbidNegativeLengths))
39 , m_fx(SVGAnimatedLength::create(this, SVGNames::fxAttr, SVGLength::create(L engthModeWidth), AllowNegativeLengths)) 39 , m_fx(SVGAnimatedLength::create(this, SVGNames::fxAttr, SVGLength::create(L engthModeWidth), AllowNegativeLengths))
40 , m_fy(SVGAnimatedLength::create(this, SVGNames::fyAttr, SVGLength::create(L engthModeHeight), AllowNegativeLengths)) 40 , m_fy(SVGAnimatedLength::create(this, SVGNames::fyAttr, SVGLength::create(L engthModeHeight), AllowNegativeLengths))
41 , m_fr(SVGAnimatedLength::create(this, SVGNames::frAttr, SVGLength::create(L engthModeOther), ForbidNegativeLengths)) 41 , m_fr(SVGAnimatedLength::create(this, SVGNames::frAttr, SVGLength::create(L engthModeOther), ForbidNegativeLengths))
42 { 42 {
43 ScriptWrappable::init(this); 43 ScriptWrappable::init(this);
44 44
45 // Spec: If the cx/cy/r attribute is not specified, the effect is as if a va lue of "50%" were specified. 45 // Spec: If the cx/cy/r attribute is not specified, the effect is as if a va lue of "50%" were specified.
46 m_cx->setDefaultValueAsString("50%"); 46 m_cx->setDefaultValueAsString("50%");
47 m_cy->setDefaultValueAsString("50%"); 47 m_cy->setDefaultValueAsString("50%");
48 m_r->setDefaultValueAsString("50%"); 48 m_r->setDefaultValueAsString("50%");
49 49
50 // SVG2-Draft Spec: If the fr attributed is not specified, the effect is as if a value of "0%" were specified. 50 // SVG2-Draft Spec: If the fr attributed is not specified, the effect is as if a value of "0%" were specified.
51 m_fr->setDefaultValueAsString("0%"); 51 m_fr->setDefaultValueAsString("0%");
52 52
53 addToPropertyMap(m_cx); 53 addToPropertyMap(m_cx);
54 addToPropertyMap(m_cy); 54 addToPropertyMap(m_cy);
55 addToPropertyMap(m_r); 55 addToPropertyMap(m_r);
56 addToPropertyMap(m_fx); 56 addToPropertyMap(m_fx);
57 addToPropertyMap(m_fy); 57 addToPropertyMap(m_fy);
58 addToPropertyMap(m_fr); 58 addToPropertyMap(m_fr);
59 } 59 }
60 60
61 DEFINE_NODE_FACTORY(SVGRadialGradientElement)
62
61 bool SVGRadialGradientElement::isSupportedAttribute(const QualifiedName& attrNam e) 63 bool SVGRadialGradientElement::isSupportedAttribute(const QualifiedName& attrNam e)
62 { 64 {
63 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 65 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
64 if (supportedAttributes.isEmpty()) { 66 if (supportedAttributes.isEmpty()) {
65 supportedAttributes.add(SVGNames::cxAttr); 67 supportedAttributes.add(SVGNames::cxAttr);
66 supportedAttributes.add(SVGNames::cyAttr); 68 supportedAttributes.add(SVGNames::cyAttr);
67 supportedAttributes.add(SVGNames::fxAttr); 69 supportedAttributes.add(SVGNames::fxAttr);
68 supportedAttributes.add(SVGNames::fyAttr); 70 supportedAttributes.add(SVGNames::fyAttr);
69 supportedAttributes.add(SVGNames::rAttr); 71 supportedAttributes.add(SVGNames::rAttr);
70 supportedAttributes.add(SVGNames::frAttr); 72 supportedAttributes.add(SVGNames::frAttr);
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
205 { 207 {
206 return m_cx->currentValue()->isRelative() 208 return m_cx->currentValue()->isRelative()
207 || m_cy->currentValue()->isRelative() 209 || m_cy->currentValue()->isRelative()
208 || m_r->currentValue()->isRelative() 210 || m_r->currentValue()->isRelative()
209 || m_fx->currentValue()->isRelative() 211 || m_fx->currentValue()->isRelative()
210 || m_fy->currentValue()->isRelative() 212 || m_fy->currentValue()->isRelative()
211 || m_fr->currentValue()->isRelative(); 213 || m_fr->currentValue()->isRelative();
212 } 214 }
213 215
214 } 216 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGRadialGradientElement.h ('k') | Source/core/svg/SVGRectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698