void nsSMILTimeContainer::SetCurrentTime(nsSMILTime aSeekTo) { // SVG 1.1 doesn't specify what to do for negative times so we adopt SVGT1.2's // behaviour of clamping negative times to 0. aSeekTo = NS_MAX<nsSMILTime>(0, aSeekTo); // The following behaviour is consistent with: // http://www.w3.org/2003/01/REC-SVG11-20030114-errata // #getCurrentTime_setCurrentTime_undefined_before_document_timeline_begin // which says that if SetCurrentTime is called before the document timeline // has begun we should still adjust the offset. nsSMILTime parentTime = GetParentTime(); mParentOffset = parentTime - aSeekTo; mIsSeeking = PR_TRUE; if (IsPaused()) { mNeedsPauseSample = PR_TRUE; mPauseStart = parentTime; } if (aSeekTo < mCurrentTime) { // Backwards seek mNeedsRewind = PR_TRUE; ClearMilestones(); } // Force an update to the current time in case we get a call to GetCurrentTime // before another call to Sample(). UpdateCurrentTime(); NotifyTimeChange(); }
void nsSMILTimeContainer::Resume(PRUint32 aType) { if (!mPauseState) return; mPauseState &= ~aType; if (!mPauseState) { nsSMILTime extraOffset = GetParentTime() - mPauseStart; mParentOffset += extraOffset; NotifyTimeChange(); } }
void nsSMILTimeContainer::Pause(PRUint32 aType) { PRBool didStartPause = PR_FALSE; if (!mPauseState && aType) { mPauseStart = GetParentTime(); mNeedsPauseSample = PR_TRUE; didStartPause = PR_TRUE; } mPauseState |= aType; if (didStartPause) { NotifyTimeChange(); } }
void nsSMILTimeContainer::Pause(PRUint32 aType) { bool didStartPause = false; if (!mPauseState && aType) { mPauseStart = GetParentTime(); mNeedsPauseSample = true; didStartPause = true; } mPauseState |= aType; if (didStartPause) { NotifyTimeChange(); } }