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

Side by Side Diff: third_party/WebKit/Source/core/svg/SVGAnimateElement.cpp

Issue 2706243012: Fold svgAttributeChanged into parseAttribute for SVGAnimateElement (Closed)
Patch Set: Created 3 years, 9 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 | « third_party/WebKit/Source/core/svg/SVGAnimateElement.h ('k') | no next file » | 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 Nikolas Zimmermann <zimmermann@kde.org> 2 * Copyright (C) 2004, 2005 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 * Copyright (C) 2008 Apple Inc. All rights reserved. 4 * Copyright (C) 2008 Apple Inc. All rights reserved.
5 * Copyright (C) Research In Motion Limited 2011. All rights reserved. 5 * Copyright (C) Research In Motion Limited 2011. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after
149 void SVGAnimateElement::removedFrom(ContainerNode* rootParent) { 149 void SVGAnimateElement::removedFrom(ContainerNode* rootParent) {
150 if (rootParent->isConnected()) 150 if (rootParent->isConnected())
151 setAttributeName(anyQName()); 151 setAttributeName(anyQName());
152 SVGAnimationElement::removedFrom(rootParent); 152 SVGAnimationElement::removedFrom(rootParent);
153 } 153 }
154 154
155 void SVGAnimateElement::parseAttribute( 155 void SVGAnimateElement::parseAttribute(
156 const AttributeModificationParams& params) { 156 const AttributeModificationParams& params) {
157 if (params.name == SVGNames::attributeTypeAttr) { 157 if (params.name == SVGNames::attributeTypeAttr) {
158 setAttributeType(params.newValue); 158 setAttributeType(params.newValue);
159 animationAttributeChanged();
160 return;
161 }
162 if (params.name == SVGNames::attributeNameAttr) {
163 setAttributeName(constructQualifiedName(*this, params.newValue));
164 animationAttributeChanged();
159 return; 165 return;
160 } 166 }
161 SVGAnimationElement::parseAttribute(params); 167 SVGAnimationElement::parseAttribute(params);
162 } 168 }
163 169
164 void SVGAnimateElement::svgAttributeChanged(const QualifiedName& attrName) {
165 if (attrName == SVGNames::attributeTypeAttr) {
166 } else if (attrName == SVGNames::attributeNameAttr) {
167 setAttributeName(constructQualifiedName(
168 *this, fastGetAttribute(SVGNames::attributeNameAttr)));
169 } else {
170 SVGAnimationElement::svgAttributeChanged(attrName);
171 return;
172 }
173 animationAttributeChanged();
174 }
175
176 void SVGAnimateElement::resolveTargetProperty() { 170 void SVGAnimateElement::resolveTargetProperty() {
177 DCHECK(targetElement()); 171 DCHECK(targetElement());
178 m_targetProperty = targetElement()->propertyFromAttribute(attributeName()); 172 m_targetProperty = targetElement()->propertyFromAttribute(attributeName());
179 if (m_targetProperty) { 173 if (m_targetProperty) {
180 m_type = m_targetProperty->type(); 174 m_type = m_targetProperty->type();
181 m_cssPropertyId = m_targetProperty->cssPropertyId(); 175 m_cssPropertyId = m_targetProperty->cssPropertyId();
182 176
183 // Only <animateTransform> is allowed to animate AnimatedTransformList. 177 // Only <animateTransform> is allowed to animate AnimatedTransformList.
184 // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties 178 // http://www.w3.org/TR/SVG/animate.html#AnimationAttributesAndProperties
185 if (m_type == AnimatedTransformList) { 179 if (m_type == AnimatedTransformList) {
(...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 DEFINE_TRACE(SVGAnimateElement) { 615 DEFINE_TRACE(SVGAnimateElement) {
622 visitor->trace(m_fromProperty); 616 visitor->trace(m_fromProperty);
623 visitor->trace(m_toProperty); 617 visitor->trace(m_toProperty);
624 visitor->trace(m_toAtEndOfDurationProperty); 618 visitor->trace(m_toAtEndOfDurationProperty);
625 visitor->trace(m_animatedValue); 619 visitor->trace(m_animatedValue);
626 visitor->trace(m_targetProperty); 620 visitor->trace(m_targetProperty);
627 SVGAnimationElement::trace(visitor); 621 SVGAnimationElement::trace(visitor);
628 } 622 }
629 623
630 } // namespace blink 624 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/svg/SVGAnimateElement.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698