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

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

Issue 62083002: Remove support for the externalResourcesRequired attribute. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: rebaseline test Created 6 years, 11 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
« no previous file with comments | « Source/core/svg/SVGGradientElement.h ('k') | Source/core/svg/SVGGradientElement.idl » ('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) Research In Motion Limited 2010. All rights reserved. 4 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 22 matching lines...) Expand all
33 #include "core/svg/SVGStopElement.h" 33 #include "core/svg/SVGStopElement.h"
34 #include "core/svg/SVGTransformList.h" 34 #include "core/svg/SVGTransformList.h"
35 35
36 namespace WebCore { 36 namespace WebCore {
37 37
38 // Animated property definitions 38 // Animated property definitions
39 DEFINE_ANIMATED_ENUMERATION(SVGGradientElement, SVGNames::spreadMethodAttr, Spre adMethod, spreadMethod, SVGSpreadMethodType) 39 DEFINE_ANIMATED_ENUMERATION(SVGGradientElement, SVGNames::spreadMethodAttr, Spre adMethod, spreadMethod, SVGSpreadMethodType)
40 DEFINE_ANIMATED_ENUMERATION(SVGGradientElement, SVGNames::gradientUnitsAttr, Gra dientUnits, gradientUnits, SVGUnitTypes::SVGUnitType) 40 DEFINE_ANIMATED_ENUMERATION(SVGGradientElement, SVGNames::gradientUnitsAttr, Gra dientUnits, gradientUnits, SVGUnitTypes::SVGUnitType)
41 DEFINE_ANIMATED_TRANSFORM_LIST(SVGGradientElement, SVGNames::gradientTransformAt tr, GradientTransform, gradientTransform) 41 DEFINE_ANIMATED_TRANSFORM_LIST(SVGGradientElement, SVGNames::gradientTransformAt tr, GradientTransform, gradientTransform)
42 DEFINE_ANIMATED_STRING(SVGGradientElement, XLinkNames::hrefAttr, Href, href) 42 DEFINE_ANIMATED_STRING(SVGGradientElement, XLinkNames::hrefAttr, Href, href)
43 DEFINE_ANIMATED_BOOLEAN(SVGGradientElement, SVGNames::externalResourcesRequiredA ttr, ExternalResourcesRequired, externalResourcesRequired)
44 43
45 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGGradientElement) 44 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGGradientElement)
46 REGISTER_LOCAL_ANIMATED_PROPERTY(spreadMethod) 45 REGISTER_LOCAL_ANIMATED_PROPERTY(spreadMethod)
47 REGISTER_LOCAL_ANIMATED_PROPERTY(gradientUnits) 46 REGISTER_LOCAL_ANIMATED_PROPERTY(gradientUnits)
48 REGISTER_LOCAL_ANIMATED_PROPERTY(gradientTransform) 47 REGISTER_LOCAL_ANIMATED_PROPERTY(gradientTransform)
49 REGISTER_LOCAL_ANIMATED_PROPERTY(href) 48 REGISTER_LOCAL_ANIMATED_PROPERTY(href)
50 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
51 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) 49 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement)
52 END_REGISTER_ANIMATED_PROPERTIES 50 END_REGISTER_ANIMATED_PROPERTIES
53 51
54 SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document& d ocument) 52 SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document& d ocument)
55 : SVGElement(tagName, document) 53 : SVGElement(tagName, document)
56 , m_spreadMethod(SVGSpreadMethodPad) 54 , m_spreadMethod(SVGSpreadMethodPad)
57 , m_gradientUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) 55 , m_gradientUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX)
58 { 56 {
59 ScriptWrappable::init(this); 57 ScriptWrappable::init(this);
60 registerAnimatedPropertiesForSVGGradientElement(); 58 registerAnimatedPropertiesForSVGGradientElement();
61 } 59 }
62 60
63 bool SVGGradientElement::isSupportedAttribute(const QualifiedName& attrName) 61 bool SVGGradientElement::isSupportedAttribute(const QualifiedName& attrName)
64 { 62 {
65 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); 63 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
66 if (supportedAttributes.isEmpty()) { 64 if (supportedAttributes.isEmpty()) {
67 SVGURIReference::addSupportedAttributes(supportedAttributes); 65 SVGURIReference::addSupportedAttributes(supportedAttributes);
68 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes );
69 supportedAttributes.add(SVGNames::gradientUnitsAttr); 66 supportedAttributes.add(SVGNames::gradientUnitsAttr);
70 supportedAttributes.add(SVGNames::gradientTransformAttr); 67 supportedAttributes.add(SVGNames::gradientTransformAttr);
71 supportedAttributes.add(SVGNames::spreadMethodAttr); 68 supportedAttributes.add(SVGNames::spreadMethodAttr);
72 } 69 }
73 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); 70 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
74 } 71 }
75 72
76 void SVGGradientElement::parseAttribute(const QualifiedName& name, const AtomicS tring& value) 73 void SVGGradientElement::parseAttribute(const QualifiedName& name, const AtomicS tring& value)
77 { 74 {
78 if (!isSupportedAttribute(name)) { 75 if (!isSupportedAttribute(name)) {
(...skipping 18 matching lines...) Expand all
97 94
98 if (name == SVGNames::spreadMethodAttr) { 95 if (name == SVGNames::spreadMethodAttr) {
99 SVGSpreadMethodType propertyValue = SVGPropertyTraits<SVGSpreadMethodTyp e>::fromString(value); 96 SVGSpreadMethodType propertyValue = SVGPropertyTraits<SVGSpreadMethodTyp e>::fromString(value);
100 if (propertyValue > 0) 97 if (propertyValue > 0)
101 setSpreadMethodBaseValue(propertyValue); 98 setSpreadMethodBaseValue(propertyValue);
102 return; 99 return;
103 } 100 }
104 101
105 if (SVGURIReference::parseAttribute(name, value)) 102 if (SVGURIReference::parseAttribute(name, value))
106 return; 103 return;
107 if (SVGExternalResourcesRequired::parseAttribute(name, value))
108 return;
109 104
110 ASSERT_NOT_REACHED(); 105 ASSERT_NOT_REACHED();
111 } 106 }
112 107
113 void SVGGradientElement::svgAttributeChanged(const QualifiedName& attrName) 108 void SVGGradientElement::svgAttributeChanged(const QualifiedName& attrName)
114 { 109 {
115 if (!isSupportedAttribute(attrName)) { 110 if (!isSupportedAttribute(attrName)) {
116 SVGElement::svgAttributeChanged(attrName); 111 SVGElement::svgAttributeChanged(attrName);
117 return; 112 return;
118 } 113 }
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 float r, g, b, a; 153 float r, g, b, a;
159 color.getRGBA(r, g, b, a); 154 color.getRGBA(r, g, b, a);
160 155
161 stops.append(Gradient::ColorStop(offset, r, g, b, a)); 156 stops.append(Gradient::ColorStop(offset, r, g, b, a));
162 } 157 }
163 158
164 return stops; 159 return stops;
165 } 160 }
166 161
167 } 162 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGGradientElement.h ('k') | Source/core/svg/SVGGradientElement.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698