OLD | NEW |
---|---|
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 1006 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1017 | 1017 |
1018 // If the 'nextBegin' time is unresolved (eg. just one defined interval) , we're done seeking. | 1018 // If the 'nextBegin' time is unresolved (eg. just one defined interval) , we're done seeking. |
1019 if (nextBegin.isUnresolved()) | 1019 if (nextBegin.isUnresolved()) |
1020 return; | 1020 return; |
1021 | 1021 |
1022 // If the 'nextBegin' time is larger than or equal to the current interv al end time, we're done seeking. | 1022 // If the 'nextBegin' time is larger than or equal to the current interv al end time, we're done seeking. |
1023 // If the 'elapsed' time is smaller than the next begin interval time, w e're done seeking. | 1023 // If the 'elapsed' time is smaller than the next begin interval time, w e're done seeking. |
1024 if (nextBegin < m_intervalEnd && elapsed >= nextBegin) { | 1024 if (nextBegin < m_intervalEnd && elapsed >= nextBegin) { |
1025 // End current interval, and start a new interval from the 'nextBegi n' time. | 1025 // End current interval, and start a new interval from the 'nextBegi n' time. |
1026 m_intervalEnd = nextBegin; | 1026 m_intervalEnd = nextBegin; |
1027 if (!resolveNextInterval(false)) | 1027 if (!resolveNextInterval(true)) |
pdr.
2013/11/27 06:57:01
If we do this, no callers exist with resolveNextIn
pavane
2013/11/27 07:41:30
This code is part of seekToIntervalCorrespondingTo
| |
1028 break; | 1028 break; |
1029 continue; | 1029 continue; |
1030 } | 1030 } |
1031 | 1031 |
1032 // If the desired 'elapsed' time is past the current interval, advance t o the next. | 1032 // If the desired 'elapsed' time is past the current interval, advance t o the next. |
1033 if (elapsed >= m_intervalEnd) { | 1033 if (elapsed >= m_intervalEnd) { |
1034 if (!resolveNextInterval(false)) | 1034 if (!resolveNextInterval(true)) |
1035 break; | 1035 break; |
1036 continue; | 1036 continue; |
1037 } | 1037 } |
1038 | 1038 |
1039 return; | 1039 return; |
1040 } | 1040 } |
1041 } | 1041 } |
1042 | 1042 |
1043 float SVGSMILElement::calculateAnimationPercentAndRepeat(SMILTime elapsed, unsig ned& repeat) const | 1043 float SVGSMILElement::calculateAnimationPercentAndRepeat(SMILTime elapsed, unsig ned& repeat) const |
1044 { | 1044 { |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1103 // Animation does not contribute during the active time if it is past its re peating duration and has fill=remove. | 1103 // Animation does not contribute during the active time if it is past its re peating duration and has fill=remove. |
1104 return (m_activeState == Active && (fill() == FillFreeze || elapsed <= m_int ervalBegin + repeatingDuration())) || m_activeState == Frozen; | 1104 return (m_activeState == Active && (fill() == FillFreeze || elapsed <= m_int ervalBegin + repeatingDuration())) || m_activeState == Frozen; |
1105 } | 1105 } |
1106 | 1106 |
1107 bool SVGSMILElement::progress(SMILTime elapsed, SVGSMILElement* resultElement, b ool seekToTime) | 1107 bool SVGSMILElement::progress(SMILTime elapsed, SVGSMILElement* resultElement, b ool seekToTime) |
1108 { | 1108 { |
1109 ASSERT(resultElement); | 1109 ASSERT(resultElement); |
1110 ASSERT(m_timeContainer); | 1110 ASSERT(m_timeContainer); |
1111 ASSERT(m_isWaitingForFirstInterval || m_intervalBegin.isFinite()); | 1111 ASSERT(m_isWaitingForFirstInterval || m_intervalBegin.isFinite()); |
1112 | 1112 |
1113 if (!m_conditionsConnected) | |
1114 connectConditions(); | |
1115 | |
1113 if (!m_intervalBegin.isFinite()) { | 1116 if (!m_intervalBegin.isFinite()) { |
1114 ASSERT(m_activeState == Inactive); | 1117 ASSERT(m_activeState == Inactive); |
1115 m_nextProgressTime = SMILTime::unresolved(); | 1118 m_nextProgressTime = SMILTime::unresolved(); |
1116 return false; | 1119 return false; |
1117 } | 1120 } |
1118 | 1121 |
1119 if (elapsed < m_intervalBegin) { | 1122 if (elapsed < m_intervalBegin) { |
1120 ASSERT(m_activeState != Active); | 1123 ASSERT(m_activeState != Active); |
1121 if (m_activeState == Frozen) { | 1124 if (m_activeState == Frozen) { |
1122 if (this == resultElement) | 1125 if (this == resultElement) |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1286 if (eventType == "repeatn") { | 1289 if (eventType == "repeatn") { |
1287 unsigned repeatEventCount = m_repeatEventCountList.first(); | 1290 unsigned repeatEventCount = m_repeatEventCountList.first(); |
1288 m_repeatEventCountList.remove(0); | 1291 m_repeatEventCountList.remove(0); |
1289 dispatchEvent(RepeatEvent::create(eventType, repeatEventCount)); | 1292 dispatchEvent(RepeatEvent::create(eventType, repeatEventCount)); |
1290 } else { | 1293 } else { |
1291 dispatchEvent(Event::create(eventType)); | 1294 dispatchEvent(Event::create(eventType)); |
1292 } | 1295 } |
1293 } | 1296 } |
1294 | 1297 |
1295 } | 1298 } |
OLD | NEW |