Chromium Code Reviews| Index: Source/core/svg/animation/SVGSMILElement.cpp |
| diff --git a/Source/core/svg/animation/SVGSMILElement.cpp b/Source/core/svg/animation/SVGSMILElement.cpp |
| index aaa39d929f2665b29e14044bda8185c54b06e170..4ee2423d1bad913a0be4a00e9833cb5f67c2b632 100644 |
| --- a/Source/core/svg/animation/SVGSMILElement.cpp |
| +++ b/Source/core/svg/animation/SVGSMILElement.cpp |
| @@ -491,15 +491,17 @@ void SVGSMILElement::parseBeginOrEnd(const String& parseString, BeginOrEnd begin |
| if (beginOrEnd == End) |
| m_hasEndEventConditions = false; |
| HashSet<double> existing; |
| - for (unsigned n = 0; n < timeList.size(); ++n) |
| - existing.add(timeList[n].time().value()); |
| + for (unsigned n = 0; n < timeList.size(); ++n) { |
| + if (!timeList[n].time().isUnresolved()) |
| + existing.add(timeList[n].time().value()); |
| + } |
| Vector<String> splitString; |
| parseString.split(';', splitString); |
| for (unsigned n = 0; n < splitString.size(); ++n) { |
| SMILTime value = parseClockValue(splitString[n]); |
| if (value.isUnresolved()) |
| parseCondition(splitString[n], beginOrEnd); |
| - else if (!existing.contains(value.value())) |
| + else if (value.isFinite() && !existing.contains(value.value())) |
| timeList.append(SMILTimeWithOrigin(value, SMILTimeWithOrigin::ParserOrigin)); |
| } |
| sortTimeList(timeList); |
| @@ -806,7 +808,7 @@ SMILTime SVGSMILElement::simpleDuration() const |
| void SVGSMILElement::addBeginTime(SMILTime eventTime, SMILTime beginTime, SMILTimeWithOrigin::Origin origin) |
| { |
| - ASSERT(!std::isnan(beginTime.value())); |
| + ASSERT(!beginTime.isUnresolved()); |
| m_beginTimes.append(SMILTimeWithOrigin(beginTime, origin)); |
| sortTimeList(m_beginTimes); |
| beginListChanged(eventTime); |
| @@ -814,7 +816,7 @@ void SVGSMILElement::addBeginTime(SMILTime eventTime, SMILTime beginTime, SMILTi |
| void SVGSMILElement::addEndTime(SMILTime eventTime, SMILTime endTime, SMILTimeWithOrigin::Origin origin) |
| { |
| - ASSERT(!std::isnan(endTime.value())); |
| + ASSERT(!endTime.isUnresolved()); |
| m_endTimes.append(SMILTimeWithOrigin(endTime, origin)); |
| sortTimeList(m_endTimes); |
| endListChanged(eventTime); |
| @@ -872,8 +874,11 @@ SMILTime SVGSMILElement::repeatingDuration() const |
| SMILTime simpleDuration = this->simpleDuration(); |
| if (!simpleDuration || (repeatDur.isUnresolved() && repeatCount.isUnresolved())) |
| return simpleDuration; |
| + repeatDur = std::min(repeatDur, SMILTime::indefinite()); |
| SMILTime repeatCountDuration = simpleDuration * repeatCount; |
| - return std::min(repeatCountDuration, std::min(repeatDur, SMILTime::indefinite())); |
| + if (!repeatCountDuration.isUnresolved()) |
| + return std::min(repeatDur, repeatCountDuration); |
| + return repeatDur; |
| } |
| SMILTime SVGSMILElement::resolveActiveEnd(SMILTime resolvedBegin, SMILTime resolvedEnd) const |
| @@ -888,6 +893,9 @@ SMILTime SVGSMILElement::resolveActiveEnd(SMILTime resolvedBegin, SMILTime resol |
| else |
| preliminaryActiveDuration = std::min(repeatingDuration(), resolvedEnd - resolvedBegin); |
| + if (preliminaryActiveDuration.isUnresolved()) |
| + return SMILTime::unresolved(); |
|
fs
2014/08/21 15:30:39
Actually,
min(maxValue, max(minValue, pAD)); pAD=
|
| + |
| SMILTime minValue = this->minValue(); |
| SMILTime maxValue = this->maxValue(); |
| if (minValue > maxValue) { |
| @@ -940,7 +948,7 @@ void SVGSMILElement::resolveFirstInterval() |
| if (!firstInterval.begin.isUnresolved() && firstInterval != m_interval) { |
| m_interval = firstInterval; |
| notifyDependentsIntervalChanged(); |
| - m_nextProgressTime = std::min(m_nextProgressTime, m_interval.begin); |
| + m_nextProgressTime = m_nextProgressTime.isUnresolved() ? m_interval.begin : std::min(m_nextProgressTime, m_interval.begin); |
| if (m_timeContainer) |
| m_timeContainer->notifyIntervalsChanged(); |
| @@ -955,7 +963,7 @@ bool SVGSMILElement::resolveNextInterval() |
| if (!nextInterval.begin.isUnresolved() && nextInterval.begin != m_interval.begin) { |
| m_interval = nextInterval; |
| notifyDependentsIntervalChanged(); |
| - m_nextProgressTime = std::min(m_nextProgressTime, m_interval.begin); |
| + m_nextProgressTime = m_nextProgressTime.isUnresolved() ? m_interval.begin : std::min(m_nextProgressTime, m_interval.begin); |
| return true; |
| } |
| @@ -1274,10 +1282,13 @@ void SVGSMILElement::createInstanceTimesFromSyncbase(SVGSMILElement* syncBase) |
| time = syncBase->m_interval.end + condition->offset(); |
| if (!time.isFinite()) |
| continue; |
| + SMILTime elapsed = this->elapsed(); |
| + if (elapsed.isUnresolved()) |
| + return; |
|
fs
2014/08/21 15:30:39
return => continue
reni
2014/08/21 20:52:31
Done.
|
| if (condition->beginOrEnd() == Begin) |
| - addBeginTime(elapsed(), time); |
| + addBeginTime(elapsed, time); |
| else |
| - addEndTime(elapsed(), time); |
| + addEndTime(elapsed, time); |
| } |
| } |
| } |
| @@ -1300,6 +1311,8 @@ void SVGSMILElement::handleConditionEvent(Event* event, Condition* condition) |
| return; |
| SMILTime elapsed = this->elapsed(); |
| + if (elapsed.isUnresolved()) |
| + return; |
| if (condition->beginOrEnd() == Begin) |
| addBeginTime(elapsed, elapsed + condition->offset()); |
| else |
| @@ -1309,6 +1322,8 @@ void SVGSMILElement::handleConditionEvent(Event* event, Condition* condition) |
| void SVGSMILElement::beginByLinkActivation() |
| { |
| SMILTime elapsed = this->elapsed(); |
| + if (elapsed.isUnresolved()) |
| + return; |
| addBeginTime(elapsed, elapsed); |
| } |