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 743 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 if (list[indexOfResult].time() < minimumTime && indexOfResult < sizeOfList -
1) | 754 if (list[indexOfResult].time() < minimumTime && indexOfResult < sizeOfList -
1) |
755 ++indexOfResult; | 755 ++indexOfResult; |
756 | 756 |
757 const SMILTime& currentTime = list[indexOfResult].time(); | 757 const SMILTime& currentTime = list[indexOfResult].time(); |
758 | 758 |
759 // The special value "indefinite" does not yield an instance time in the beg
in list. | 759 // The special value "indefinite" does not yield an instance time in the beg
in list. |
760 if (currentTime.isIndefinite() && beginOrEnd == Begin) | 760 if (currentTime.isIndefinite() && beginOrEnd == Begin) |
761 return SMILTime::unresolved(); | 761 return SMILTime::unresolved(); |
762 | 762 |
763 if (currentTime < minimumTime) | 763 if (currentTime < minimumTime) |
764 return beginOrEnd == Begin ? SMILTime::unresolved() : SMILTime::indefini
te(); | 764 return SMILTime::unresolved(); |
765 if (currentTime > minimumTime) | 765 if (currentTime > minimumTime) |
766 return currentTime; | 766 return currentTime; |
767 | 767 |
768 ASSERT(currentTime == minimumTime); | 768 ASSERT(currentTime == minimumTime); |
769 if (equalsMinimumOK) | 769 if (equalsMinimumOK) |
770 return currentTime; | 770 return currentTime; |
771 | 771 |
772 // If the equals is not accepted, return the next bigger item in the list. | 772 // If the equals is not accepted, return the next bigger item in the list. |
773 SMILTime nextTime = currentTime; | 773 SMILTime nextTime = currentTime; |
774 while (indexOfResult < sizeOfList - 1) { | 774 while (indexOfResult < sizeOfList - 1) { |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 m_intervalBegin = begin; | 865 m_intervalBegin = begin; |
866 m_intervalEnd = end; | 866 m_intervalEnd = end; |
867 notifyDependentsIntervalChanged(wasUnresolved ? NewInterval : ExistingIn
terval); | 867 notifyDependentsIntervalChanged(wasUnresolved ? NewInterval : ExistingIn
terval); |
868 m_nextProgressTime = min(m_nextProgressTime, m_intervalBegin); | 868 m_nextProgressTime = min(m_nextProgressTime, m_intervalBegin); |
869 | 869 |
870 if (m_timeContainer) | 870 if (m_timeContainer) |
871 m_timeContainer->notifyIntervalsChanged(); | 871 m_timeContainer->notifyIntervalsChanged(); |
872 } | 872 } |
873 } | 873 } |
874 | 874 |
875 void SVGSMILElement::resolveNextInterval(bool notifyDependents) | 875 bool SVGSMILElement::resolveNextInterval(bool notifyDependents) |
876 { | 876 { |
877 SMILTime begin; | 877 SMILTime begin; |
878 SMILTime end; | 878 SMILTime end; |
879 resolveInterval(false, begin, end); | 879 resolveInterval(false, begin, end); |
880 ASSERT(!begin.isIndefinite()); | 880 ASSERT(!begin.isIndefinite()); |
881 | 881 |
882 if (!begin.isUnresolved() && begin != m_intervalBegin) { | 882 if (!begin.isUnresolved() && begin != m_intervalBegin) { |
883 m_intervalBegin = begin; | 883 m_intervalBegin = begin; |
884 m_intervalEnd = end; | 884 m_intervalEnd = end; |
885 if (notifyDependents) | 885 if (notifyDependents) |
886 notifyDependentsIntervalChanged(NewInterval); | 886 notifyDependentsIntervalChanged(NewInterval); |
887 m_nextProgressTime = min(m_nextProgressTime, m_intervalBegin); | 887 m_nextProgressTime = min(m_nextProgressTime, m_intervalBegin); |
| 888 return true; |
888 } | 889 } |
| 890 |
| 891 return false; |
889 } | 892 } |
890 | 893 |
891 SMILTime SVGSMILElement::nextProgressTime() const | 894 SMILTime SVGSMILElement::nextProgressTime() const |
892 { | 895 { |
893 return m_nextProgressTime; | 896 return m_nextProgressTime; |
894 } | 897 } |
895 | 898 |
896 void SVGSMILElement::beginListChanged(SMILTime eventTime) | 899 void SVGSMILElement::beginListChanged(SMILTime eventTime) |
897 { | 900 { |
898 if (m_isWaitingForFirstInterval) | 901 if (m_isWaitingForFirstInterval) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
977 | 980 |
978 // If the 'nextBegin' time is unresolved (eg. just one defined interval)
, we're done seeking. | 981 // If the 'nextBegin' time is unresolved (eg. just one defined interval)
, we're done seeking. |
979 if (nextBegin.isUnresolved()) | 982 if (nextBegin.isUnresolved()) |
980 return; | 983 return; |
981 | 984 |
982 // If the 'nextBegin' time is larger than or equal to the current interv
al end time, we're done seeking. | 985 // If the 'nextBegin' time is larger than or equal to the current interv
al end time, we're done seeking. |
983 // If the 'elapsed' time is smaller than the next begin interval time, w
e're done seeking. | 986 // If the 'elapsed' time is smaller than the next begin interval time, w
e're done seeking. |
984 if (nextBegin < m_intervalEnd && elapsed >= nextBegin) { | 987 if (nextBegin < m_intervalEnd && elapsed >= nextBegin) { |
985 // End current interval, and start a new interval from the 'nextBegi
n' time. | 988 // End current interval, and start a new interval from the 'nextBegi
n' time. |
986 m_intervalEnd = nextBegin; | 989 m_intervalEnd = nextBegin; |
987 resolveNextInterval(false); | 990 if (!resolveNextInterval(false)) |
| 991 break; |
988 continue; | 992 continue; |
989 } | 993 } |
990 | 994 |
991 // If the desired 'elapsed' time is past the current interval, advance t
o the next. | 995 // If the desired 'elapsed' time is past the current interval, advance t
o the next. |
992 if (elapsed >= m_intervalEnd) { | 996 if (elapsed >= m_intervalEnd) { |
993 resolveNextInterval(false); | 997 if (!resolveNextInterval(false)) |
| 998 break; |
994 continue; | 999 continue; |
995 } | 1000 } |
996 | 1001 |
997 return; | 1002 return; |
998 } | 1003 } |
999 } | 1004 } |
1000 | 1005 |
1001 float SVGSMILElement::calculateAnimationPercentAndRepeat(SMILTime elapsed, unsig
ned& repeat) const | 1006 float SVGSMILElement::calculateAnimationPercentAndRepeat(SMILTime elapsed, unsig
ned& repeat) const |
1002 { | 1007 { |
1003 SMILTime simpleDuration = this->simpleDuration(); | 1008 SMILTime simpleDuration = this->simpleDuration(); |
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1241 if (eventType == "repeatn") { | 1246 if (eventType == "repeatn") { |
1242 unsigned repeatEventCount = m_repeatEventCountList.first(); | 1247 unsigned repeatEventCount = m_repeatEventCountList.first(); |
1243 m_repeatEventCountList.remove(0); | 1248 m_repeatEventCountList.remove(0); |
1244 dispatchEvent(Event::create(String("repeat(" + String::number(repeatEven
tCount) + ")"))); | 1249 dispatchEvent(Event::create(String("repeat(" + String::number(repeatEven
tCount) + ")"))); |
1245 } else { | 1250 } else { |
1246 dispatchEvent(Event::create(eventType)); | 1251 dispatchEvent(Event::create(eventType)); |
1247 } | 1252 } |
1248 } | 1253 } |
1249 | 1254 |
1250 } | 1255 } |
OLD | NEW |