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

Side by Side Diff: Source/core/svg/animation/SVGSMILElement.cpp

Issue 190793011: Use isSVG*Element() helpers more in SVG code (Part 4) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « Source/core/svg/SVGUseElement.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) 2008 Apple Inc. All rights reserved. 2 * Copyright (C) 2008 Apple Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions 5 * modification, are permitted provided that the following conditions
6 * are met: 6 * are met:
7 * 1. Redistributions of source code must retain the above copyright 7 * 1. Redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer. 8 * notice, this list of conditions and the following disclaimer.
9 * 2. Redistributions in binary form must reproduce the above copyright 9 * 2. Redistributions in binary form must reproduce the above copyright
10 * notice, this list of conditions and the following disclaimer in the 10 * notice, this list of conditions and the following disclaimer in the
(...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after
1092 repeat = static_cast<unsigned>(activeTime.value() / simpleDuration.value()); 1092 repeat = static_cast<unsigned>(activeTime.value() / simpleDuration.value());
1093 SMILTime simpleTime = fmod(activeTime.value(), simpleDuration.value()); 1093 SMILTime simpleTime = fmod(activeTime.value(), simpleDuration.value());
1094 return narrowPrecisionToFloat(simpleTime.value() / simpleDuration.value()); 1094 return narrowPrecisionToFloat(simpleTime.value() / simpleDuration.value());
1095 } 1095 }
1096 1096
1097 SMILTime SVGSMILElement::calculateNextProgressTime(SMILTime elapsed) const 1097 SMILTime SVGSMILElement::calculateNextProgressTime(SMILTime elapsed) const
1098 { 1098 {
1099 if (m_activeState == Active) { 1099 if (m_activeState == Active) {
1100 // If duration is indefinite the value does not actually change over tim e. Same is true for <set>. 1100 // If duration is indefinite the value does not actually change over tim e. Same is true for <set>.
1101 SMILTime simpleDuration = this->simpleDuration(); 1101 SMILTime simpleDuration = this->simpleDuration();
1102 if (simpleDuration.isIndefinite() || hasTagName(SVGNames::setTag)) { 1102 if (simpleDuration.isIndefinite() || isSVGSetElement(*this)) {
1103 SMILTime repeatingDurationEnd = m_intervalBegin + repeatingDuration( ); 1103 SMILTime repeatingDurationEnd = m_intervalBegin + repeatingDuration( );
1104 // We are supposed to do freeze semantics when repeating ends, even if the element is still active. 1104 // We are supposed to do freeze semantics when repeating ends, even if the element is still active.
1105 // Take care that we get a timer callback at that point. 1105 // Take care that we get a timer callback at that point.
1106 if (elapsed < repeatingDurationEnd && repeatingDurationEnd < m_inter valEnd && repeatingDurationEnd.isFinite()) 1106 if (elapsed < repeatingDurationEnd && repeatingDurationEnd < m_inter valEnd && repeatingDurationEnd.isFinite())
1107 return repeatingDurationEnd; 1107 return repeatingDurationEnd;
1108 return m_intervalEnd; 1108 return m_intervalEnd;
1109 } 1109 }
1110 return elapsed + 0.025; 1110 return elapsed + 0.025;
1111 } 1111 }
1112 return m_intervalBegin >= elapsed ? m_intervalBegin : SMILTime::unresolved() ; 1112 return m_intervalBegin >= elapsed ? m_intervalBegin : SMILTime::unresolved() ;
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
1312 if (eventType == "repeatn") { 1312 if (eventType == "repeatn") {
1313 unsigned repeatEventCount = m_repeatEventCountList.first(); 1313 unsigned repeatEventCount = m_repeatEventCountList.first();
1314 m_repeatEventCountList.remove(0); 1314 m_repeatEventCountList.remove(0);
1315 dispatchEvent(RepeatEvent::create(eventType, repeatEventCount)); 1315 dispatchEvent(RepeatEvent::create(eventType, repeatEventCount));
1316 } else { 1316 } else {
1317 dispatchEvent(Event::create(eventType)); 1317 dispatchEvent(Event::create(eventType));
1318 } 1318 }
1319 } 1319 }
1320 1320
1321 } 1321 }
OLDNEW
« no previous file with comments | « Source/core/svg/SVGUseElement.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698