| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 if (!svgTarget) { | 210 if (!svgTarget) { |
| 211 // Do not register as pending if we are already pending this resource. | 211 // Do not register as pending if we are already pending this resource. |
| 212 if (document().accessSVGExtensions().isElementPendingResource(this, id)) | 212 if (document().accessSVGExtensions().isElementPendingResource(this, id)) |
| 213 return; | 213 return; |
| 214 | 214 |
| 215 if (!id.isEmpty()) { | 215 if (!id.isEmpty()) { |
| 216 document().accessSVGExtensions().addPendingResource(id, this); | 216 document().accessSVGExtensions().addPendingResource(id, this); |
| 217 ASSERT(hasPendingResources()); | 217 ASSERT(hasPendingResources()); |
| 218 } | 218 } |
| 219 } else { | 219 } else { |
| 220 // Register us with the target in the dependencies map. Any change of hrefEl
ement | 220 // Register us with the target in the dependencies map. Any change of |
| 221 // that leads to relayout/repainting now informs us, so we can react to it. | 221 // hrefElement that leads to relayout/repainting now informs us, so we can |
| 222 // react to it. |
| 222 addReferenceTo(svgTarget); | 223 addReferenceTo(svgTarget); |
| 223 } | 224 } |
| 224 connectEventBaseConditions(); | 225 connectEventBaseConditions(); |
| 225 } | 226 } |
| 226 | 227 |
| 227 static inline QualifiedName constructQualifiedName( | 228 static inline QualifiedName constructQualifiedName( |
| 228 const SVGElement* svgElement, | 229 const SVGElement* svgElement, |
| 229 const AtomicString& attributeName) { | 230 const AtomicString& attributeName) { |
| 230 ASSERT(svgElement); | 231 ASSERT(svgElement); |
| 231 if (attributeName.isEmpty()) | 232 if (attributeName.isEmpty()) |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 setAttributeName(constructQualifiedName( | 289 setAttributeName(constructQualifiedName( |
| 289 this, fastGetAttribute(SVGNames::attributeNameAttr))); | 290 this, fastGetAttribute(SVGNames::attributeNameAttr))); |
| 290 SVGSVGElement* owner = ownerSVGElement(); | 291 SVGSVGElement* owner = ownerSVGElement(); |
| 291 if (!owner) | 292 if (!owner) |
| 292 return InsertionDone; | 293 return InsertionDone; |
| 293 | 294 |
| 294 m_timeContainer = owner->timeContainer(); | 295 m_timeContainer = owner->timeContainer(); |
| 295 ASSERT(m_timeContainer); | 296 ASSERT(m_timeContainer); |
| 296 m_timeContainer->setDocumentOrderIndexesDirty(); | 297 m_timeContainer->setDocumentOrderIndexesDirty(); |
| 297 | 298 |
| 298 // "If no attribute is present, the default begin value (an offset-value of 0)
must be evaluated." | 299 // "If no attribute is present, the default begin value (an offset-value of 0) |
| 300 // must be evaluated." |
| 299 if (!fastHasAttribute(SVGNames::beginAttr)) | 301 if (!fastHasAttribute(SVGNames::beginAttr)) |
| 300 m_beginTimes.append(SMILTimeWithOrigin()); | 302 m_beginTimes.append(SMILTimeWithOrigin()); |
| 301 | 303 |
| 302 if (m_isWaitingForFirstInterval) | 304 if (m_isWaitingForFirstInterval) |
| 303 resolveFirstInterval(); | 305 resolveFirstInterval(); |
| 304 | 306 |
| 305 if (m_timeContainer) | 307 if (m_timeContainer) |
| 306 m_timeContainer->notifyIntervalsChanged(); | 308 m_timeContainer->notifyIntervalsChanged(); |
| 307 | 309 |
| 308 buildPendingResource(); | 310 buildPendingResource(); |
| (...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 524 m_cachedRepeatCount = invalidCachedTime; | 526 m_cachedRepeatCount = invalidCachedTime; |
| 525 } else if (attrName == SVGNames::minAttr) { | 527 } else if (attrName == SVGNames::minAttr) { |
| 526 m_cachedMin = invalidCachedTime; | 528 m_cachedMin = invalidCachedTime; |
| 527 } else if (attrName == SVGNames::maxAttr) { | 529 } else if (attrName == SVGNames::maxAttr) { |
| 528 m_cachedMax = invalidCachedTime; | 530 m_cachedMax = invalidCachedTime; |
| 529 } else if (attrName == SVGNames::attributeNameAttr) { | 531 } else if (attrName == SVGNames::attributeNameAttr) { |
| 530 setAttributeName(constructQualifiedName( | 532 setAttributeName(constructQualifiedName( |
| 531 this, fastGetAttribute(SVGNames::attributeNameAttr))); | 533 this, fastGetAttribute(SVGNames::attributeNameAttr))); |
| 532 } else if (attrName.matches(SVGNames::hrefAttr) || | 534 } else if (attrName.matches(SVGNames::hrefAttr) || |
| 533 attrName.matches(XLinkNames::hrefAttr)) { | 535 attrName.matches(XLinkNames::hrefAttr)) { |
| 534 // TODO(fs): Could be smarter here when 'href' is specified and 'xlink:href'
is changed. | 536 // TODO(fs): Could be smarter here when 'href' is specified and 'xlink:href' |
| 537 // is changed. |
| 535 SVGElement::InvalidationGuard invalidationGuard(this); | 538 SVGElement::InvalidationGuard invalidationGuard(this); |
| 536 buildPendingResource(); | 539 buildPendingResource(); |
| 537 if (m_targetElement) | 540 if (m_targetElement) |
| 538 clearAnimatedType(); | 541 clearAnimatedType(); |
| 539 } else if (attrName == SVGNames::beginAttr || attrName == SVGNames::endAttr) { | 542 } else if (attrName == SVGNames::beginAttr || attrName == SVGNames::endAttr) { |
| 540 if (isConnected()) { | 543 if (isConnected()) { |
| 541 connectEventBaseConditions(); | 544 connectEventBaseConditions(); |
| 542 if (attrName == SVGNames::beginAttr) | 545 if (attrName == SVGNames::beginAttr) |
| 543 beginListChanged(elapsed()); | 546 beginListChanged(elapsed()); |
| 544 else if (attrName == SVGNames::endAttr) | 547 else if (attrName == SVGNames::endAttr) |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 654 | 657 |
| 655 void SVGSMILElement::setTargetElement(SVGElement* target) { | 658 void SVGSMILElement::setTargetElement(SVGElement* target) { |
| 656 unscheduleIfScheduled(); | 659 unscheduleIfScheduled(); |
| 657 | 660 |
| 658 if (m_targetElement) { | 661 if (m_targetElement) { |
| 659 // Clear values that may depend on the previous target. | 662 // Clear values that may depend on the previous target. |
| 660 clearAnimatedType(); | 663 clearAnimatedType(); |
| 661 disconnectSyncBaseConditions(); | 664 disconnectSyncBaseConditions(); |
| 662 } | 665 } |
| 663 | 666 |
| 664 // If the animation state is not Inactive, always reset to a clear state befor
e leaving the old target element. | 667 // If the animation state is not Inactive, always reset to a clear state |
| 668 // before leaving the old target element. |
| 665 if (m_activeState != Inactive) | 669 if (m_activeState != Inactive) |
| 666 endedActiveInterval(); | 670 endedActiveInterval(); |
| 667 | 671 |
| 668 m_targetElement = target; | 672 m_targetElement = target; |
| 669 schedule(); | 673 schedule(); |
| 670 } | 674 } |
| 671 | 675 |
| 672 SMILTime SVGSMILElement::elapsed() const { | 676 SMILTime SVGSMILElement::elapsed() const { |
| 673 return m_timeContainer ? m_timeContainer->elapsed() : 0; | 677 return m_timeContainer ? m_timeContainer->elapsed() : 0; |
| 674 } | 678 } |
| (...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 788 | 792 |
| 789 const SMILTimeWithOrigin dummyTimeWithOrigin( | 793 const SMILTimeWithOrigin dummyTimeWithOrigin( |
| 790 minimumTime, SMILTimeWithOrigin::ParserOrigin); | 794 minimumTime, SMILTimeWithOrigin::ParserOrigin); |
| 791 const SMILTimeWithOrigin* result = std::lower_bound( | 795 const SMILTimeWithOrigin* result = std::lower_bound( |
| 792 list.begin(), list.end(), dummyTimeWithOrigin, compareTimes); | 796 list.begin(), list.end(), dummyTimeWithOrigin, compareTimes); |
| 793 int indexOfResult = result - list.begin(); | 797 int indexOfResult = result - list.begin(); |
| 794 if (indexOfResult == sizeOfList) | 798 if (indexOfResult == sizeOfList) |
| 795 return SMILTime::unresolved(); | 799 return SMILTime::unresolved(); |
| 796 const SMILTime& currentTime = list[indexOfResult].time(); | 800 const SMILTime& currentTime = list[indexOfResult].time(); |
| 797 | 801 |
| 798 // The special value "indefinite" does not yield an instance time in the begin
list. | 802 // The special value "indefinite" does not yield an instance time in the begin |
| 803 // list. |
| 799 if (currentTime.isIndefinite() && beginOrEnd == Begin) | 804 if (currentTime.isIndefinite() && beginOrEnd == Begin) |
| 800 return SMILTime::unresolved(); | 805 return SMILTime::unresolved(); |
| 801 | 806 |
| 802 if (currentTime > minimumTime) | 807 if (currentTime > minimumTime) |
| 803 return currentTime; | 808 return currentTime; |
| 804 | 809 |
| 805 ASSERT(currentTime == minimumTime); | 810 ASSERT(currentTime == minimumTime); |
| 806 if (equalsMinimumOK) | 811 if (equalsMinimumOK) |
| 807 return currentTime; | 812 return currentTime; |
| 808 | 813 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1003 if (resolveNextInterval() && elapsed >= m_interval.begin) | 1008 if (resolveNextInterval() && elapsed >= m_interval.begin) |
| 1004 return DidRestartInterval; | 1009 return DidRestartInterval; |
| 1005 } | 1010 } |
| 1006 return DidNotRestartInterval; | 1011 return DidNotRestartInterval; |
| 1007 } | 1012 } |
| 1008 | 1013 |
| 1009 void SVGSMILElement::seekToIntervalCorrespondingToTime(SMILTime elapsed) { | 1014 void SVGSMILElement::seekToIntervalCorrespondingToTime(SMILTime elapsed) { |
| 1010 ASSERT(!m_isWaitingForFirstInterval); | 1015 ASSERT(!m_isWaitingForFirstInterval); |
| 1011 ASSERT(elapsed >= m_interval.begin); | 1016 ASSERT(elapsed >= m_interval.begin); |
| 1012 | 1017 |
| 1013 // Manually seek from interval to interval, just as if the animation would run
regulary. | 1018 // Manually seek from interval to interval, just as if the animation would run |
| 1019 // regulary. |
| 1014 while (true) { | 1020 while (true) { |
| 1015 // Figure out the next value in the begin time list after the current interv
al begin. | 1021 // Figure out the next value in the begin time list after the current |
| 1022 // interval begin. |
| 1016 SMILTime nextBegin = findInstanceTime(Begin, m_interval.begin, false); | 1023 SMILTime nextBegin = findInstanceTime(Begin, m_interval.begin, false); |
| 1017 | 1024 |
| 1018 // If the 'nextBegin' time is unresolved (eg. just one defined interval), we
're done seeking. | 1025 // If the 'nextBegin' time is unresolved (eg. just one defined interval), |
| 1026 // we're done seeking. |
| 1019 if (nextBegin.isUnresolved()) | 1027 if (nextBegin.isUnresolved()) |
| 1020 return; | 1028 return; |
| 1021 | 1029 |
| 1022 // If the 'nextBegin' time is larger than or equal to the current interval e
nd time, we're done seeking. | 1030 // If the 'nextBegin' time is larger than or equal to the current interval |
| 1023 // If the 'elapsed' time is smaller than the next begin interval time, we're
done seeking. | 1031 // end time, we're done seeking. If the 'elapsed' time is smaller than the |
| 1032 // next begin interval time, we're done seeking. |
| 1024 if (nextBegin < m_interval.end && elapsed >= nextBegin) { | 1033 if (nextBegin < m_interval.end && elapsed >= nextBegin) { |
| 1025 // End current interval, and start a new interval from the 'nextBegin' tim
e. | 1034 // End current interval, and start a new interval from the 'nextBegin' |
| 1035 // time. |
| 1026 m_interval.end = nextBegin; | 1036 m_interval.end = nextBegin; |
| 1027 if (!resolveNextInterval()) | 1037 if (!resolveNextInterval()) |
| 1028 break; | 1038 break; |
| 1029 continue; | 1039 continue; |
| 1030 } | 1040 } |
| 1031 | 1041 |
| 1032 // If the desired 'elapsed' time is past the current interval, advance to th
e next. | 1042 // If the desired 'elapsed' time is past the current interval, advance to |
| 1043 // the next. |
| 1033 if (elapsed >= m_interval.end) { | 1044 if (elapsed >= m_interval.end) { |
| 1034 if (!resolveNextInterval()) | 1045 if (!resolveNextInterval()) |
| 1035 break; | 1046 break; |
| 1036 continue; | 1047 continue; |
| 1037 } | 1048 } |
| 1038 | 1049 |
| 1039 return; | 1050 return; |
| 1040 } | 1051 } |
| 1041 } | 1052 } |
| 1042 | 1053 |
| (...skipping 28 matching lines...) Expand all Loading... |
| 1071 return 1.0f; | 1082 return 1.0f; |
| 1072 return clampTo<float>(percent); | 1083 return clampTo<float>(percent); |
| 1073 } | 1084 } |
| 1074 repeat = static_cast<unsigned>(activeTime.value() / simpleDuration.value()); | 1085 repeat = static_cast<unsigned>(activeTime.value() / simpleDuration.value()); |
| 1075 SMILTime simpleTime = fmod(activeTime.value(), simpleDuration.value()); | 1086 SMILTime simpleTime = fmod(activeTime.value(), simpleDuration.value()); |
| 1076 return clampTo<float>(simpleTime.value() / simpleDuration.value()); | 1087 return clampTo<float>(simpleTime.value() / simpleDuration.value()); |
| 1077 } | 1088 } |
| 1078 | 1089 |
| 1079 SMILTime SVGSMILElement::calculateNextProgressTime(SMILTime elapsed) const { | 1090 SMILTime SVGSMILElement::calculateNextProgressTime(SMILTime elapsed) const { |
| 1080 if (m_activeState == Active) { | 1091 if (m_activeState == Active) { |
| 1081 // If duration is indefinite the value does not actually change over time. S
ame is true for <set>. | 1092 // If duration is indefinite the value does not actually change over time. |
| 1093 // Same is true for <set>. |
| 1082 SMILTime simpleDuration = this->simpleDuration(); | 1094 SMILTime simpleDuration = this->simpleDuration(); |
| 1083 if (simpleDuration.isIndefinite() || isSVGSetElement(*this)) { | 1095 if (simpleDuration.isIndefinite() || isSVGSetElement(*this)) { |
| 1084 SMILTime repeatingDurationEnd = m_interval.begin + repeatingDuration(); | 1096 SMILTime repeatingDurationEnd = m_interval.begin + repeatingDuration(); |
| 1085 // We are supposed to do freeze semantics when repeating ends, even if the
element is still active. | 1097 // We are supposed to do freeze semantics when repeating ends, even if the |
| 1098 // element is still active. |
| 1086 // Take care that we get a timer callback at that point. | 1099 // Take care that we get a timer callback at that point. |
| 1087 if (elapsed < repeatingDurationEnd && | 1100 if (elapsed < repeatingDurationEnd && |
| 1088 repeatingDurationEnd < m_interval.end && | 1101 repeatingDurationEnd < m_interval.end && |
| 1089 repeatingDurationEnd.isFinite()) | 1102 repeatingDurationEnd.isFinite()) |
| 1090 return repeatingDurationEnd; | 1103 return repeatingDurationEnd; |
| 1091 return m_interval.end; | 1104 return m_interval.end; |
| 1092 } | 1105 } |
| 1093 return elapsed + 0.025; | 1106 return elapsed + 0.025; |
| 1094 } | 1107 } |
| 1095 return m_interval.begin >= elapsed ? m_interval.begin | 1108 return m_interval.begin >= elapsed ? m_interval.begin |
| 1096 : SMILTime::unresolved(); | 1109 : SMILTime::unresolved(); |
| 1097 } | 1110 } |
| 1098 | 1111 |
| 1099 SVGSMILElement::ActiveState SVGSMILElement::determineActiveState( | 1112 SVGSMILElement::ActiveState SVGSMILElement::determineActiveState( |
| 1100 SMILTime elapsed) const { | 1113 SMILTime elapsed) const { |
| 1101 if (elapsed >= m_interval.begin && elapsed < m_interval.end) | 1114 if (elapsed >= m_interval.begin && elapsed < m_interval.end) |
| 1102 return Active; | 1115 return Active; |
| 1103 | 1116 |
| 1104 return fill() == FillFreeze ? Frozen : Inactive; | 1117 return fill() == FillFreeze ? Frozen : Inactive; |
| 1105 } | 1118 } |
| 1106 | 1119 |
| 1107 bool SVGSMILElement::isContributing(SMILTime elapsed) const { | 1120 bool SVGSMILElement::isContributing(SMILTime elapsed) const { |
| 1108 // Animation does not contribute during the active time if it is past its repe
ating duration and has fill=remove. | 1121 // Animation does not contribute during the active time if it is past its |
| 1122 // repeating duration and has fill=remove. |
| 1109 return (m_activeState == Active && | 1123 return (m_activeState == Active && |
| 1110 (fill() == FillFreeze || | 1124 (fill() == FillFreeze || |
| 1111 elapsed <= m_interval.begin + repeatingDuration())) || | 1125 elapsed <= m_interval.begin + repeatingDuration())) || |
| 1112 m_activeState == Frozen; | 1126 m_activeState == Frozen; |
| 1113 } | 1127 } |
| 1114 | 1128 |
| 1115 bool SVGSMILElement::progress(SMILTime elapsed, bool seekToTime) { | 1129 bool SVGSMILElement::progress(SMILTime elapsed, bool seekToTime) { |
| 1116 ASSERT(m_timeContainer); | 1130 ASSERT(m_timeContainer); |
| 1117 ASSERT(m_isWaitingForFirstInterval || m_interval.begin.isFinite()); | 1131 ASSERT(m_isWaitingForFirstInterval || m_interval.begin.isFinite()); |
| 1118 | 1132 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 1132 return m_activeState == Frozen; | 1146 return m_activeState == Frozen; |
| 1133 } | 1147 } |
| 1134 | 1148 |
| 1135 m_previousIntervalBegin = m_interval.begin; | 1149 m_previousIntervalBegin = m_interval.begin; |
| 1136 | 1150 |
| 1137 if (m_isWaitingForFirstInterval) { | 1151 if (m_isWaitingForFirstInterval) { |
| 1138 m_isWaitingForFirstInterval = false; | 1152 m_isWaitingForFirstInterval = false; |
| 1139 resolveFirstInterval(); | 1153 resolveFirstInterval(); |
| 1140 } | 1154 } |
| 1141 | 1155 |
| 1142 // This call may obtain a new interval -- never call calculateAnimationPercent
AndRepeat() before! | 1156 // This call may obtain a new interval -- never call |
| 1157 // calculateAnimationPercentAndRepeat() before! |
| 1143 if (seekToTime) { | 1158 if (seekToTime) { |
| 1144 seekToIntervalCorrespondingToTime(elapsed); | 1159 seekToIntervalCorrespondingToTime(elapsed); |
| 1145 if (elapsed < m_interval.begin) { | 1160 if (elapsed < m_interval.begin) { |
| 1146 // elapsed is not within an interval. | 1161 // elapsed is not within an interval. |
| 1147 m_nextProgressTime = m_interval.begin; | 1162 m_nextProgressTime = m_interval.begin; |
| 1148 return false; | 1163 return false; |
| 1149 } | 1164 } |
| 1150 } | 1165 } |
| 1151 | 1166 |
| 1152 unsigned repeat = 0; | 1167 unsigned repeat = 0; |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1192 if (m_activeState == Inactive || m_activeState == Frozen) | 1207 if (m_activeState == Inactive || m_activeState == Frozen) |
| 1193 scheduleEvent(EventTypeNames::endEvent); | 1208 scheduleEvent(EventTypeNames::endEvent); |
| 1194 } | 1209 } |
| 1195 | 1210 |
| 1196 m_nextProgressTime = calculateNextProgressTime(elapsed); | 1211 m_nextProgressTime = calculateNextProgressTime(elapsed); |
| 1197 return animationIsContributing; | 1212 return animationIsContributing; |
| 1198 } | 1213 } |
| 1199 | 1214 |
| 1200 void SVGSMILElement::notifyDependentsIntervalChanged() { | 1215 void SVGSMILElement::notifyDependentsIntervalChanged() { |
| 1201 ASSERT(m_interval.begin.isFinite()); | 1216 ASSERT(m_interval.begin.isFinite()); |
| 1202 // |loopBreaker| is used to avoid infinite recursions which may be caused from
: | 1217 // |loopBreaker| is used to avoid infinite recursions which may be caused by: |
| 1203 // |notifyDependentsIntervalChanged| -> |createInstanceTimesFromSyncbase| -> |
add{Begin,End}Time| -> |{begin,end}TimeChanged| -> |notifyDependentsIntervalChan
ged| | 1218 // |notifyDependentsIntervalChanged| -> |createInstanceTimesFromSyncbase| -> |
| 1219 // |add{Begin,End}Time| -> |{begin,end}TimeChanged| -> |
| 1220 // |notifyDependentsIntervalChanged| |
| 1204 // | 1221 // |
| 1205 // As the set here records SVGSMILElements on the stack, it is acceptable to | 1222 // As the set here records SVGSMILElements on the stack, it is acceptable to |
| 1206 // use a HashSet of untraced heap references -- any conservative GC which | 1223 // use a HashSet of untraced heap references -- any conservative GC which |
| 1207 // strikes before unwinding will find these elements on the stack. | 1224 // strikes before unwinding will find these elements on the stack. |
| 1208 DEFINE_STATIC_LOCAL(HashSet<UntracedMember<SVGSMILElement>>, loopBreaker, ()); | 1225 DEFINE_STATIC_LOCAL(HashSet<UntracedMember<SVGSMILElement>>, loopBreaker, ()); |
| 1209 if (!loopBreaker.add(this).isNewEntry) | 1226 if (!loopBreaker.add(this).isNewEntry) |
| 1210 return; | 1227 return; |
| 1211 | 1228 |
| 1212 for (SVGSMILElement* element : m_syncBaseDependents) | 1229 for (SVGSMILElement* element : m_syncBaseDependents) |
| 1213 element->createInstanceTimesFromSyncbase(this); | 1230 element->createInstanceTimesFromSyncbase(this); |
| 1214 | 1231 |
| 1215 loopBreaker.remove(this); | 1232 loopBreaker.remove(this); |
| 1216 } | 1233 } |
| 1217 | 1234 |
| 1218 void SVGSMILElement::createInstanceTimesFromSyncbase(SVGSMILElement* syncBase) { | 1235 void SVGSMILElement::createInstanceTimesFromSyncbase(SVGSMILElement* syncBase) { |
| 1219 // FIXME: To be really correct, this should handle updating exising interval b
y changing | 1236 // FIXME: To be really correct, this should handle updating exising interval |
| 1220 // the associated times instead of creating new ones. | 1237 // by changing the associated times instead of creating new ones. |
| 1221 for (unsigned n = 0; n < m_conditions.size(); ++n) { | 1238 for (unsigned n = 0; n < m_conditions.size(); ++n) { |
| 1222 Condition* condition = m_conditions[n].get(); | 1239 Condition* condition = m_conditions[n].get(); |
| 1223 if (condition->getType() == Condition::Syncbase && | 1240 if (condition->getType() == Condition::Syncbase && |
| 1224 condition->syncBase() == syncBase) { | 1241 condition->syncBase() == syncBase) { |
| 1225 ASSERT(condition->name() == "begin" || condition->name() == "end"); | 1242 ASSERT(condition->name() == "begin" || condition->name() == "end"); |
| 1226 // No nested time containers in SVG, no need for crazy time space conversi
ons. Phew! | 1243 // No nested time containers in SVG, no need for crazy time space |
| 1244 // conversions. Phew! |
| 1227 SMILTime time = 0; | 1245 SMILTime time = 0; |
| 1228 if (condition->name() == "begin") | 1246 if (condition->name() == "begin") |
| 1229 time = syncBase->m_interval.begin + condition->offset(); | 1247 time = syncBase->m_interval.begin + condition->offset(); |
| 1230 else | 1248 else |
| 1231 time = syncBase->m_interval.end + condition->offset(); | 1249 time = syncBase->m_interval.end + condition->offset(); |
| 1232 if (!time.isFinite()) | 1250 if (!time.isFinite()) |
| 1233 continue; | 1251 continue; |
| 1234 SMILTime elapsed = this->elapsed(); | 1252 SMILTime elapsed = this->elapsed(); |
| 1235 if (elapsed.isUnresolved()) | 1253 if (elapsed.isUnresolved()) |
| 1236 continue; | 1254 continue; |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1335 DEFINE_TRACE(SVGSMILElement) { | 1353 DEFINE_TRACE(SVGSMILElement) { |
| 1336 visitor->trace(m_targetElement); | 1354 visitor->trace(m_targetElement); |
| 1337 visitor->trace(m_timeContainer); | 1355 visitor->trace(m_timeContainer); |
| 1338 visitor->trace(m_conditions); | 1356 visitor->trace(m_conditions); |
| 1339 visitor->trace(m_syncBaseDependents); | 1357 visitor->trace(m_syncBaseDependents); |
| 1340 SVGElement::trace(visitor); | 1358 SVGElement::trace(visitor); |
| 1341 SVGTests::trace(visitor); | 1359 SVGTests::trace(visitor); |
| 1342 } | 1360 } |
| 1343 | 1361 |
| 1344 } // namespace blink | 1362 } // namespace blink |
| OLD | NEW |