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

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

Issue 453243003: Fix keyTimes list length of from/to/by animations. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Updated patch Created 6 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 | « LayoutTests/svg/animations/invalid-keytime-number-crash-expected.txt ('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 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
565 || (animationMode == ValuesAnimation && m_values.size() - 1 != splin esCount) 565 || (animationMode == ValuesAnimation && m_values.size() - 1 != splin esCount)
566 || (fastHasAttribute(SVGNames::keyTimesAttr) && m_keyTimes.size() - 1 != splinesCount)) 566 || (fastHasAttribute(SVGNames::keyTimesAttr) && m_keyTimes.size() - 1 != splinesCount))
567 return; 567 return;
568 } 568 }
569 569
570 String from = fromValue(); 570 String from = fromValue();
571 String to = toValue(); 571 String to = toValue();
572 String by = byValue(); 572 String by = byValue();
573 if (animationMode == NoAnimation) 573 if (animationMode == NoAnimation)
574 return; 574 return;
575 if ((animationMode == FromToAnimation || animationMode == FromByAnimation || animationMode == ToAnimation || animationMode == ByAnimation)
576 && (fastHasAttribute(SVGNames::keyPointsAttr) && fastHasAttribute(SVGNam es::keyTimesAttr) && (m_keyTimes.size() < 2 || m_keyTimes.size() != m_keyPoints. size())))
577 return;
575 if (animationMode == FromToAnimation) 578 if (animationMode == FromToAnimation)
576 m_animationValid = calculateFromAndToValues(from, to); 579 m_animationValid = calculateFromAndToValues(from, to);
577 else if (animationMode == ToAnimation) { 580 else if (animationMode == ToAnimation) {
578 // For to-animations the from value is the current accumulated value fro m lower priority animations. 581 // For to-animations the from value is the current accumulated value fro m lower priority animations.
579 // The value is not static and is determined during the animation. 582 // The value is not static and is determined during the animation.
580 m_animationValid = calculateFromAndToValues(emptyString(), to); 583 m_animationValid = calculateFromAndToValues(emptyString(), to);
581 } else if (animationMode == FromByAnimation) 584 } else if (animationMode == FromByAnimation)
582 m_animationValid = calculateFromAndByValues(from, by); 585 m_animationValid = calculateFromAndByValues(from, by);
583 else if (animationMode == ByAnimation) 586 else if (animationMode == ByAnimation)
584 m_animationValid = calculateFromAndByValues(emptyString(), by); 587 m_animationValid = calculateFromAndByValues(emptyString(), by);
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
684 SVGSMILElement::setAttributeName(attributeName); 687 SVGSMILElement::setAttributeName(attributeName);
685 checkInvalidCSSAttributeType(targetElement()); 688 checkInvalidCSSAttributeType(targetElement());
686 } 689 }
687 690
688 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) 691 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target)
689 { 692 {
690 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa me()); 693 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa me());
691 } 694 }
692 695
693 } 696 }
OLDNEW
« no previous file with comments | « LayoutTests/svg/animations/invalid-keytime-number-crash-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698