From 4c5ce96ff3c4fa3cec249523bfcca8dfc0892a33 Mon Sep 17 00:00:00 2001 From: "sfraser%netscape.com" Date: Thu, 25 May 2000 21:50:46 +0000 Subject: [PATCH] Fix for 14768 -- turn off animated GIFs in editor. r=pnunn a=beppe git-svn-id: svn://10.0.0.236/trunk@70864 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/editor/base/nsEditorShell.cpp | 8 +++++++- mozilla/editor/composer/src/nsEditorShell.cpp | 8 +++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/mozilla/editor/base/nsEditorShell.cpp b/mozilla/editor/base/nsEditorShell.cpp index 53a36c214fc..8a587279cfb 100644 --- a/mozilla/editor/base/nsEditorShell.cpp +++ b/mozilla/editor/base/nsEditorShell.cpp @@ -456,6 +456,12 @@ nsEditorShell::PrepareDocumentForEditing(nsIDocumentLoader* aLoader, nsIURI *aUr return NS_ERROR_UNEXPECTED; } + // turn off animated GIFs + nsCOMPtr presContext; + containerAsDocShell->GetPresContext(getter_AddRefs(presContext)); + if (presContext) + presContext->SetImageAnimationMode(eImageAnimation_None); + nsresult rv = DoEditorMode(containerAsDocShell); if (NS_FAILED(rv)) return rv; @@ -4671,7 +4677,7 @@ nsEditorShell::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, cons scriptContext->SetScriptsEnabled(PR_FALSE); } } - + // set up a parser observer if (!mParserObserver) { diff --git a/mozilla/editor/composer/src/nsEditorShell.cpp b/mozilla/editor/composer/src/nsEditorShell.cpp index 53a36c214fc..8a587279cfb 100644 --- a/mozilla/editor/composer/src/nsEditorShell.cpp +++ b/mozilla/editor/composer/src/nsEditorShell.cpp @@ -456,6 +456,12 @@ nsEditorShell::PrepareDocumentForEditing(nsIDocumentLoader* aLoader, nsIURI *aUr return NS_ERROR_UNEXPECTED; } + // turn off animated GIFs + nsCOMPtr presContext; + containerAsDocShell->GetPresContext(getter_AddRefs(presContext)); + if (presContext) + presContext->SetImageAnimationMode(eImageAnimation_None); + nsresult rv = DoEditorMode(containerAsDocShell); if (NS_FAILED(rv)) return rv; @@ -4671,7 +4677,7 @@ nsEditorShell::OnStartDocumentLoad(nsIDocumentLoader* loader, nsIURI* aURL, cons scriptContext->SetScriptsEnabled(PR_FALSE); } } - + // set up a parser observer if (!mParserObserver) {