OLD | NEW |
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 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 return narrowPrecisionToFloat(simpleDuration().value()); | 251 return narrowPrecisionToFloat(simpleDuration().value()); |
252 } | 252 } |
253 | 253 |
254 void SVGAnimationElement::beginElement() | 254 void SVGAnimationElement::beginElement() |
255 { | 255 { |
256 beginElementAt(0); | 256 beginElementAt(0); |
257 } | 257 } |
258 | 258 |
259 void SVGAnimationElement::beginElementAt(float offset) | 259 void SVGAnimationElement::beginElementAt(float offset) |
260 { | 260 { |
261 if (std::isnan(offset)) | 261 if (!std::isfinite(offset)) |
262 return; | 262 return; |
263 SMILTime elapsed = this->elapsed(); | 263 SMILTime elapsed = this->elapsed(); |
264 addBeginTime(elapsed, elapsed + offset, SMILTimeWithOrigin::ScriptOrigin); | 264 addBeginTime(elapsed, elapsed + offset, SMILTimeWithOrigin::ScriptOrigin); |
265 } | 265 } |
266 | 266 |
267 void SVGAnimationElement::endElement() | 267 void SVGAnimationElement::endElement() |
268 { | 268 { |
269 endElementAt(0); | 269 endElementAt(0); |
270 } | 270 } |
271 | 271 |
272 void SVGAnimationElement::endElementAt(float offset) | 272 void SVGAnimationElement::endElementAt(float offset) |
273 { | 273 { |
274 if (std::isnan(offset)) | 274 if (!std::isfinite(offset)) |
275 return; | 275 return; |
276 SMILTime elapsed = this->elapsed(); | 276 SMILTime elapsed = this->elapsed(); |
277 addEndTime(elapsed, elapsed + offset, SMILTimeWithOrigin::ScriptOrigin); | 277 addEndTime(elapsed, elapsed + offset, SMILTimeWithOrigin::ScriptOrigin); |
278 } | 278 } |
279 | 279 |
280 void SVGAnimationElement::updateAnimationMode() | 280 void SVGAnimationElement::updateAnimationMode() |
281 { | 281 { |
282 // http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncValues | 282 // http://www.w3.org/TR/2001/REC-smil-animation-20010904/#AnimFuncValues |
283 if (hasAttribute(SVGNames::valuesAttr)) | 283 if (hasAttribute(SVGNames::valuesAttr)) |
284 setAnimationMode(ValuesAnimation); | 284 setAnimationMode(ValuesAnimation); |
(...skipping 424 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
709 SVGSMILElement::setAttributeName(attributeName); | 709 SVGSMILElement::setAttributeName(attributeName); |
710 checkInvalidCSSAttributeType(targetElement()); | 710 checkInvalidCSSAttributeType(targetElement()); |
711 } | 711 } |
712 | 712 |
713 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) | 713 void SVGAnimationElement::checkInvalidCSSAttributeType(SVGElement* target) |
714 { | 714 { |
715 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut
eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa
me()); | 715 m_hasInvalidCSSAttributeType = target && hasValidAttributeName() && attribut
eType() == AttributeTypeCSS && !isTargetAttributeCSSProperty(target, attributeNa
me()); |
716 } | 716 } |
717 | 717 |
718 } | 718 } |
OLD | NEW |