mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 19:35:51 +00:00
Bug 610491: Preemptively stop SVG animations in SVG-as-an-image in OnStartRequest. r=roc a=roc
This commit is contained in:
parent
4a5f0f7ac1
commit
0f8a89b3b5
@ -1,5 +1,6 @@
|
||||
<svg xmlns="http://www.w3.org/2000/svg" version="1.1"
|
||||
width="100" height="100">
|
||||
<rect width="100%" height="100%" fill="red"/>
|
||||
<rect x="-600" width="100%" height="100%" fill="lime">
|
||||
<animate attributeName="x" by="600" dur="0.001" fill="freeze"/>
|
||||
</rect>
|
||||
|
Before Width: | Height: | Size: 227 B After Width: | Height: | Size: 275 B |
@ -251,6 +251,8 @@ SVGDocumentWrapper::OnStartRequest(nsIRequest* aRequest, nsISupports* ctxt)
|
||||
if (NS_SUCCEEDED(rv) &&
|
||||
NS_SUCCEEDED(mListener->OnStartRequest(aRequest, nsnull))) {
|
||||
mViewer->GetDocument()->SetIsBeingUsedAsImage();
|
||||
StopAnimation(); // otherwise animations start automatically in helper doc
|
||||
|
||||
rv = mViewer->Init(nsnull, nsIntRect(0, 0, 0, 0));
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
rv = mViewer->Open(nsnull, nsnull);
|
||||
|
@ -696,12 +696,6 @@ VectorImage::OnStopRequest(nsIRequest* aRequest, nsISupports* aCtxt,
|
||||
mIsFullyLoaded = PR_TRUE;
|
||||
mHaveAnimations = mSVGDocumentWrapper->IsAnimated();
|
||||
|
||||
if (mHaveAnimations && mAnimationMode == kDontAnimMode) {
|
||||
// We're not supposed to be animating -- stop any animation before our
|
||||
// SVG document's timeline gets a chance to progress.
|
||||
mSVGDocumentWrapper->StopAnimation();
|
||||
}
|
||||
|
||||
#ifdef MOZ_ENABLE_LIBXUL
|
||||
// Start listening to our image for rendering updates
|
||||
mRenderingObserver = new SVGRootRenderingObserver(mSVGDocumentWrapper, this);
|
||||
|
Loading…
Reference in New Issue
Block a user