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

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

Issue 23279010: Introduce toSVGAnimateElement(), and use it (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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
« no previous file with comments | « Source/core/svg/SVGAnimateElement.cpp ('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, 2007 Rob Buis <buis@kde.org> 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org>
4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org> 4 * Copyright (C) 2007 Eric Seidel <eric@webkit.org>
5 * Copyright (C) 2008 Apple Inc. All rights reserved. 5 * Copyright (C) 2008 Apple Inc. All rights reserved.
6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au> 6 * Copyright (C) 2009 Cameron McCormack <cam@mcc.id.au>
7 * Copyright (C) Research In Motion Limited 2010. All rights reserved. 7 * Copyright (C) Research In Motion Limited 2010. All rights reserved.
8 * 8 *
9 * This library is free software; you can redistribute it and/or 9 * This library is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU Library General Public 10 * modify it under the terms of the GNU Library General Public
(...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after
500 500
501 if (percent == 1 || valuesCount == 1) { 501 if (percent == 1 || valuesCount == 1) {
502 from = m_values[valuesCount - 1]; 502 from = m_values[valuesCount - 1];
503 to = m_values[valuesCount - 1]; 503 to = m_values[valuesCount - 1];
504 effectivePercent = 1; 504 effectivePercent = 1;
505 return; 505 return;
506 } 506 }
507 507
508 CalcMode calcMode = this->calcMode(); 508 CalcMode calcMode = this->calcMode();
509 if (hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::animateColorTag )) { 509 if (hasTagName(SVGNames::animateTag) || hasTagName(SVGNames::animateColorTag )) {
510 SVGAnimateElement* animateElement = static_cast<SVGAnimateElement*>(this ); 510 AnimatedPropertyType attributeType = toSVGAnimateElement(this)->determin eAnimatedPropertyType(targetElement());
511 AnimatedPropertyType attributeType = animateElement->determineAnimatedPr opertyType(targetElement());
512 // Fall back to discrete animations for Strings. 511 // Fall back to discrete animations for Strings.
513 if (attributeType == AnimatedBoolean 512 if (attributeType == AnimatedBoolean
514 || attributeType == AnimatedEnumeration 513 || attributeType == AnimatedEnumeration
515 || attributeType == AnimatedPreserveAspectRatio 514 || attributeType == AnimatedPreserveAspectRatio
516 || attributeType == AnimatedString) 515 || attributeType == AnimatedString)
517 calcMode = CalcModeDiscrete; 516 calcMode = CalcModeDiscrete;
518 } 517 }
519 if (!m_keyPoints.isEmpty() && calcMode != CalcModePaced) 518 if (!m_keyPoints.isEmpty() && calcMode != CalcModePaced)
520 return currentValuesFromKeyPoints(percent, effectivePercent, from, to); 519 return currentValuesFromKeyPoints(percent, effectivePercent, from, to);
521 520
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 SVGSMILElement::setAttributeName(attributeName); 694 SVGSMILElement::setAttributeName(attributeName);
696 checkInvalidCSSAttributeType(targetElement()); 695 checkInvalidCSSAttributeType(targetElement());
697 } 696 }
698 697
699 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) 698 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target)
700 { 699 {
701 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa me()); 700 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa me());
702 } 701 }
703 702
704 } 703 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGAnimateElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698