Bug 590425 - SVG SMIL: Clear deferred sampling flag on pause; r=dholbert; a=roc

This commit is contained in:
Brian Birtles 2010-10-20 08:52:49 +09:00
parent 004be73552
commit f3ce784088
4 changed files with 31 additions and 0 deletions

View File

@ -0,0 +1,24 @@
<!DOCTYPE html>
<html class="reftest-wait">
<head>
<script>
function boom()
{
var frame = document.getElementById("frame")
var frameSVG = frame.contentDocument.getElementById('s');
var animate = frame.contentDocument.createElementNS("http://www.w3.org/2000/svg", "animate");
frame.parentNode.removeChild(frame);
frameSVG.appendChild(animate);
document.documentElement.removeAttribute("class");
}
</script>
</head>
<body onload="boom()">
<iframe id="frame" src="data:text/html,%3Cbody%3E%3Csvg id=s%3E"></iframe>
</body>
</html>

View File

@ -18,6 +18,7 @@ load 555026-1.svg
load 556841-1.svg
load 588287-1.svg
load 588287-2.svg
load 590425-1.html
load 592477-1.xhtml
load 594653-1.svg
load 596796-1.svg

View File

@ -135,6 +135,7 @@ nsSMILAnimationController::Pause(PRUint32 aType)
nsSMILTimeContainer::Pause(aType);
if (mPauseState) {
mDeferredStartSampling = PR_FALSE;
StopSampling(GetRefreshDriverForDoc(mDocument));
}
}
@ -261,6 +262,8 @@ void
nsSMILAnimationController::StartSampling(nsRefreshDriver* aRefreshDriver)
{
NS_ASSERTION(mPauseState == 0, "Starting sampling but controller is paused");
NS_ASSERTION(!mDeferredStartSampling,
"Started sampling but the deferred start flag is still set");
if (aRefreshDriver) {
NS_ABORT_IF_FALSE(!GetRefreshDriverForDoc(mDocument) ||
aRefreshDriver == GetRefreshDriverForDoc(mDocument),

View File

@ -196,6 +196,9 @@ protected:
mozilla::TimeStamp mCurrentSampleTime;
mozilla::TimeStamp mStartTime;
PRPackedBool mResampleNeeded;
// If we're told to start sampling but there are no animation elements we just
// record the time, set the following flag, and then wait until we have an
// animation element. Then we'll reset this flag and actually start sampling.
PRPackedBool mDeferredStartSampling;
#ifdef DEBUG
PRPackedBool mRunningSample;