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

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

Issue 11340016: Merge 132724 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1271/
Patch Set: Created 8 years, 1 month 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
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 21 matching lines...) Expand all
32 #include "CSSParser.h" 32 #include "CSSParser.h"
33 #include "CSSPropertyNames.h" 33 #include "CSSPropertyNames.h"
34 #include "Document.h" 34 #include "Document.h"
35 #include "FloatConversion.h" 35 #include "FloatConversion.h"
36 #include "RenderObject.h" 36 #include "RenderObject.h"
37 #include "SVGAnimateElement.h" 37 #include "SVGAnimateElement.h"
38 #include "SVGElementInstance.h" 38 #include "SVGElementInstance.h"
39 #include "SVGNames.h" 39 #include "SVGNames.h"
40 #include "SVGParserUtilities.h" 40 #include "SVGParserUtilities.h"
41 #include "SVGStyledElement.h" 41 #include "SVGStyledElement.h"
42 #include <wtf/MathExtras.h>
42 43
43 namespace WebCore { 44 namespace WebCore {
44 45
45 // Animated property definitions 46 // Animated property definitions
46 DEFINE_ANIMATED_BOOLEAN(SVGAnimationElement, SVGNames::externalResourcesRequired Attr, ExternalResourcesRequired, externalResourcesRequired) 47 DEFINE_ANIMATED_BOOLEAN(SVGAnimationElement, SVGNames::externalResourcesRequired Attr, ExternalResourcesRequired, externalResourcesRequired)
47 48
48 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAnimationElement) 49 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGAnimationElement)
49 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) 50 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
50 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests) 51 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
51 END_REGISTER_ANIMATED_PROPERTIES 52 END_REGISTER_ANIMATED_PROPERTIES
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 return narrowPrecisionToFloat(simpleDuration().value()); 234 return narrowPrecisionToFloat(simpleDuration().value());
234 } 235 }
235 236
236 void SVGAnimationElement::beginElement() 237 void SVGAnimationElement::beginElement()
237 { 238 {
238 beginElementAt(0); 239 beginElementAt(0);
239 } 240 }
240 241
241 void SVGAnimationElement::beginElementAt(float offset) 242 void SVGAnimationElement::beginElementAt(float offset)
242 { 243 {
244 if (isnan(offset))
245 return;
243 SMILTime elapsed = this->elapsed(); 246 SMILTime elapsed = this->elapsed();
244 addBeginTime(elapsed, elapsed + offset, SMILTimeWithOrigin::ScriptOrigin); 247 addBeginTime(elapsed, elapsed + offset, SMILTimeWithOrigin::ScriptOrigin);
245 } 248 }
246 249
247 void SVGAnimationElement::endElement() 250 void SVGAnimationElement::endElement()
248 { 251 {
249 endElementAt(0); 252 endElementAt(0);
250 } 253 }
251 254
252 void SVGAnimationElement::endElementAt(float offset) 255 void SVGAnimationElement::endElementAt(float offset)
253 { 256 {
257 if (isnan(offset))
258 return;
254 SMILTime elapsed = this->elapsed(); 259 SMILTime elapsed = this->elapsed();
255 addEndTime(elapsed, elapsed + offset, SMILTimeWithOrigin::ScriptOrigin); 260 addEndTime(elapsed, elapsed + offset, SMILTimeWithOrigin::ScriptOrigin);
256 } 261 }
257 262
258 AnimationMode SVGAnimationElement::animationMode() const 263 AnimationMode SVGAnimationElement::animationMode() const
259 { 264 {
260 // http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncValues 265 // http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncValues
261 if (hasTagName(SVGNames::setTag)) 266 if (hasTagName(SVGNames::setTag))
262 return ToAnimation; 267 return ToAnimation;
263 if (!animationPath().isEmpty()) 268 if (!animationPath().isEmpty())
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
672 } 677 }
673 678
674 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) 679 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target)
675 { 680 {
676 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa me()); 681 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa me());
677 } 682 }
678 683
679 } 684 }
680 685
681 #endif // ENABLE(SVG) 686 #endif // ENABLE(SVG)
OLDNEW
« no previous file with comments | « LayoutTests/svg/custom/elementTimeControl-nan-crash-expected.txt ('k') | Source/WebCore/svg/animation/SMILTime.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698