remove svg_images patch (moved to separate "svg-patches" patch queue) default tip
authorDaniel Holbert <dholbert@cs.stanford.edu>
Tue, 11 May 2010 14:10:29 -0700
changeset 1567 3fb6129afcdf0a7f2cc236822a0358cefc09b303
parent 1566 cb78dd9fdfbac6edfc5c55869d3817518a7c9b06
push id1264
push userdholbert@mozilla.com
push dateTue, 11 May 2010 21:10:31 +0000
remove svg_images patch (moved to separate "svg-patches" patch queue)
series
svg_images
--- a/series
+++ b/series
@@ -1,8 +1,7 @@
-svg_images #+svgimages
 smil_infallibleMisc #+WIP
 smil_541297ChangeAbortToWarning
 smil_541297Fix
 smil_debuggingCode #+debug
 smil_misc #+nits
 smil_cacheTextZoom #+notsure
 smil_alwaysRecomposeDebugging #+debug
deleted file mode 100644
--- a/svg_images
+++ /dev/null
@@ -1,1178 +0,0 @@
-From: Daniel Holbert <dholbert@cs.stanford.edu>
-
-diff --git a/configure.in b/configure.in
---- a/configure.in
-+++ b/configure.in
-@@ -6245,16 +6245,20 @@ dnl ====================================
- dnl SVG
- dnl ========================================================
- MOZ_ARG_DISABLE_BOOL(svg,
- [  --disable-svg            Disable SVG support],
-     MOZ_SVG=,
-     MOZ_SVG=1 )
- if test -n "$MOZ_SVG"; then
-   AC_DEFINE(MOZ_SVG)
-+
-+  # Add SVG to list of decoders, & remove dupes in case it's already there.
-+  MOZ_IMG_DECODERS="$MOZ_IMG_DECODERS svg"      
-+  MOZ_IMG_DECODERS=`${PERL} ${srcdir}/build/unix/uniq.pl ${MOZ_IMG_DECODERS}`
- fi
- 
- dnl ========================================================
- dnl SMIL
- dnl ========================================================
- MOZ_SMIL=1
- MOZ_ARG_DISABLE_BOOL(smil,
- [  --disable-smil           Disable SMIL animation support],
-diff --git a/modules/libpr0n/build/nsImageModule.cpp b/modules/libpr0n/build/nsImageModule.cpp
---- a/modules/libpr0n/build/nsImageModule.cpp
-+++ b/modules/libpr0n/build/nsImageModule.cpp
-@@ -49,16 +49,17 @@
- #include "nsIDeviceContext.h"
- #include "nsIGenericFactory.h"
- #include "nsIModule.h"
- #include "nsICategoryManager.h"
- #include "nsXPCOMCID.h"
- #include "nsServiceManagerUtils.h"
- 
- #include "imgContainer.h"
-+#include "imgContainerSVG.h"
- #include "imgLoader.h"
- #include "imgRequest.h"
- #include "imgRequestProxy.h"
- #include "imgTools.h"
- 
- #ifdef IMG_BUILD_DECODER_gif
- // gif
- #include "nsGIFDecoder2.h"
-@@ -75,29 +76,35 @@
- #include "nsPNGDecoder.h"
- #endif
- 
- #ifdef IMG_BUILD_DECODER_jpeg
- // jpeg
- #include "nsJPEGDecoder.h"
- #endif
- 
-+#ifdef IMG_BUILD_DECODER_svg
-+// svg
-+#include "nsSVGDecoder.h"
-+#endif
-+
- #ifdef IMG_BUILD_ENCODER_png
- // png
- #include "nsPNGEncoder.h"
- #endif
- #ifdef IMG_BUILD_ENCODER_jpeg
- // jpeg
- #include "nsJPEGEncoder.h"
- #endif
- 
- 
- // objects that just require generic constructors
- 
- NS_GENERIC_FACTORY_CONSTRUCTOR(imgContainer)
-+NS_GENERIC_FACTORY_CONSTRUCTOR(imgContainerSVG)
- NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(imgLoader, Init)
- NS_GENERIC_FACTORY_CONSTRUCTOR(imgRequestProxy)
- NS_GENERIC_FACTORY_CONSTRUCTOR(imgTools)
- 
- #ifdef IMG_BUILD_DECODER_gif
- // gif
- NS_GENERIC_FACTORY_CONSTRUCTOR(nsGIFDecoder2)
- #endif
-@@ -120,16 +127,20 @@ NS_GENERIC_FACTORY_CONSTRUCTOR(nsBMPDeco
- #ifdef IMG_BUILD_DECODER_png
- // png
- NS_GENERIC_FACTORY_CONSTRUCTOR(nsPNGDecoder)
- #endif
- #ifdef IMG_BUILD_ENCODER_png
- // png
- NS_GENERIC_FACTORY_CONSTRUCTOR(nsPNGEncoder)
- #endif
-+#ifdef IMG_BUILD_DECODER_svg
-+// svg
-+NS_GENERIC_FACTORY_CONSTRUCTOR(nsSVGDecoder)
-+#endif
- 
- static const char* gImageMimeTypes[] = {
- #ifdef IMG_BUILD_DECODER_gif
-   "image/gif",
- #endif
- #ifdef IMG_BUILD_DECODER_jpeg
-   "image/jpeg",
-   "image/pjpeg",
-@@ -140,16 +151,19 @@ static const char* gImageMimeTypes[] = {
-   "image/vnd.microsoft.icon",
-   "image/bmp",
-   "image/x-ms-bmp",
- #endif
- #ifdef IMG_BUILD_DECODER_png
-   "image/png",
-   "image/x-png",
- #endif
-+#ifdef IMG_BUILD_DECODER_svg
-+  "image/svg+xml",
-+#endif
- };
- 
- static NS_METHOD ImageRegisterProc(nsIComponentManager *aCompMgr,
-                                    nsIFile *aPath,
-                                    const char *registryLocation,
-                                    const char *componentType,
-                                    const nsModuleComponentInfo *info) {
-   nsresult rv;
-@@ -187,16 +201,20 @@ static const nsModuleComponentInfo compo
-   { "image cache",
-     NS_IMGLOADER_CID,
-     "@mozilla.org/image/cache;1",
-     imgLoaderConstructor, },
-   { "image container",
-     NS_IMGCONTAINER_CID,
-     "@mozilla.org/image/container;3",
-     imgContainerConstructor, },
-+  { "SVG image container",
-+    NS_IMGCONTAINERSVG_CID,
-+    "@mozilla.org/image/svgcontainer;1",
-+    imgContainerSVGConstructor, },
-   { "image loader",
-     NS_IMGLOADER_CID,
-     "@mozilla.org/image/loader;1",
-     imgLoaderConstructor,
-     ImageRegisterProc, /* register the decoder mime types here */
-     ImageUnregisterProc, },
-   { "image request proxy",
-     NS_IMGREQUESTPROXY_CID,
-@@ -271,16 +289,23 @@ static const nsModuleComponentInfo compo
- #endif
- #ifdef IMG_BUILD_ENCODER_png
-   // png
-   { "PNG Encoder",
-     NS_PNGENCODER_CID,
-     "@mozilla.org/image/encoder;2?type=image/png",
-     nsPNGEncoderConstructor, },
- #endif
-+
-+#ifdef IMG_BUILD_DECODER_svg
-+  { "SVG Decoder",
-+    NS_SVGDECODER_CID,
-+    "@mozilla.org/image/decoder;3?type=image/svg+xml",
-+    nsSVGDecoderConstructor, },
-+#endif
- };
- 
- static nsresult
- imglib_Initialize(nsIModule* aSelf)
- {
-   // Hack: We need the gfx module to be initialized because we use gfxPlatform
-   // in imgFrame. Request something from the gfx module to ensure that
-   // everything's set up for us.
-diff --git a/modules/libpr0n/decoders/svg/Makefile.in b/modules/libpr0n/decoders/svg/Makefile.in
-new file mode 100644
---- /dev/null
-+++ b/modules/libpr0n/decoders/svg/Makefile.in
-@@ -0,0 +1,60 @@
-+#
-+# ***** BEGIN LICENSE BLOCK *****
-+# Version: MPL 1.1/GPL 2.0/LGPL 2.1
-+#
-+# The contents of this file are subject to the Mozilla Public License Version
-+# 1.1 (the "License"); you may not use this file except in compliance with
-+# the License. You may obtain a copy of the License at
-+# http://www.mozilla.org/MPL/
-+#
-+# Software distributed under the License is distributed on an "AS IS" basis,
-+# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-+# for the specific language governing rights and limitations under the
-+# License.
-+#
-+# The Original Code is mozilla.org code.
-+#
-+# The Initial Developer of the Original Code is
-+# Netscape Communications Corporation.
-+# Portions created by the Initial Developer are Copyright (C) 2010
-+# the Initial Developer. All Rights Reserved.
-+#
-+# Contributor(s):
-+#
-+# Alternatively, the contents of this file may be used under the terms of
-+# either the GNU General Public License Version 2 or later (the "GPL"), or
-+# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-+# in which case the provisions of the GPL or the LGPL are applicable instead
-+# of those above. If you wish to allow use of your version of this file only
-+# under the terms of either the GPL or the LGPL, and not to allow others to
-+# use your version of this file under the terms of the MPL, indicate your
-+# decision by deleting the provisions above and replace them with the notice
-+# and other provisions required by the GPL or the LGPL. If you do not delete
-+# the provisions above, a recipient may use your version of this file under
-+# the terms of any one of the MPL, the GPL or the LGPL.
-+#
-+# ***** END LICENSE BLOCK *****
-+
-+DEPTH		= ../../../..
-+topsrcdir	= @top_srcdir@
-+srcdir		= @srcdir@
-+VPATH		= @srcdir@
-+
-+include $(DEPTH)/config/autoconf.mk
-+
-+MODULE		= imgsvg
-+LIBRARY_NAME	= imgsvg_s
-+FORCE_STATIC_LIB = 1
-+MODULE_NAME	= SVGDecoderModule
-+LIBXUL_LIBRARY = 1
-+
-+EXTRA_DSO_LIBS	= gkgfx # XXXdholbert Needed? probably need content too...
-+
-+CPPSRCS		= nsSVGDecoder.cpp
-+
-+# XXXdholbert Use this if needed
-+# nsGIFDecoder2.cpp includes imgContainer.h
-+# LOCAL_INCLUDES += -I$(topsrcdir)/modules/libpr0n/src
-+
-+include $(topsrcdir)/config/rules.mk
-+
-diff --git a/modules/libpr0n/decoders/svg/nsSVGDecoder.cpp b/modules/libpr0n/decoders/svg/nsSVGDecoder.cpp
-new file mode 100644
---- /dev/null
-+++ b/modules/libpr0n/decoders/svg/nsSVGDecoder.cpp
-@@ -0,0 +1,162 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-+/* ***** BEGIN LICENSE BLOCK *****
-+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
-+ *
-+ * The contents of this file are subject to the Mozilla Public License Version
-+ * 1.1 (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ * http://www.mozilla.org/MPL/
-+ *
-+ * Software distributed under the License is distributed on an "AS IS" basis,
-+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-+ * for the specific language governing rights and limitations under the
-+ * License.
-+ *
-+ * The Original Code is the Mozilla SVG Module.
-+ *
-+ * The Initial Developer of the Original Code is
-+ * the Mozilla Foundation.
-+ * Portions created by the Initial Developer are Copyright (C) 2010
-+ * the Initial Developer. All Rights Reserved.
-+ *
-+ * Contributor(s):
-+ *
-+ * Alternatively, the contents of this file may be used under the terms of
-+ * either the GNU General Public License Version 2 or later (the "GPL"), or
-+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-+ * in which case the provisions of the GPL or the LGPL are applicable instead
-+ * of those above. If you wish to allow use of your version of this file only
-+ * under the terms of either the GPL or the LGPL, and not to allow others to
-+ * use your version of this file under the terms of the MPL, indicate your
-+ * decision by deleting the provisions above and replace them with the notice
-+ * and other provisions required by the GPL or the LGPL. If you do not delete
-+ * the provisions above, a recipient may use your version of this file under
-+ * the terms of any one of the MPL, the GPL or the LGPL.
-+ *
-+ * ***** END LICENSE BLOCK ***** */
-+
-+#include "nsSVGDecoder.h"
-+#include "imgIContainer.h"
-+#include "imgIDecoderObserver.h"
-+#include "nsDebug.h"
-+#include "prtypes.h"
-+#include "gfxASurface.h"
-+
-+
-+// XXXdholbert DEBUGGING
-+#include <string.h>
-+#define TMP_IMG_HEIGHT 50
-+#define TMP_IMG_WIDTH  300
-+// XXXdholbert END DEBUGGING
-+
-+NS_IMPL_ISUPPORTS1(nsSVGDecoder, imgIDecoder)
-+
-+nsSVGDecoder::nsSVGDecoder()
-+{
-+  // Nothing to do.
-+}
-+
-+nsSVGDecoder::~nsSVGDecoder()
-+{
-+  // Nothing to do.
-+}
-+
-+/** imgIDecoder methods **/
-+
-+/* void init (in imgIContainer aImage,
-+              imgIDecoderObserver aObserver,
-+              unsigned long aFlags); */
-+NS_IMETHODIMP
-+nsSVGDecoder::Init(imgIContainer *aImage,
-+                   imgIDecoderObserver *aObserver,
-+                   PRUint32 aFlags)
-+{
-+  NS_PRECONDITION(aImage,    "null image");
-+  NS_PRECONDITION(aObserver, "null observer");
-+  mImage = aImage;
-+  mObserver = aObserver;
-+  mFlags = aFlags;
-+
-+  mHaveWrittenData = PR_FALSE; // XXXdholbert DEBUG
-+
-+  // Fire OnStartDecode at init time to support bug 512435
-+  if (!(mFlags & imgIDecoder::DECODER_FLAG_HEADERONLY) && mObserver)
-+    mObserver->OnStartDecode(nsnull);
-+
-+  return NS_OK;
-+}
-+
-+/* void close (); */
-+NS_IMETHODIMP
-+nsSVGDecoder::Close(PRUint32 aFlags)
-+{
-+  // Based on Close impl in nsICODecoder
-+  if (!(mFlags & imgIDecoder::DECODER_FLAG_HEADERONLY) &&
-+      !(aFlags & CLOSE_FLAG_DONTNOTIFY)) {
-+    nsIntRect frameRect(0, 0, TMP_IMG_WIDTH, TMP_IMG_HEIGHT);
-+    mImage->FrameUpdated(0, frameRect);
-+
-+    if (mObserver) {
-+      mObserver->OnDataAvailable(nsnull, PR_TRUE, &frameRect);
-+      mObserver->OnStopFrame(nsnull, 0);
-+    }
-+
-+    mImage->DecodingComplete();
-+
-+    if (mObserver) {
-+      mObserver->OnStopContainer(nsnull, 0);
-+      mObserver->OnStopDecode(nsnull, NS_OK, nsnull);
-+    }
-+  }
-+
-+  mImage = nsnull;
-+  return NS_OK;
-+}
-+
-+/* void flush (); */
-+NS_IMETHODIMP
-+nsSVGDecoder::Flush()
-+{
-+  return NS_OK;
-+}
-+
-+// From nsBMPDecoder
-+static inline void SetPixel(PRUint32*& aDecoded,
-+                            PRUint8 aRed, PRUint8 aGreen, PRUint8 aBlue,
-+                            PRUint8 aAlpha = 0xFF)
-+{
-+  *aDecoded++ = GFX_PACKED_PIXEL(aAlpha, aRed, aGreen, aBlue);
-+}
-+
-+
-+NS_IMETHODIMP
-+nsSVGDecoder::Write(const char *aBuffer, PRUint32 aCount)
-+{
-+  // XXXdholbert TESTING
-+  if (mFlags & imgIDecoder::DECODER_FLAG_HEADERONLY)
-+    return NS_OK; // Not supposed to actually draw anything.
-+
-+  if (!mHaveWrittenData) {
-+    PRUint32* imgDataPtr = nsnull;
-+    PRUint32 imgDataLength;
-+
-+    mImage->SetSize(TMP_IMG_WIDTH, TMP_IMG_HEIGHT);
-+    if (mObserver) {
-+      mObserver->OnStartContainer(nsnull, mImage);
-+    }
-+    mImage->AppendFrame(0, 0, TMP_IMG_WIDTH, TMP_IMG_HEIGHT,
-+                        gfxASurface::ImageFormatARGB32,
-+                        (PRUint8**)&imgDataPtr, &imgDataLength);
-+    if (mObserver) {
-+      mObserver->OnStartFrame(nsnull, 0);
-+    }
-+
-+    for (PRUint32 pixelIdx = 0; pixelIdx < imgDataLength / sizeof(PRUint32); ++pixelIdx) {
-+      SetPixel(imgDataPtr, 0x00, 0x80, 0x80);
-+    }      
-+
-+    mHaveWrittenData = PR_TRUE;
-+    // XXXdholbert END TESTING
-+  }
-+  return NS_OK;
-+}
-diff --git a/modules/libpr0n/decoders/svg/nsSVGDecoder.h b/modules/libpr0n/decoders/svg/nsSVGDecoder.h
-new file mode 100644
---- /dev/null
-+++ b/modules/libpr0n/decoders/svg/nsSVGDecoder.h
-@@ -0,0 +1,67 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-+/* ***** BEGIN LICENSE BLOCK *****
-+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
-+ *
-+ * The contents of this file are subject to the Mozilla Public License Version
-+ * 1.1 (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ * http://www.mozilla.org/MPL/
-+ *
-+ * Software distributed under the License is distributed on an "AS IS" basis,
-+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-+ * for the specific language governing rights and limitations under the
-+ * License.
-+ *
-+ * The Original Code is the Mozilla SVG Module.
-+ *
-+ * The Initial Developer of the Original Code is
-+ * the Mozilla Foundation.
-+ * Portions created by the Initial Developer are Copyright (C) 2010
-+ * the Initial Developer. All Rights Reserved.
-+ *
-+ * Contributor(s):
-+ *
-+ * Alternatively, the contents of this file may be used under the terms of
-+ * either the GNU General Public License Version 2 or later (the "GPL"), or
-+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-+ * in which case the provisions of the GPL or the LGPL are applicable instead
-+ * of those above. If you wish to allow use of your version of this file only
-+ * under the terms of either the GPL or the LGPL, and not to allow others to
-+ * use your version of this file under the terms of the MPL, indicate your
-+ * decision by deleting the provisions above and replace them with the notice
-+ * and other provisions required by the GPL or the LGPL. If you do not delete
-+ * the provisions above, a recipient may use your version of this file under
-+ * the terms of any one of the MPL, the GPL or the LGPL.
-+ *
-+ * ***** END LICENSE BLOCK ***** */
-+
-+#ifndef NS_SVGDECODER_H_
-+#define NS_SVGDECODER_H_
-+
-+#include "imgIDecoder.h"
-+#include "nsAutoPtr.h"
-+
-+#define NS_SVGDECODER_CID \
-+{ 0x74bedb60,                                      \
-+  0xc188,                                          \
-+  0x4e05,                                          \
-+  {0x9b, 0x21, 0x24, 0xe0, 0xc0, 0x5e, 0xc9, 0xa3} \
-+}
-+
-+class nsSVGDecoder : public imgIDecoder
-+{
-+public:
-+  NS_DECL_ISUPPORTS
-+  NS_DECL_IMGIDECODER
-+  nsSVGDecoder();
-+  virtual ~nsSVGDecoder();
-+
-+private:
-+  nsCOMPtr<imgIContainer> mImage;
-+  nsCOMPtr<imgIDecoderObserver> mObserver;
-+  PRUint32 mFlags;
-+
-+  PRBool mHaveWrittenData; // XXXdholbert DEBUG
-+};
-+
-+#endif //  NS_SVGDECODER_H_
-diff --git a/modules/libpr0n/src/Makefile.in b/modules/libpr0n/src/Makefile.in
---- a/modules/libpr0n/src/Makefile.in
-+++ b/modules/libpr0n/src/Makefile.in
-@@ -47,16 +47,17 @@ LIBRARY_NAME	= imglib2_s
- FORCE_STATIC_LIB = 1
- MODULE_NAME	= nsImageLib2Module
- GRE_MODULE	= 1
- LIBXUL_LIBRARY  = 1
- 
- 
- CPPSRCS		= \
- 			imgContainer.cpp \
-+			imgContainerSVG.cpp \
- 			imgFrame.cpp \
- 			imgLoader.cpp    \
- 			imgRequest.cpp   \
- 			imgRequestProxy.cpp \
- 			imgTools.cpp \
- 			imgContainerRequest.cpp \
- 			$(NULL)
- 
-diff --git a/modules/libpr0n/src/imgContainerSVG.cpp b/modules/libpr0n/src/imgContainerSVG.cpp
-new file mode 100644
---- /dev/null
-+++ b/modules/libpr0n/src/imgContainerSVG.cpp
-@@ -0,0 +1,473 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-+/* ***** BEGIN LICENSE BLOCK *****
-+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
-+ *
-+ * The contents of this file are subject to the Mozilla Public License Version
-+ * 1.1 (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ * http://www.mozilla.org/MPL/
-+ *
-+ * Software distributed under the License is distributed on an "AS IS" basis,
-+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-+ * for the specific language governing rights and limitations under the
-+ * License.
-+ *
-+ * The Original Code is the Mozilla SVG Module.
-+ *
-+ * The Initial Developer of the Original Code is
-+ * the Mozilla Foundation.
-+ * Portions created by the Initial Developer are Copyright (C) 2010
-+ * the Initial Developer. All Rights Reserved.
-+ *
-+ * Contributor(s):
-+ *
-+ * Alternatively, the contents of this file may be used under the terms of
-+ * either the GNU General Public License Version 2 or later (the "GPL"), or
-+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-+ * in which case the provisions of the GPL or the LGPL are applicable instead
-+ * of those above. If you wish to allow use of your version of this file only
-+ * under the terms of either the GPL or the LGPL, and not to allow others to
-+ * use your version of this file under the terms of the MPL, indicate your
-+ * decision by deleting the provisions above and replace them with the notice
-+ * and other provisions required by the GPL or the LGPL. If you do not delete
-+ * the provisions above, a recipient may use your version of this file under
-+ * the terms of any one of the MPL, the GPL or the LGPL.
-+ *
-+ * ***** END LICENSE BLOCK ***** */
-+
-+#include "imgContainerSVG.h"
-+#include "gfxContext.h"
-+
-+NS_IMPL_ISUPPORTS1(imgContainerSVG, imgIContainer)
-+
-+imgContainerSVG::imgContainerSVG() :
-+  mError(PR_FALSE)
-+{
-+}
-+
-+imgContainerSVG::~imgContainerSVG()
-+{
-+}
-+
-+//******************************************************************************
-+/* void init(in imgIDecoderObserver aObserver, in string aMimeType,
-+             in PRUint32 aFlags); */
-+NS_IMETHODIMP imgContainerSVG::Init(imgIDecoderObserver *aObserver,
-+                                    const char* aMimeType,
-+                                    PRUint32 aFlags)
-+{
-+  // XXXdholbert Assert that mimetype == "image/svg+xml"
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* [noscript] imgIContainer extractFrame(PRUint32 aWhichFrame,
-+ *                                       [const] in nsIntRect aRegion,
-+ *                                       in PRUint32 aFlags); */
-+NS_IMETHODIMP imgContainerSVG::ExtractFrame(PRUint32 aWhichFrame,
-+                                            const nsIntRect &aRegion,
-+                                            PRUint32 aFlags,
-+                                            imgIContainer **_retval)
-+{
-+  NS_ENSURE_ARG_POINTER(_retval);
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* readonly attribute PRInt32 width; */
-+NS_IMETHODIMP imgContainerSVG::GetWidth(PRInt32 *aWidth)
-+{
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* readonly attribute PRInt32 height; */
-+NS_IMETHODIMP imgContainerSVG::GetHeight(PRInt32 *aHeight)
-+{
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* readonly attribute boolean currentFrameIsOpaque; */
-+NS_IMETHODIMP imgContainerSVG::GetCurrentFrameIsOpaque(PRBool *aIsOpaque)
-+{
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* [noscript] void getCurrentFrameRect(nsIntRect rect); */
-+NS_IMETHODIMP imgContainerSVG::GetCurrentFrameRect(nsIntRect &aRect)
-+{
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* readonly attribute unsigned long currentFrameIndex; */
-+NS_IMETHODIMP imgContainerSVG::GetCurrentFrameIndex(PRUint32 *aCurrentFrameIdx)
-+{
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* readonly attribute unsigned long numFrames; */
-+NS_IMETHODIMP imgContainerSVG::GetNumFrames(PRUint32 *aNumFrames)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* readonly attribute boolean animated; */
-+NS_IMETHODIMP imgContainerSVG::GetAnimated(PRBool *aAnimated)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+
-+//******************************************************************************
-+/* [noscript] gfxImageSurface copyFrame(in PRUint32 aWhichFrame,
-+ *                                      in PRUint32 aFlags); */
-+NS_IMETHODIMP imgContainerSVG::CopyFrame(PRUint32 aWhichFrame,
-+                                         PRUint32 aFlags,
-+                                         gfxImageSurface **_retval)
-+{
-+  if (aWhichFrame > FRAME_MAX_VALUE)
-+    return NS_ERROR_INVALID_ARG;
-+
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* [noscript] gfxASurface getFrame(in PRUint32 aWhichFrame,
-+ *                                 in PRUint32 aFlags); */
-+NS_IMETHODIMP imgContainerSVG::GetFrame(PRUint32 aWhichFrame,
-+                                        PRUint32 aFlags,
-+                                        gfxASurface **_retval)
-+{
-+  if (aWhichFrame > FRAME_MAX_VALUE)
-+    return NS_ERROR_INVALID_ARG;
-+
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* readonly attribute unsigned long dataSize; */
-+NS_IMETHODIMP imgContainerSVG::GetDataSize(PRUint32 *_retval)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  NS_ENSURE_ARG_POINTER(_retval);
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+/* [noscript] void appendFrame (in PRInt32 aX, in PRInt32 aY, in PRInt32 aWidth, in PRInt32 aHeight, in gfxImageFormat aFormat, [array, size_is (imageLength)] out PRUint8 imageData, out unsigned long imageLength); */
-+NS_IMETHODIMP imgContainerSVG::AppendFrame(PRInt32 aX, PRInt32 aY, PRInt32 aWidth,
-+                                        PRInt32 aHeight, 
-+                                        gfxASurface::gfxImageFormat aFormat,
-+                                        PRUint8 **imageData,
-+                                        PRUint32 *imageLength)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  NS_ENSURE_ARG_POINTER(imageData);
-+  NS_ENSURE_ARG_POINTER(imageLength);
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+/* [noscript] void appendPalettedFrame (in PRInt32 aX, in PRInt32 aY, in PRInt32 aWidth, in PRInt32 aHeight, in gfxImageFormat aFormat, in PRUint8 aPaletteDepth, [array, size_is (imageLength)] out PRUint8 imageData, out unsigned long imageLength, [array, size_is (paletteLength)] out PRUint32 paletteData, out unsigned long paletteLength); */
-+NS_IMETHODIMP imgContainerSVG::AppendPalettedFrame(PRInt32 aX, PRInt32 aY,
-+                                                PRInt32 aWidth, PRInt32 aHeight,
-+                                                gfxASurface::gfxImageFormat aFormat,
-+                                                PRUint8 aPaletteDepth,
-+                                                PRUint8 **imageData,
-+                                                PRUint32 *imageLength,
-+                                                PRUint32 **paletteData,
-+                                                PRUint32 *paletteLength)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  NS_ENSURE_ARG_POINTER(imageData);
-+  NS_ENSURE_ARG_POINTER(imageLength);
-+  NS_ENSURE_ARG_POINTER(paletteData);
-+  NS_ENSURE_ARG_POINTER(paletteLength);
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+/*  [noscript] void setSize(in long aWidth, in long aHeight); */
-+NS_IMETHODIMP imgContainerSVG::SetSize(PRInt32 aWidth, PRInt32 aHeight)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+/*  [noscript] void ensureCleanFrame(in unsigned long aFramenum, in PRInt32 aX, 
-+                                     in PRInt32 aY, in PRInt32 aWidth, 
-+                                     in PRInt32 aHeight, in gfxImageFormat aFormat, 
-+                                     [array, size_is(imageLength)]
-+                                       out PRUint8 imageData,
-+                                     out unsigned long imageLength); */
-+NS_IMETHODIMP imgContainerSVG::EnsureCleanFrame(PRUint32 aFrameNum, PRInt32 aX, PRInt32 aY,
-+                                             PRInt32 aWidth, PRInt32 aHeight, 
-+                                             gfxASurface::gfxImageFormat aFormat,
-+                                             PRUint8 **imageData, PRUint32 *imageLength)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  NS_ENSURE_ARG_POINTER(imageData);
-+  NS_ENSURE_ARG_POINTER(imageLength);
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+
-+//******************************************************************************
-+/* void frameUpdated (in unsigned long framenumber, in nsIntRect rect); */
-+NS_IMETHODIMP imgContainerSVG::FrameUpdated(PRUint32 aFrameNum, nsIntRect &aUpdatedRect)
-+{
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void setFrameDisposalMethod (in unsigned long framenumber, in PRInt32 aDisposalMethod); */
-+NS_IMETHODIMP imgContainerSVG::SetFrameDisposalMethod(PRUint32 aFrameNum, PRInt32 aDisposalMethod)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void setFrameTimeout (in unsigned long framenumber, in PRInt32 aTimeout); */
-+NS_IMETHODIMP imgContainerSVG::SetFrameTimeout(PRUint32 aFrameNum, PRInt32 aTimeout)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void setFrameBlendMethod (in unsigned long framenumber, in PRInt32 aBlendMethod); */
-+NS_IMETHODIMP imgContainerSVG::SetFrameBlendMethod(PRUint32 aFrameNum, PRInt32 aBlendMethod)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+
-+//******************************************************************************
-+/* void setFrameHasNoAlpha (in unsigned long framenumber); */
-+NS_IMETHODIMP imgContainerSVG::SetFrameHasNoAlpha(PRUint32 aFrameNum)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void endFrameDecode (in unsigned long framenumber); */
-+NS_IMETHODIMP imgContainerSVG::EndFrameDecode(PRUint32 aFrameNum)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void decodingComplete (); */
-+NS_IMETHODIMP imgContainerSVG::DecodingComplete(void)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* attribute unsigned short animationMode; */
-+NS_IMETHODIMP imgContainerSVG::GetAnimationMode(PRUint16 *aAnimationMode)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  NS_ENSURE_ARG_POINTER(aAnimationMode);
-+  
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* attribute unsigned short animationMode; */
-+NS_IMETHODIMP imgContainerSVG::SetAnimationMode(PRUint16 aAnimationMode)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  NS_ASSERTION(aAnimationMode == imgIContainer::kNormalAnimMode ||
-+               aAnimationMode == imgIContainer::kDontAnimMode ||
-+               aAnimationMode == imgIContainer::kLoopOnceAnimMode,
-+               "Wrong Animation Mode is being set!");
-+  
-+  /*
-+  switch (mAnimationMode = aAnimationMode) {
-+  }
-+  */
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void startAnimation () */
-+NS_IMETHODIMP imgContainerSVG::StartAnimation()
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void stopAnimation (); */
-+NS_IMETHODIMP imgContainerSVG::StopAnimation()
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void resetAnimation (); */
-+NS_IMETHODIMP imgContainerSVG::ResetAnimation()
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* attribute long loopCount; */
-+NS_IMETHODIMP imgContainerSVG::GetLoopCount(PRInt32 *aLoopCount)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  NS_ENSURE_ARG_POINTER(aLoopCount);
-+  
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* attribute long loopCount; */
-+NS_IMETHODIMP imgContainerSVG::SetLoopCount(PRInt32 aLoopCount)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void addSourceData(in nsIInputStream aInputStream, in unsigned long aCount); */
-+NS_IMETHODIMP imgContainerSVG::AddSourceData(const char *aBuffer, PRUint32 aCount)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  NS_ENSURE_ARG_POINTER(aBuffer);
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void sourceDataComplete(); */
-+NS_IMETHODIMP imgContainerSVG::SourceDataComplete()
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void newSourceData(); */
-+NS_IMETHODIMP imgContainerSVG::NewSourceData()
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void requestDecode() */
-+NS_IMETHODIMP
-+imgContainerSVG::RequestDecode()
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* [noscript] void draw(in gfxContext aContext, in gfxGraphicsFilter aFilter,
-+ * in gfxMatrix aUserSpaceToImageSpace, in gfxRect aFill, in nsIntRect aSubimage,
-+ * in PRUint32 aFlags); */ 
-+NS_IMETHODIMP imgContainerSVG::Draw(gfxContext *aContext, gfxPattern::GraphicsFilter aFilter, 
-+                                 gfxMatrix &aUserSpaceToImageSpace, gfxRect &aFill,
-+                                 nsIntRect &aSubimage, PRUint32 aFlags)
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  NS_ENSURE_ARG_POINTER(aContext);
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void lockImage() */
-+NS_IMETHODIMP
-+imgContainerSVG::LockImage()
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-+
-+//******************************************************************************
-+/* void unlockImage() */
-+NS_IMETHODIMP
-+imgContainerSVG::UnlockImage()
-+{
-+  if (mError)
-+    return NS_ERROR_FAILURE;
-+
-+  return NS_ERROR_NOT_IMPLEMENTED;
-+}
-diff --git a/modules/libpr0n/src/imgContainerSVG.h b/modules/libpr0n/src/imgContainerSVG.h
-new file mode 100644
---- /dev/null
-+++ b/modules/libpr0n/src/imgContainerSVG.h
-@@ -0,0 +1,69 @@
-+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-+/* ***** BEGIN LICENSE BLOCK *****
-+ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
-+ *
-+ * The contents of this file are subject to the Mozilla Public License Version
-+ * 1.1 (the "License"); you may not use this file except in compliance with
-+ * the License. You may obtain a copy of the License at
-+ * http://www.mozilla.org/MPL/
-+ *
-+ * Software distributed under the License is distributed on an "AS IS" basis,
-+ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
-+ * for the specific language governing rights and limitations under the
-+ * License.
-+ *
-+ * The Original Code is the Mozilla SVG Module.
-+ *
-+ * The Initial Developer of the Original Code is
-+ * the Mozilla Foundation.
-+ * Portions created by the Initial Developer are Copyright (C) 2010
-+ * the Initial Developer. All Rights Reserved.
-+ *
-+ * Contributor(s):
-+ *
-+ * Alternatively, the contents of this file may be used under the terms of
-+ * either the GNU General Public License Version 2 or later (the "GPL"), or
-+ * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
-+ * in which case the provisions of the GPL or the LGPL are applicable instead
-+ * of those above. If you wish to allow use of your version of this file only
-+ * under the terms of either the GPL or the LGPL, and not to allow others to
-+ * use your version of this file under the terms of the MPL, indicate your
-+ * decision by deleting the provisions above and replace them with the notice
-+ * and other provisions required by the GPL or the LGPL. If you do not delete
-+ * the provisions above, a recipient may use your version of this file under
-+ * the terms of any one of the MPL, the GPL or the LGPL.
-+ *
-+ * ***** END LICENSE BLOCK ***** */
-+
-+#ifndef imgContainerSVG_H_
-+#define imgContainerSVG_H_
-+
-+#include "imgIContainer.h"
-+
-+#define NS_IMGCONTAINERSVG_CID \
-+{ 0x74bedb60,                                      \
-+  0xc188,                                          \
-+  0x4e05,                                          \
-+  {0x9b, 0x21, 0x24, 0xe0, 0xc0, 0x5e, 0xc9, 0xa3} \
-+}
-+
-+class imgContainerSVG : public imgIContainer
-+/*
-+// XXXdholbert Do I need these other interfaces?
-+                        public nsITimerCallback,
-+                        public nsIProperties,
-+                        public nsSupportsWeakReference
-+*/
-+{
-+public:
-+  imgContainerSVG();
-+  virtual ~imgContainerSVG();
-+
-+  NS_DECL_ISUPPORTS
-+  NS_DECL_IMGICONTAINER
-+
-+private:
-+  PRPackedBool mError:1;
-+};
-+
-+#endif // imgContainerSVG_H_
-diff --git a/modules/libpr0n/src/imgRequest.cpp b/modules/libpr0n/src/imgRequest.cpp
---- a/modules/libpr0n/src/imgRequest.cpp
-+++ b/modules/libpr0n/src/imgRequest.cpp
-@@ -963,16 +963,18 @@ NS_IMETHODIMP imgRequest::OnDataAvailabl
- {
-   LOG_SCOPE_WITH_PARAM(gImgLog, "imgRequest::OnDataAvailable", "count", count);
- 
-   NS_ASSERTION(aRequest, "imgRequest::OnDataAvailable -- no request!");
- 
-   mGotData = PR_TRUE;
-   nsresult rv;
- 
-+  PRBool isSVG = PR_FALSE;
-+
-   if (!mImage) {
-     LOG_SCOPE(gImgLog, "imgRequest::OnDataAvailable |First time through... finding mimetype|");
- 
-     /* look at the first few bytes and see if we can tell what the data is from that
-      * since servers tend to lie. :(
-      */
-     PRUint32 out;
-     inStr->ReadSegments(sniff_mimetype_callback, this, count, &out);
-@@ -1063,63 +1065,77 @@ NS_IMETHODIMP imgRequest::OnDataAvailabl
-     PRUint32 containerFlags = imgIContainer::INIT_FLAG_NONE;
-     if (isDiscardable)
-       containerFlags |= imgIContainer::INIT_FLAG_DISCARDABLE;
-     if (doDecodeOnDraw)
-       containerFlags |= imgIContainer::INIT_FLAG_DECODE_ON_DRAW;
-     if (mIsMultiPartChannel)
-       containerFlags |= imgIContainer::INIT_FLAG_MULTIPART;
- 
--    // Create and initialize the imgContainer. This instantiates a decoder behind
--    // the scenes, so if we don't have a decoder for this mimetype we'll find out
--    // about it here.
--    mImage = do_CreateInstance("@mozilla.org/image/container;3");
--    if (!mImage) {
--      this->Cancel(NS_ERROR_OUT_OF_MEMORY);
--      return NS_ERROR_OUT_OF_MEMORY;
--    }
--    rv = mImage->Init(this, mContentType.get(), containerFlags);
--    if (NS_FAILED(rv)) { // Probably bad mimetype
-+    isSVG = mContentType.EqualsLiteral("image/svg+xml");
-+    if (isSVG) {
-+      // XXXdholbert Instantiate custom imgContainer
-+      NS_WARNING("***********dholbert Instantiating SVG custom imgIContainer");
-+      mImage = do_CreateInstance("@mozilla.org/image/svgcontainer;1");
-+      if (!mImage) {
-+        return NS_ERROR_FAILURE;
-+      }
-+      NS_NOTREACHED("****dholbert Oops, we created an image but didn't do stuff with it yet");
-+    } else {
-+      // Create and initialize the imgContainer. This instantiates a decoder behind
-+      // the scenes, so if we don't have a decoder for this mimetype we'll find out
-+      // about it here.
-+      mImage = do_CreateInstance("@mozilla.org/image/container;3");
-+      if (!mImage) {
-+        this->Cancel(NS_ERROR_OUT_OF_MEMORY);
-+        return NS_ERROR_OUT_OF_MEMORY;
-+      }
-+      rv = mImage->Init(this, mContentType.get(), containerFlags);
-+      if (NS_FAILED(rv)) { // Probably bad mimetype
- 
--      // There's no reason to keep the image around. Save memory.
--      //
--      // XXXbholley - This is also here because I'm not sure we've found
--      // all the consumers who (incorrectly) check whether the container
--      // is null to determine things like size availability (they should
--      // be checking the image status instead).
--      mImage = nsnull;
-+        // There's no reason to keep the image around. Save memory.
-+        //
-+        // XXXbholley - This is also here because I'm not sure we've found
-+        // all the consumers who (incorrectly) check whether the container
-+        // is null to determine things like size availability (they should
-+        // be checking the image status instead).
-+        mImage = nsnull;
- 
--      this->Cancel(rv);
--      return NS_BINDING_ABORTED;
-+        this->Cancel(rv);
-+        return NS_BINDING_ABORTED;
-+      }
-     }
- 
-     // If we were waiting on the image to do something, now's our chance.
-     if (mDecodeRequested) {
-       mImage->RequestDecode();
-     }
-     while (mDeferredLocks) {
-       mImage->LockImage();
-       mDeferredLocks--;
-     }
-   }
- 
--  // WriteToContainer always consumes everything it gets
--  PRUint32 bytesRead;
--  rv = inStr->ReadSegments(imgContainer::WriteToContainer,
--                           static_cast<void*>(mImage),
--                           count, &bytesRead);
--  if (NS_FAILED(rv)) {
--    PR_LOG(gImgLog, PR_LOG_WARNING,
--           ("[this=%p] imgRequest::OnDataAvailable -- "
--            "copy to container failed\n", this));
--    this->Cancel(NS_IMAGELIB_ERROR_FAILURE);
--    return NS_BINDING_ABORTED;
-+  if (isSVG) {
-+    NS_WARNING("***********dholbert Need to call inStr->ReadSegments(something) here");
-+  } else {
-+    // WriteToContainer always consumes everything it gets
-+    PRUint32 bytesRead;
-+    rv = inStr->ReadSegments(imgContainer::WriteToContainer,
-+                             static_cast<void*>(mImage),
-+                             count, &bytesRead);
-+    if (NS_FAILED(rv)) {
-+      PR_LOG(gImgLog, PR_LOG_WARNING,
-+             ("[this=%p] imgRequest::OnDataAvailable -- "
-+              "copy to container failed\n", this));
-+      this->Cancel(NS_IMAGELIB_ERROR_FAILURE);
-+      return NS_BINDING_ABORTED;
-+    }
-+    NS_ABORT_IF_FALSE(bytesRead == count, "WriteToContainer should consume everything!");
-   }
--  NS_ABORT_IF_FALSE(bytesRead == count, "WriteToContainer should consume everything!");
--
-   return NS_OK;
- }
- 
- static NS_METHOD sniff_mimetype_callback(nsIInputStream* in,
-                                          void* closure,
-                                          const char* fromRawSegment,
-                                          PRUint32 toOffset,
-                                          PRUint32 count,