From 7c2558cc3485d4cdc65b2dfce15a72edf46b4c19 Mon Sep 17 00:00:00 2001 From: Brian Birtles Date: Fri, 2 Sep 2011 08:15:44 +0900 Subject: [PATCH] Bug 678938 - SMIL: Make sure current interval is properly cleared when doing a rewind; r=dholbert --- content/smil/crashtests/678938-1.svg | 11 +++++++++++ content/smil/crashtests/crashtests.list | 3 ++- content/smil/nsSMILTimedElement.cpp | 12 ++++++++---- 3 files changed, 21 insertions(+), 5 deletions(-) create mode 100644 content/smil/crashtests/678938-1.svg diff --git a/content/smil/crashtests/678938-1.svg b/content/smil/crashtests/678938-1.svg new file mode 100644 index 00000000000..f3f8308fa50 --- /dev/null +++ b/content/smil/crashtests/678938-1.svg @@ -0,0 +1,11 @@ + + + + diff --git a/content/smil/crashtests/crashtests.list b/content/smil/crashtests/crashtests.list index 808b39017b7..d3e0f95ee2f 100644 --- a/content/smil/crashtests/crashtests.list +++ b/content/smil/crashtests/crashtests.list @@ -37,7 +37,8 @@ load 615872-1.svg load 650732-1.svg load 665334-1.svg load 669225-1.svg -load 670313-1.svg load 669225-2.svg +load 670313-1.svg load 678822-1.svg load 678847-1.svg +load 678938-1.svg diff --git a/content/smil/nsSMILTimedElement.cpp b/content/smil/nsSMILTimedElement.cpp index a1fefdb9c8c..c754dc93749 100644 --- a/content/smil/nsSMILTimedElement.cpp +++ b/content/smil/nsSMILTimedElement.cpp @@ -758,10 +758,10 @@ nsSMILTimedElement::Rewind() mSeekState == SEEK_BACKWARD_FROM_ACTIVE, "Rewind in the middle of a forwards seek?"); - ClearIntervals(); - // ClearIntervals puts us in to the POSTACTIVE state but we're doing a full - // rewind so go back to the startup state + // Putting us in the startup state will ensure we skip doing any interval + // updates mElementState = STATE_STARTUP; + ClearIntervals(); UnsetBeginSpec(RemoveNonDynamic); UnsetEndSpec(RemoveNonDynamic); @@ -784,6 +784,8 @@ nsSMILTimedElement::Rewind() mPrevRegisteredMilestone = sMaxMilestone; RegisterMilestone(); + NS_ABORT_IF_FALSE(!mCurrentInterval, + "Current interval is set at end of rewind"); } namespace @@ -1332,7 +1334,9 @@ nsSMILTimedElement::ClearSpecs(TimeValueSpecList& aSpecs, void nsSMILTimedElement::ClearIntervals() { - mElementState = STATE_POSTACTIVE; + if (mElementState != STATE_STARTUP) { + mElementState = STATE_POSTACTIVE; + } mCurrentRepeatIteration = 0; ResetCurrentInterval();