Backed out changeset 8e33d0ce108c (bug 1351447) for failing /builds/worker/workspace/build/src/widget/cocoa/nsCocoaUtils on OS X r=backout a=backout on a CLOSED TREE
authorCiure Andrei <aciure@mozilla.com>
Tue, 12 Dec 2017 09:49:59 +0200
changeset 447828 c6340ede9772df18d59f024d9acc5b5c01f14539
parent 447827 8d5b3c6a63878ad60954e1d042e94fb0cccaf2d3
child 447829 9c840afb8a68e8d90059491f3f3345bb8cb5de3a
push id8527
push userCallek@gmail.com
push dateThu, 11 Jan 2018 21:05:50 +0000
treeherdermozilla-beta@95342d212a7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout, backout
bugs1351447
milestone59.0a1
backs out8e33d0ce108cfbeb22dfafc9c5f57a233ec163db
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Backed out changeset 8e33d0ce108c (bug 1351447) for failing /builds/worker/workspace/build/src/widget/cocoa/nsCocoaUtils on OS X r=backout a=backout on a CLOSED TREE
dom/canvas/CanvasRenderingContext2D.cpp
image/ClippedImage.cpp
image/ClippedImage.h
image/DrawResult.h
image/DynamicImage.cpp
image/FrozenImage.cpp
image/FrozenImage.h
image/Image.cpp
image/Image.h
image/ImageWrapper.cpp
image/ImgDrawResult.h
image/OrientedImage.cpp
image/OrientedImage.h
image/RasterImage.cpp
image/RasterImage.h
image/VectorImage.cpp
image/VectorImage.h
image/imgIContainer.idl
image/moz.build
layout/base/nsLayoutUtils.cpp
layout/base/nsLayoutUtils.h
layout/forms/nsButtonFrameRenderer.cpp
layout/forms/nsButtonFrameRenderer.h
layout/forms/nsFieldSetFrame.cpp
layout/forms/nsFieldSetFrame.h
layout/forms/nsRangeFrame.cpp
layout/generic/nsBulletFrame.cpp
layout/generic/nsBulletFrame.h
layout/generic/nsColumnSetFrame.cpp
layout/generic/nsImageFrame.cpp
layout/generic/nsImageFrame.h
layout/mathml/nsMathMLChar.cpp
layout/mathml/nsMathMLmtableFrame.cpp
layout/painting/nsCSSRendering.cpp
layout/painting/nsCSSRendering.h
layout/painting/nsCSSRenderingBorders.cpp
layout/painting/nsCSSRenderingBorders.h
layout/painting/nsDisplayList.cpp
layout/painting/nsDisplayList.h
layout/painting/nsDisplayListInvalidation.h
layout/painting/nsImageRenderer.cpp
layout/painting/nsImageRenderer.h
layout/svg/SVGContextPaint.h
layout/svg/nsFilterInstance.cpp
layout/svg/nsSVGClipPathFrame.cpp
layout/svg/nsSVGContainerFrame.cpp
layout/svg/nsSVGForeignObjectFrame.cpp
layout/svg/nsSVGIntegrationUtils.cpp
layout/svg/nsSVGIntegrationUtils.h
layout/svg/nsSVGMaskFrame.cpp
layout/svg/nsSVGUtils.h
layout/tables/nsTableCellFrame.cpp
layout/tables/nsTableCellFrame.h
layout/tables/nsTableFrame.h
layout/xul/nsGroupBoxFrame.cpp
layout/xul/nsImageBoxFrame.cpp
layout/xul/nsImageBoxFrame.h
layout/xul/tree/nsTreeBodyFrame.cpp
layout/xul/tree/nsTreeBodyFrame.h
widget/nsBaseDragService.cpp
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -5421,17 +5421,17 @@ CanvasRenderingContext2D::DrawDirectlyTo
   CSSIntSize sz(scaledImageSize.width, scaledImageSize.height); // XXX hmm is scaledImageSize really in CSS pixels?
   SVGImageContext svgContext(Some(sz));
 
   auto result = aImage.mImgContainer->
     Draw(context, scaledImageSize,
          ImageRegion::Create(gfxRect(aSrc.x, aSrc.y, aSrc.width, aSrc.height)),
          aImage.mWhichFrame, SamplingFilter::GOOD, Some(svgContext), modifiedFlags, CurrentState().globalAlpha);
 
-  if (result != ImgDrawResult::SUCCESS) {
+  if (result != DrawResult::SUCCESS) {
     NS_WARNING("imgIContainer::Draw failed");
   }
 }
 
 void
 CanvasRenderingContext2D::SetGlobalCompositeOperation(const nsAString& aOp,
                                                       ErrorResult& aError)
 {
--- a/image/ClippedImage.cpp
+++ b/image/ClippedImage.cpp
@@ -38,17 +38,17 @@ namespace image {
 class ClippedImageCachedSurface
 {
 public:
   ClippedImageCachedSurface(already_AddRefed<SourceSurface> aSurface,
                             const nsIntSize& aSize,
                             const Maybe<SVGImageContext>& aSVGContext,
                             float aFrame,
                             uint32_t aFlags,
-                            ImgDrawResult aDrawResult)
+                            DrawResult aDrawResult)
     : mSurface(aSurface)
     , mSize(aSize)
     , mSVGContext(aSVGContext)
     , mFrame(aFrame)
     , mFlags(aFlags)
     , mDrawResult(aDrawResult)
   {
     MOZ_ASSERT(mSurface, "Must have a valid surface");
@@ -66,51 +66,51 @@ public:
   }
 
   already_AddRefed<SourceSurface> Surface() const
   {
     RefPtr<SourceSurface> surf(mSurface);
     return surf.forget();
   }
 
-  ImgDrawResult GetDrawResult() const
+  DrawResult GetDrawResult() const
   {
     return mDrawResult;
   }
 
   bool NeedsRedraw() const
   {
-    return mDrawResult != ImgDrawResult::SUCCESS &&
-           mDrawResult != ImgDrawResult::BAD_IMAGE;
+    return mDrawResult != DrawResult::SUCCESS &&
+           mDrawResult != DrawResult::BAD_IMAGE;
   }
 
 private:
   RefPtr<SourceSurface>  mSurface;
   const nsIntSize        mSize;
   Maybe<SVGImageContext> mSVGContext;
   const float            mFrame;
   const uint32_t         mFlags;
-  const ImgDrawResult    mDrawResult;
+  const DrawResult       mDrawResult;
 };
 
 class DrawSingleTileCallback : public gfxDrawingCallback
 {
 public:
   DrawSingleTileCallback(ClippedImage* aImage,
                          const nsIntSize& aSize,
                          const Maybe<SVGImageContext>& aSVGContext,
                          uint32_t aWhichFrame,
                          uint32_t aFlags,
                          float aOpacity)
     : mImage(aImage)
     , mSize(aSize)
     , mSVGContext(aSVGContext)
     , mWhichFrame(aWhichFrame)
     , mFlags(aFlags)
-    , mDrawResult(ImgDrawResult::NOT_READY)
+    , mDrawResult(DrawResult::NOT_READY)
     , mOpacity(aOpacity)
   {
     MOZ_ASSERT(mImage, "Must have an image to clip");
   }
 
   virtual bool operator()(gfxContext* aContext,
                           const gfxRect& aFillRect,
                           const SamplingFilter aSamplingFilter,
@@ -125,25 +125,25 @@ public:
     mDrawResult =
       mImage->DrawSingleTile(aContext, mSize, ImageRegion::Create(aFillRect),
                              mWhichFrame, aSamplingFilter, mSVGContext, mFlags,
                              mOpacity);
 
     return true;
   }
 
-  ImgDrawResult GetDrawResult() { return mDrawResult; }
+  DrawResult GetDrawResult() { return mDrawResult; }
 
 private:
   RefPtr<ClippedImage>        mImage;
   const nsIntSize               mSize;
   const Maybe<SVGImageContext>& mSVGContext;
   const uint32_t                mWhichFrame;
   const uint32_t                mFlags;
-  ImgDrawResult                 mDrawResult;
+  DrawResult                    mDrawResult;
   float                         mOpacity;
 };
 
 ClippedImage::ClippedImage(Image* aImage,
                            nsIntRect aClip,
                            const Maybe<nsSize>& aSVGViewportSize)
   : ImageWrapper(aImage)
   , mClip(aClip)
@@ -255,56 +255,56 @@ ClippedImage::GetIntrinsicRatio(nsSize* 
   *aRatio = nsSize(mClip.Width(), mClip.Height());
   return NS_OK;
 }
 
 NS_IMETHODIMP_(already_AddRefed<SourceSurface>)
 ClippedImage::GetFrame(uint32_t aWhichFrame,
                        uint32_t aFlags)
 {
-  ImgDrawResult result;
+  DrawResult result;
   RefPtr<SourceSurface> surface;
   Tie(result, surface) = GetFrameInternal(mClip.Size(), Nothing(), aWhichFrame, aFlags, 1.0);
   return surface.forget();
 }
 
 NS_IMETHODIMP_(already_AddRefed<SourceSurface>)
 ClippedImage::GetFrameAtSize(const IntSize& aSize,
                              uint32_t aWhichFrame,
                              uint32_t aFlags)
 {
   // XXX(seth): It'd be nice to support downscale-during-decode for this case,
   // but right now we just fall back to the intrinsic size.
   return GetFrame(aWhichFrame, aFlags);
 }
 
-Pair<ImgDrawResult, RefPtr<SourceSurface>>
+Pair<DrawResult, RefPtr<SourceSurface>>
 ClippedImage::GetFrameInternal(const nsIntSize& aSize,
                                const Maybe<SVGImageContext>& aSVGContext,
                                uint32_t aWhichFrame,
                                uint32_t aFlags,
                                float aOpacity)
 {
   if (!ShouldClip()) {
     RefPtr<SourceSurface> surface = InnerImage()->GetFrame(aWhichFrame, aFlags);
-    return MakePair(surface ? ImgDrawResult::SUCCESS : ImgDrawResult::NOT_READY,
+    return MakePair(surface ? DrawResult::SUCCESS : DrawResult::NOT_READY,
                     Move(surface));
   }
 
   float frameToDraw = InnerImage()->GetFrameIndex(aWhichFrame);
   if (!mCachedSurface ||
       !mCachedSurface->Matches(aSize, aSVGContext, frameToDraw, aFlags) ||
       mCachedSurface->NeedsRedraw()) {
     // Create a surface to draw into.
     RefPtr<DrawTarget> target = gfxPlatform::GetPlatform()->
       CreateOffscreenContentDrawTarget(IntSize(aSize.width, aSize.height),
                                        SurfaceFormat::B8G8R8A8);
     if (!target || !target->IsValid()) {
       NS_ERROR("Could not create a DrawTarget");
-      return MakePair(ImgDrawResult::TEMPORARY_ERROR, RefPtr<SourceSurface>());
+      return MakePair(DrawResult::TEMPORARY_ERROR, RefPtr<SourceSurface>());
     }
 
     RefPtr<gfxContext> ctx = gfxContext::CreateOrNull(target);
     MOZ_ASSERT(ctx); // already checked the draw target above
 
     // Create our callback.
     RefPtr<DrawSingleTileCallback> drawTileCallback =
       new DrawSingleTileCallback(this, aSize, aSVGContext, aWhichFrame, aFlags,
@@ -396,17 +396,17 @@ MustCreateSurface(gfxContext* aContext,
   gfxRect imageRect(0, 0, aSize.width, aSize.height);
   bool willTile = !imageRect.Contains(aRegion.Rect()) &&
                   !(aFlags & imgIContainer::FLAG_CLAMP);
   bool willResample = aContext->CurrentMatrix().HasNonIntegerTranslation() &&
                       (willTile || !aRegion.RestrictionContains(imageRect));
   return willTile || willResample;
 }
 
-NS_IMETHODIMP_(ImgDrawResult)
+NS_IMETHODIMP_(DrawResult)
 ClippedImage::Draw(gfxContext* aContext,
                    const nsIntSize& aSize,
                    const ImageRegion& aRegion,
                    uint32_t aWhichFrame,
                    SamplingFilter aSamplingFilter,
                    const Maybe<SVGImageContext>& aSVGContext,
                    uint32_t aFlags,
                    float aOpacity)
@@ -416,22 +416,22 @@ ClippedImage::Draw(gfxContext* aContext,
                               aSamplingFilter, aSVGContext, aFlags, aOpacity);
   }
 
   // Check for tiling. If we need to tile then we need to create a
   // gfxCallbackDrawable to handle drawing for us.
   if (MustCreateSurface(aContext, aSize, aRegion, aFlags)) {
     // Create a temporary surface containing a single tile of this image.
     // GetFrame will call DrawSingleTile internally.
-    ImgDrawResult result;
+    DrawResult result;
     RefPtr<SourceSurface> surface;
     Tie(result, surface) =
       GetFrameInternal(aSize, aSVGContext, aWhichFrame, aFlags, aOpacity);
     if (!surface) {
-      MOZ_ASSERT(result != ImgDrawResult::SUCCESS);
+      MOZ_ASSERT(result != DrawResult::SUCCESS);
       return result;
     }
 
     // Create a drawable from that surface.
     RefPtr<gfxSurfaceDrawable> drawable =
       new gfxSurfaceDrawable(surface, aSize);
 
     // Draw.
@@ -441,17 +441,17 @@ ClippedImage::Draw(gfxContext* aContext,
 
     return result;
   }
 
   return DrawSingleTile(aContext, aSize, aRegion, aWhichFrame,
                         aSamplingFilter, aSVGContext, aFlags, aOpacity);
 }
 
-ImgDrawResult
+DrawResult
 ClippedImage::DrawSingleTile(gfxContext* aContext,
                              const nsIntSize& aSize,
                              const ImageRegion& aRegion,
                              uint32_t aWhichFrame,
                              SamplingFilter aSamplingFilter,
                              const Maybe<SVGImageContext>& aSVGContext,
                              uint32_t aFlags,
                              float aOpacity)
--- a/image/ClippedImage.h
+++ b/image/ClippedImage.h
@@ -51,17 +51,17 @@ public:
     IsImageContainerAvailableAtSize(layers::LayerManager* aManager,
                                     const gfx::IntSize& aSize,
                                     uint32_t aFlags) override;
   NS_IMETHOD_(already_AddRefed<layers::ImageContainer>)
     GetImageContainerAtSize(layers::LayerManager* aManager,
                             const gfx::IntSize& aSize,
                             const Maybe<SVGImageContext>& aSVGContext,
                             uint32_t aFlags) override;
-  NS_IMETHOD_(ImgDrawResult) Draw(gfxContext* aContext,
+  NS_IMETHOD_(DrawResult) Draw(gfxContext* aContext,
                                const nsIntSize& aSize,
                                const ImageRegion& aRegion,
                                uint32_t aWhichFrame,
                                gfx::SamplingFilter aSamplingFilter,
                                const Maybe<SVGImageContext>& aSVGContext,
                                uint32_t aFlags,
                                float aOpacity) override;
   NS_IMETHOD RequestDiscard() override;
@@ -75,24 +75,24 @@ public:
 
 protected:
   ClippedImage(Image* aImage, nsIntRect aClip,
                const Maybe<nsSize>& aSVGViewportSize);
 
   virtual ~ClippedImage();
 
 private:
-  Pair<ImgDrawResult, RefPtr<SourceSurface>>
+  Pair<DrawResult, RefPtr<SourceSurface>>
     GetFrameInternal(const nsIntSize& aSize,
                      const Maybe<SVGImageContext>& aSVGContext,
                      uint32_t aWhichFrame,
                      uint32_t aFlags,
                      float aOpacity);
   bool ShouldClip();
-  ImgDrawResult DrawSingleTile(gfxContext* aContext,
+  DrawResult DrawSingleTile(gfxContext* aContext,
                             const nsIntSize& aSize,
                             const ImageRegion& aRegion,
                             uint32_t aWhichFrame,
                             gfx::SamplingFilter aSamplingFilter,
                             const Maybe<SVGImageContext>& aSVGContext,
                             uint32_t aFlags,
                             float aOpacity);
 
rename from image/ImgDrawResult.h
rename to image/DrawResult.h
--- a/image/ImgDrawResult.h
+++ b/image/DrawResult.h
@@ -1,27 +1,27 @@
 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
-#ifndef mozilla_image_ImgDrawResult_h
-#define mozilla_image_ImgDrawResult_h
+#ifndef mozilla_image_DrawResult_h
+#define mozilla_image_DrawResult_h
 
 #include <cstdint> // for uint8_t
 #include "mozilla/Attributes.h"
 #include "mozilla/Likely.h"
 
 namespace mozilla {
 namespace image {
 
 /**
  * An enumeration representing the result of a drawing operation.
  *
- * Most users of ImgDrawResult will only be interested in whether the value is
+ * Most users of DrawResult will only be interested in whether the value is
  * SUCCESS or not. The other values are primarily useful for debugging and error
  * handling.
  *
  * SUCCESS: We successfully drew a completely decoded frame of the requested
  * size. Drawing again with FLAG_SYNC_DECODE would not change the result.
  *
  * INCOMPLETE: We successfully drew a frame that was partially decoded. (Note
  * that successfully drawing a partially decoded frame may not actually draw any
@@ -41,66 +41,66 @@ namespace image {
  * TEMPORARY_ERROR: We failed to draw due to a temporary error. Drawing may
  * succeed at a later time.
  *
  * BAD_IMAGE: We failed to draw because the image has an error. This is a
  * permanent condition.
  *
  * BAD_ARGS: We failed to draw because bad arguments were passed to draw().
  */
-enum class MOZ_MUST_USE_TYPE ImgDrawResult : uint8_t
+enum class MOZ_MUST_USE_TYPE DrawResult : uint8_t
 {
   SUCCESS,
   INCOMPLETE,
   WRONG_SIZE,
   NOT_READY,
   TEMPORARY_ERROR,
   BAD_IMAGE,
   BAD_ARGS
 };
 
 /**
- * You can combine ImgDrawResults with &. By analogy to bitwise-&, the result is
- * ImgDrawResult::SUCCESS only if both operands are ImgDrawResult::SUCCESS. Otherwise,
- * a failing ImgDrawResult is returned; we favor the left operand's failure when
+ * You can combine DrawResults with &. By analogy to bitwise-&, the result is
+ * DrawResult::SUCCESS only if both operands are DrawResult::SUCCESS. Otherwise,
+ * a failing DrawResult is returned; we favor the left operand's failure when
  * deciding which failure to return, with the exception that we always prefer
- * any other kind of failure over ImgDrawResult::BAD_IMAGE, since other failures
+ * any other kind of failure over DrawResult::BAD_IMAGE, since other failures
  * are recoverable and we want to know if any recoverable failures occurred.
  */
-inline ImgDrawResult
-operator&(const ImgDrawResult aLeft, const ImgDrawResult aRight)
+inline DrawResult
+operator&(const DrawResult aLeft, const DrawResult aRight)
 {
-  if (MOZ_LIKELY(aLeft == ImgDrawResult::SUCCESS)) {
+  if (MOZ_LIKELY(aLeft == DrawResult::SUCCESS)) {
     return aRight;
   }
-  if (aLeft == ImgDrawResult::BAD_IMAGE && aRight != ImgDrawResult::SUCCESS) {
+  if (aLeft == DrawResult::BAD_IMAGE && aRight != DrawResult::SUCCESS) {
     return aRight;
   }
   return aLeft;
 }
 
-inline ImgDrawResult&
-operator&=(ImgDrawResult& aLeft, const ImgDrawResult aRight)
+inline DrawResult&
+operator&=(DrawResult& aLeft, const DrawResult aRight)
 {
   aLeft = aLeft & aRight;
   return aLeft;
 }
 
 /**
  * A struct used during painting to provide input flags to determine how
- * imagelib draw calls should behave and an output ImgDrawResult to return
+ * imagelib draw calls should behave and an output DrawResult to return
  * information about the result of any imagelib draw calls that may have
  * occurred.
  */
 struct imgDrawingParams {
   explicit imgDrawingParams(uint32_t aImageFlags = 0)
-    : imageFlags(aImageFlags), result(ImgDrawResult::SUCCESS)
+    : imageFlags(aImageFlags), result(DrawResult::SUCCESS)
   {}
 
   const uint32_t imageFlags; // imgIContainer::FLAG_* image flags to pass to
                              // image lib draw calls.
-  ImgDrawResult result;         // To return results from image lib painting.
+  DrawResult result;         // To return results from image lib painting.
 };
 
 } // namespace image
 } // namespace mozilla
 
-#endif // mozilla_image_ImgDrawResult_h
+#endif // mozilla_image_DrawResult_h
--- a/image/DynamicImage.cpp
+++ b/image/DynamicImage.cpp
@@ -200,17 +200,17 @@ DynamicImage::GetFrameAtSize(const IntSi
   }
   RefPtr<gfxContext> context = gfxContext::CreateOrNull(dt);
   MOZ_ASSERT(context); // already checked the draw target above
 
   auto result = Draw(context, aSize, ImageRegion::Create(aSize),
                      aWhichFrame, SamplingFilter::POINT, Nothing(), aFlags,
                      1.0);
 
-  return result == ImgDrawResult::SUCCESS ? dt->Snapshot() : nullptr;
+  return result == DrawResult::SUCCESS ? dt->Snapshot() : nullptr;
 }
 
 NS_IMETHODIMP_(bool)
 DynamicImage::WillDrawOpaqueNow()
 {
   return false;
 }
 
@@ -238,17 +238,17 @@ NS_IMETHODIMP_(already_AddRefed<ImageCon
 DynamicImage::GetImageContainerAtSize(LayerManager* aManager,
                                       const IntSize& aSize,
                                       const Maybe<SVGImageContext>& aSVGContext,
                                       uint32_t aFlags)
 {
   return nullptr;
 }
 
-NS_IMETHODIMP_(ImgDrawResult)
+NS_IMETHODIMP_(DrawResult)
 DynamicImage::Draw(gfxContext* aContext,
                    const nsIntSize& aSize,
                    const ImageRegion& aRegion,
                    uint32_t aWhichFrame,
                    SamplingFilter aSamplingFilter,
                    const Maybe<SVGImageContext>& aSVGContext,
                    uint32_t aFlags,
                    float aOpacity)
@@ -256,32 +256,32 @@ DynamicImage::Draw(gfxContext* aContext,
   MOZ_ASSERT(!aSize.IsEmpty(), "Unexpected empty size");
 
   IntSize drawableSize(mDrawable->Size());
 
   if (aSize == drawableSize) {
     gfxUtils::DrawPixelSnapped(aContext, mDrawable, SizeDouble(drawableSize), aRegion,
                                SurfaceFormat::B8G8R8A8, aSamplingFilter,
                                aOpacity);
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   gfxSize scale(double(aSize.width) / drawableSize.width,
                 double(aSize.height) / drawableSize.height);
 
   ImageRegion region(aRegion);
   region.Scale(1.0 / scale.width, 1.0 / scale.height);
 
   gfxContextMatrixAutoSaveRestore saveMatrix(aContext);
   aContext->Multiply(gfxMatrix::Scaling(scale.width, scale.height));
 
   gfxUtils::DrawPixelSnapped(aContext, mDrawable, SizeDouble(drawableSize), region,
                              SurfaceFormat::B8G8R8A8, aSamplingFilter,
                              aOpacity);
-  return ImgDrawResult::SUCCESS;
+  return DrawResult::SUCCESS;
 }
 
 NS_IMETHODIMP
 DynamicImage::StartDecoding(uint32_t aFlags)
 {
   return NS_OK;
 }
 
--- a/image/FrozenImage.cpp
+++ b/image/FrozenImage.cpp
@@ -88,17 +88,17 @@ FrozenImage::GetImageContainerAtSize(lay
   // XXX(seth): GetImageContainer does not currently support anything but the
   // current frame. We work around this by always returning null, but if it ever
   // turns out that FrozenImage is widely used on codepaths that can actually
   // benefit from GetImageContainer, it would be a good idea to fix that method
   // for performance reasons.
   return nullptr;
 }
 
-NS_IMETHODIMP_(ImgDrawResult)
+NS_IMETHODIMP_(DrawResult)
 FrozenImage::Draw(gfxContext* aContext,
                   const nsIntSize& aSize,
                   const ImageRegion& aRegion,
                   uint32_t /* aWhichFrame - ignored */,
                   SamplingFilter aSamplingFilter,
                   const Maybe<SVGImageContext>& aSVGContext,
                   uint32_t aFlags,
                   float aOpacity)
--- a/image/FrozenImage.h
+++ b/image/FrozenImage.h
@@ -50,17 +50,17 @@ public:
     IsImageContainerAvailableAtSize(layers::LayerManager* aManager,
                                     const gfx::IntSize& aSize,
                                     uint32_t aFlags) override;
   NS_IMETHOD_(already_AddRefed<layers::ImageContainer>)
     GetImageContainerAtSize(layers::LayerManager* aManager,
                             const gfx::IntSize& aSize,
                             const Maybe<SVGImageContext>& aSVGContext,
                             uint32_t aFlags) override;
-  NS_IMETHOD_(ImgDrawResult) Draw(gfxContext* aContext,
+  NS_IMETHOD_(DrawResult) Draw(gfxContext* aContext,
                                const nsIntSize& aSize,
                                const ImageRegion& aRegion,
                                uint32_t aWhichFrame,
                                gfx::SamplingFilter aSamplingFilter,
                                const Maybe<SVGImageContext>& aSVGContext,
                                uint32_t aFlags,
                                float aOpacity) override;
   NS_IMETHOD_(void) RequestRefresh(const TimeStamp& aTime) override;
--- a/image/Image.cpp
+++ b/image/Image.cpp
@@ -131,38 +131,38 @@ ImageResource::GetImageContainerImpl(Lay
       // It isn't a match, but still valid. Forget the container so we don't
       // try to reuse it below.
       container = nullptr;
     }
   }
 
   if (container) {
     switch (entry->mLastDrawResult) {
-      case ImgDrawResult::SUCCESS:
-      case ImgDrawResult::BAD_IMAGE:
-      case ImgDrawResult::BAD_ARGS:
+      case DrawResult::SUCCESS:
+      case DrawResult::BAD_IMAGE:
+      case DrawResult::BAD_ARGS:
         return container.forget();
-      case ImgDrawResult::NOT_READY:
-      case ImgDrawResult::INCOMPLETE:
-      case ImgDrawResult::TEMPORARY_ERROR:
+      case DrawResult::NOT_READY:
+      case DrawResult::INCOMPLETE:
+      case DrawResult::TEMPORARY_ERROR:
         // Temporary conditions where we need to rerequest the frame to recover.
         break;
-      case ImgDrawResult::WRONG_SIZE:
+      case DrawResult::WRONG_SIZE:
         // Unused by GetFrameInternal
       default:
-        MOZ_ASSERT_UNREACHABLE("Unhandled ImgDrawResult type!");
+        MOZ_ASSERT_UNREACHABLE("Unhandled DrawResult type!");
         return container.forget();
     }
   }
 
 #ifdef DEBUG
   NotifyDrawingObservers();
 #endif
 
-  ImgDrawResult drawResult;
+  DrawResult drawResult;
   IntSize bestSize;
   RefPtr<SourceSurface> surface;
   Tie(drawResult, bestSize, surface) =
     GetFrameInternal(size, aSVGContext, FRAME_CURRENT,
                      aFlags | FLAG_ASYNC_NOTIFY);
 
   // The requested size might be refused by the surface cache (i.e. due to
   // factor-of-2 mode). In that case we don't want to create an entry for this
@@ -188,27 +188,27 @@ ImageResource::GetImageContainerImpl(Lay
     i = mImageContainers.Length() - 1;
     for (; i >= 0; --i) {
       entry = &mImageContainers[i];
       if (bestSize == entry->mSize && flags == entry->mFlags &&
           aSVGContext == entry->mSVGContext) {
         container = entry->mContainer.get();
         if (container) {
           switch (entry->mLastDrawResult) {
-            case ImgDrawResult::SUCCESS:
-            case ImgDrawResult::BAD_IMAGE:
-            case ImgDrawResult::BAD_ARGS:
+            case DrawResult::SUCCESS:
+            case DrawResult::BAD_IMAGE:
+            case DrawResult::BAD_ARGS:
               return container.forget();
-            case ImgDrawResult::NOT_READY:
-            case ImgDrawResult::INCOMPLETE:
-            case ImgDrawResult::TEMPORARY_ERROR:
+            case DrawResult::NOT_READY:
+            case DrawResult::INCOMPLETE:
+            case DrawResult::TEMPORARY_ERROR:
               // Temporary conditions where we need to rerequest the frame to
               // recover. We have already done so!
               break;
-           case ImgDrawResult::WRONG_SIZE:
+           case DrawResult::WRONG_SIZE:
               // Unused by GetFrameInternal
             default:
               MOZ_ASSERT_UNREACHABLE("Unhandled DrawResult type!");
               return container.forget();
           }
         }
         break;
       }
--- a/image/Image.h
+++ b/image/Image.h
@@ -332,23 +332,23 @@ protected:
   TimeStamp                     mLastRefreshTime;
   uint64_t                      mInnerWindowId;
   uint32_t                      mAnimationConsumers;
   uint16_t                      mAnimationMode; // Enum values in imgIContainer
   bool                          mInitialized:1; // Have we been initalized?
   bool                          mAnimating:1;   // Are we currently animating?
   bool                          mError:1;       // Error handling
 
-  virtual Tuple<ImgDrawResult, gfx::IntSize, RefPtr<gfx::SourceSurface>>
+  virtual Tuple<DrawResult, gfx::IntSize, RefPtr<gfx::SourceSurface>>
     GetFrameInternal(const gfx::IntSize& aSize,
                      const Maybe<SVGImageContext>& aSVGContext,
                      uint32_t aWhichFrame,
                      uint32_t aFlags)
   {
-    return MakeTuple(ImgDrawResult::BAD_IMAGE, aSize,
+    return MakeTuple(DrawResult::BAD_IMAGE, aSize,
                      RefPtr<gfx::SourceSurface>());
   }
 
   /**
    * Calculate the estimated size to use for an image container with the given
    * parameters. It may not be the same as the given size, and it may not be
    * the same as the size of the surface in the image container, but it is the
    * best effort estimate.
@@ -378,28 +378,28 @@ private:
   struct ImageContainerEntry {
     ImageContainerEntry(const gfx::IntSize& aSize,
                         const Maybe<SVGImageContext>& aSVGContext,
                         layers::ImageContainer* aContainer,
                         uint32_t aFlags)
       : mSize(aSize)
       , mSVGContext(aSVGContext)
       , mContainer(aContainer)
-      , mLastDrawResult(ImgDrawResult::NOT_READY)
+      , mLastDrawResult(DrawResult::NOT_READY)
       , mFlags(aFlags)
     { }
 
     gfx::IntSize                        mSize;
     Maybe<SVGImageContext>              mSVGContext;
     // A weak pointer to our ImageContainer, which stays alive only as long as
     // the layer system needs it.
     WeakPtr<layers::ImageContainer>     mContainer;
-    // If mContainer is non-null, this contains the ImgDrawResult we obtained
+    // If mContainer is non-null, this contains the DrawResult we obtained
     // the last time we updated it.
-    ImgDrawResult                          mLastDrawResult;
+    DrawResult                          mLastDrawResult;
     // Cached flags to use for decoding. FLAG_ASYNC_NOTIFY should always be set
     // but FLAG_HIGH_QUALITY_SCALING may vary.
     uint32_t                            mFlags;
   };
 
   AutoTArray<ImageContainerEntry, 1> mImageContainers;
   layers::ImageContainer::ProducerID mImageProducerID;
   layers::ImageContainer::FrameID mLastFrameID;
--- a/image/ImageWrapper.cpp
+++ b/image/ImageWrapper.cpp
@@ -227,17 +227,17 @@ ImageWrapper::GetImageContainerAtSize(La
                                       const IntSize& aSize,
                                       const Maybe<SVGImageContext>& aSVGContext,
                                       uint32_t aFlags)
 {
   return mInnerImage->GetImageContainerAtSize(aManager, aSize,
                                               aSVGContext, aFlags);
 }
 
-NS_IMETHODIMP_(ImgDrawResult)
+NS_IMETHODIMP_(DrawResult)
 ImageWrapper::Draw(gfxContext* aContext,
                    const nsIntSize& aSize,
                    const ImageRegion& aRegion,
                    uint32_t aWhichFrame,
                    SamplingFilter aSamplingFilter,
                    const Maybe<SVGImageContext>& aSVGContext,
                    uint32_t aFlags,
                    float aOpacity)
--- a/image/OrientedImage.cpp
+++ b/image/OrientedImage.cpp
@@ -298,17 +298,17 @@ OrientedImage::OrientationMatrix(const n
       break;
     default:
       MOZ_ASSERT(false, "Invalid rotation value");
   }
 
   return builder.Build();
 }
 
-NS_IMETHODIMP_(ImgDrawResult)
+NS_IMETHODIMP_(DrawResult)
 OrientedImage::Draw(gfxContext* aContext,
                     const nsIntSize& aSize,
                     const ImageRegion& aRegion,
                     uint32_t aWhichFrame,
                     SamplingFilter aSamplingFilter,
                     const Maybe<SVGImageContext>& aSVGContext,
                     uint32_t aFlags,
                     float aOpacity)
--- a/image/OrientedImage.h
+++ b/image/OrientedImage.h
@@ -48,17 +48,17 @@ public:
     IsImageContainerAvailableAtSize(layers::LayerManager* aManager,
                                     const gfx::IntSize& aSize,
                                     uint32_t aFlags) override;
   NS_IMETHOD_(already_AddRefed<layers::ImageContainer>)
     GetImageContainerAtSize(layers::LayerManager* aManager,
                             const gfx::IntSize& aSize,
                             const Maybe<SVGImageContext>& aSVGContext,
                             uint32_t aFlags) override;
-  NS_IMETHOD_(ImgDrawResult) Draw(gfxContext* aContext,
+  NS_IMETHOD_(DrawResult) Draw(gfxContext* aContext,
                                const nsIntSize& aSize,
                                const ImageRegion& aRegion,
                                uint32_t aWhichFrame,
                                gfx::SamplingFilter aSamplingFilter,
                                const Maybe<SVGImageContext>& aSVGContext,
                                uint32_t aFlags,
                                float aOpacity) override;
   NS_IMETHOD_(nsIntRect) GetImageSpaceInvalidationRect(
--- a/image/RasterImage.cpp
+++ b/image/RasterImage.cpp
@@ -580,31 +580,31 @@ RasterImage::GetFrameAtSize(const IntSiz
   RefPtr<SourceSurface> surf = mozilla::Get<2>(result).forget();
 
   // If we are here, it suggests the image is embedded in a canvas or some
   // other path besides layers, and we won't need the file handle.
   MarkSurfaceShared(surf);
   return surf.forget();
 }
 
-Tuple<ImgDrawResult, IntSize, RefPtr<SourceSurface>>
+Tuple<DrawResult, IntSize, RefPtr<SourceSurface>>
 RasterImage::GetFrameInternal(const IntSize& aSize,
                               const Maybe<SVGImageContext>& aSVGContext,
                               uint32_t aWhichFrame,
                               uint32_t aFlags)
 {
   MOZ_ASSERT(aWhichFrame <= FRAME_MAX_VALUE);
 
   if (aSize.IsEmpty() || aWhichFrame > FRAME_MAX_VALUE) {
-    return MakeTuple(ImgDrawResult::BAD_ARGS, aSize,
+    return MakeTuple(DrawResult::BAD_ARGS, aSize,
                      RefPtr<SourceSurface>());
   }
 
   if (mError) {
-    return MakeTuple(ImgDrawResult::BAD_IMAGE, aSize,
+    return MakeTuple(DrawResult::BAD_IMAGE, aSize,
                      RefPtr<SourceSurface>());
   }
 
   // Get the frame. If it's not there, it's probably the caller's fault for
   // not waiting for the data to be loaded from the network or not passing
   // FLAG_SYNC_DECODE.
   LookupResult result =
     LookupFrame(aSize, aFlags, ToPlaybackType(aWhichFrame));
@@ -614,26 +614,26 @@ RasterImage::GetFrameInternal(const IntS
   // actual surface, depending on what it has in its cache.
   IntSize suggestedSize = result.SuggestedSize().IsEmpty()
                           ? aSize : result.SuggestedSize();
   MOZ_ASSERT_IF(result.Type() == MatchType::SUBSTITUTE_BECAUSE_BEST,
                 suggestedSize != aSize);
 
   if (!result) {
     // The OS threw this frame away and we couldn't redecode it.
-    return MakeTuple(ImgDrawResult::TEMPORARY_ERROR, suggestedSize,
+    return MakeTuple(DrawResult::TEMPORARY_ERROR, suggestedSize,
                      RefPtr<SourceSurface>());
   }
 
   RefPtr<SourceSurface> surface = result.Surface()->GetSourceSurface();
   if (!result.Surface()->IsFinished()) {
-    return MakeTuple(ImgDrawResult::INCOMPLETE, suggestedSize, Move(surface));
+    return MakeTuple(DrawResult::INCOMPLETE, suggestedSize, Move(surface));
   }
 
-  return MakeTuple(ImgDrawResult::SUCCESS, suggestedSize, Move(surface));
+  return MakeTuple(DrawResult::SUCCESS, suggestedSize, Move(surface));
 }
 
 IntSize
 RasterImage::GetImageContainerSize(LayerManager* aManager,
                                    const IntSize& aSize,
                                    uint32_t aFlags)
 {
   if (!IsImageContainerAvailableAtSize(aManager, aSize, aFlags)) {
@@ -1371,17 +1371,17 @@ RasterImage::CanDownscaleDuringDecode(co
   // There's no point in scaling if we can't store the result.
   if (!SurfaceCache::CanHold(aSize)) {
     return false;
   }
 
   return true;
 }
 
-ImgDrawResult
+DrawResult
 RasterImage::DrawInternal(DrawableSurface&& aSurface,
                           gfxContext* aContext,
                           const IntSize& aSize,
                           const ImageRegion& aRegion,
                           SamplingFilter aSamplingFilter,
                           uint32_t aFlags,
                           float aOpacity)
 {
@@ -1403,55 +1403,55 @@ RasterImage::DrawInternal(DrawableSurfac
     aContext->Multiply(gfxMatrix::Scaling(scale.width, scale.height));
     region.Scale(1.0 / scale.width, 1.0 / scale.height);
 
     couldRedecodeForBetterFrame = CanDownscaleDuringDecode(aSize, aFlags);
   }
 
   if (!aSurface->Draw(aContext, region, aSamplingFilter, aFlags, aOpacity)) {
     RecoverFromInvalidFrames(aSize, aFlags);
-    return ImgDrawResult::TEMPORARY_ERROR;
+    return DrawResult::TEMPORARY_ERROR;
   }
   if (!frameIsFinished) {
-    return ImgDrawResult::INCOMPLETE;
+    return DrawResult::INCOMPLETE;
   }
   if (couldRedecodeForBetterFrame) {
-    return ImgDrawResult::WRONG_SIZE;
+    return DrawResult::WRONG_SIZE;
   }
-  return ImgDrawResult::SUCCESS;
+  return DrawResult::SUCCESS;
 }
 
 //******************************************************************************
-NS_IMETHODIMP_(ImgDrawResult)
+NS_IMETHODIMP_(DrawResult)
 RasterImage::Draw(gfxContext* aContext,
                   const IntSize& aSize,
                   const ImageRegion& aRegion,
                   uint32_t aWhichFrame,
                   SamplingFilter aSamplingFilter,
                   const Maybe<SVGImageContext>& /*aSVGContext - ignored*/,
                   uint32_t aFlags,
                   float aOpacity)
 {
   if (aWhichFrame > FRAME_MAX_VALUE) {
-    return ImgDrawResult::BAD_ARGS;
+    return DrawResult::BAD_ARGS;
   }
 
   if (mError) {
-    return ImgDrawResult::BAD_IMAGE;
+    return DrawResult::BAD_IMAGE;
   }
 
   // Illegal -- you can't draw with non-default decode flags.
   // (Disabling colorspace conversion might make sense to allow, but
   // we don't currently.)
   if (ToSurfaceFlags(aFlags) != DefaultSurfaceFlags()) {
-    return ImgDrawResult::BAD_ARGS;
+    return DrawResult::BAD_ARGS;
   }
 
   if (!aContext) {
-    return ImgDrawResult::BAD_ARGS;
+    return DrawResult::BAD_ARGS;
   }
 
   if (mAnimationConsumers == 0) {
     SendOnUnlockedDraw(aFlags);
   }
 
 
   // If we're not using SamplingFilter::GOOD, we shouldn't high-quality scale or
@@ -1462,17 +1462,17 @@ RasterImage::Draw(gfxContext* aContext,
 
   LookupResult result =
     LookupFrame(aSize, flags, ToPlaybackType(aWhichFrame));
   if (!result) {
     // Getting the frame (above) touches the image and kicks off decoding.
     if (mDrawStartTime.IsNull()) {
       mDrawStartTime = TimeStamp::Now();
     }
-    return ImgDrawResult::NOT_READY;
+    return DrawResult::NOT_READY;
   }
 
   bool shouldRecordTelemetry = !mDrawStartTime.IsNull() &&
                                result.Surface()->IsFinished();
 
   auto drawResult = DrawInternal(Move(result.Surface()), aContext, aSize,
                                  aRegion, aSamplingFilter, flags, aOpacity);
 
--- a/image/RasterImage.h
+++ b/image/RasterImage.h
@@ -294,25 +294,25 @@ private:
                            uint32_t aFlags,
                            PlaybackType aPlaybackType);
 
   /// Helper method for LookupFrame().
   LookupResult LookupFrameInternal(const gfx::IntSize& aSize,
                                    uint32_t aFlags,
                                    PlaybackType aPlaybackType);
 
-  ImgDrawResult DrawInternal(DrawableSurface&& aFrameRef,
+  DrawResult DrawInternal(DrawableSurface&& aFrameRef,
                           gfxContext* aContext,
                           const nsIntSize& aSize,
                           const ImageRegion& aRegion,
                           gfx::SamplingFilter aSamplingFilter,
                           uint32_t aFlags,
                           float aOpacity);
 
-  Tuple<ImgDrawResult, gfx::IntSize, RefPtr<gfx::SourceSurface>>
+  Tuple<DrawResult, gfx::IntSize, RefPtr<gfx::SourceSurface>>
     GetFrameInternal(const gfx::IntSize& aSize,
                      const Maybe<SVGImageContext>& aSVGContext,
                      uint32_t aWhichFrame,
                      uint32_t aFlags) override;
 
   gfx::IntSize GetImageContainerSize(layers::LayerManager* aManager,
                                      const gfx::IntSize& aSize,
                                      uint32_t aFlags) override;
--- a/image/VectorImage.cpp
+++ b/image/VectorImage.cpp
@@ -779,48 +779,48 @@ VectorImage::GetFrameAtSize(const IntSiz
   RefPtr<SourceSurface> surf = Get<2>(result).forget();
 
   // If we are here, it suggests the image is embedded in a canvas or some
   // other path besides layers, and we won't need the file handle.
   MarkSurfaceShared(surf);
   return surf.forget();
 }
 
-Tuple<ImgDrawResult, IntSize, RefPtr<SourceSurface>>
+Tuple<DrawResult, IntSize, RefPtr<SourceSurface>>
 VectorImage::GetFrameInternal(const IntSize& aSize,
                               const Maybe<SVGImageContext>& aSVGContext,
                               uint32_t aWhichFrame,
                               uint32_t aFlags)
 {
   MOZ_ASSERT(aWhichFrame <= FRAME_MAX_VALUE);
 
   if (aSize.IsEmpty() || aWhichFrame > FRAME_MAX_VALUE) {
-    return MakeTuple(ImgDrawResult::BAD_ARGS, aSize,
+    return MakeTuple(DrawResult::BAD_ARGS, aSize,
                      RefPtr<SourceSurface>());
   }
 
   if (mError) {
-    return MakeTuple(ImgDrawResult::BAD_IMAGE, aSize,
+    return MakeTuple(DrawResult::BAD_IMAGE, aSize,
                      RefPtr<SourceSurface>());
   }
 
   if (!mIsFullyLoaded) {
-    return MakeTuple(ImgDrawResult::NOT_READY, aSize,
+    return MakeTuple(DrawResult::NOT_READY, aSize,
                      RefPtr<SourceSurface>());
   }
 
   RefPtr<SourceSurface> sourceSurface =
     LookupCachedSurface(aSize, aSVGContext, aFlags);
   if (sourceSurface) {
-    return MakeTuple(ImgDrawResult::SUCCESS, aSize, Move(sourceSurface));
+    return MakeTuple(DrawResult::SUCCESS, aSize, Move(sourceSurface));
   }
 
   if (mIsDrawing) {
     NS_WARNING("Refusing to make re-entrant call to VectorImage::Draw");
-    return MakeTuple(ImgDrawResult::TEMPORARY_ERROR, aSize,
+    return MakeTuple(DrawResult::TEMPORARY_ERROR, aSize,
                      RefPtr<SourceSurface>());
   }
 
   // By using a null gfxContext, we ensure that we will always attempt to
   // create a surface, even if we aren't capable of caching it (e.g. due to our
   // flags, having an animation, etc). Otherwise CreateSurface will assume that
   // the caller is capable of drawing directly to its own draw target if we
   // cannot cache.
@@ -835,22 +835,22 @@ VectorImage::GetFrameInternal(const IntS
   AutoRestoreSVGState autoRestore(params, mSVGDocumentWrapper,
                                   mIsDrawing, contextPaint);
 
   RefPtr<gfxDrawable> svgDrawable = CreateSVGDrawable(params);
   RefPtr<SourceSurface> surface =
     CreateSurface(params, svgDrawable, didCache);
   if (!surface) {
     MOZ_ASSERT(!didCache);
-    return MakeTuple(ImgDrawResult::TEMPORARY_ERROR, aSize,
+    return MakeTuple(DrawResult::TEMPORARY_ERROR, aSize,
                      RefPtr<SourceSurface>());
   }
 
   SendFrameComplete(didCache, params.flags);
-  return MakeTuple(ImgDrawResult::SUCCESS, aSize, Move(surface));
+  return MakeTuple(DrawResult::SUCCESS, aSize, Move(surface));
 }
 
 //******************************************************************************
 IntSize
 VectorImage::GetImageContainerSize(LayerManager* aManager,
                                    const IntSize& aSize,
                                    uint32_t aFlags)
 {
@@ -950,40 +950,40 @@ VectorImage::MaybeRestrictSVGContext(May
       aNewSVGContext->ClearContextPaint();
     }
   }
 
   return haveContextPaint && !blockContextPaint;
 }
 
 //******************************************************************************
-NS_IMETHODIMP_(ImgDrawResult)
+NS_IMETHODIMP_(DrawResult)
 VectorImage::Draw(gfxContext* aContext,
                   const nsIntSize& aSize,
                   const ImageRegion& aRegion,
                   uint32_t aWhichFrame,
                   SamplingFilter aSamplingFilter,
                   const Maybe<SVGImageContext>& aSVGContext,
                   uint32_t aFlags,
                   float aOpacity)
 {
   if (aWhichFrame > FRAME_MAX_VALUE) {
-    return ImgDrawResult::BAD_ARGS;
+    return DrawResult::BAD_ARGS;
   }
 
   if (!aContext) {
-    return ImgDrawResult::BAD_ARGS;
+    return DrawResult::BAD_ARGS;
   }
 
   if (mError) {
-    return ImgDrawResult::BAD_IMAGE;
+    return DrawResult::BAD_IMAGE;
   }
 
   if (!mIsFullyLoaded) {
-    return ImgDrawResult::NOT_READY;
+    return DrawResult::NOT_READY;
   }
 
   if (mAnimationConsumers == 0) {
     SendOnUnlockedDraw(aFlags);
   }
 
   // We should always bypass the cache when using DrawTargetRecording because
   // we prefer the drawing commands in general to the rasterized surface. This
@@ -1011,47 +1011,47 @@ VectorImage::Draw(gfxContext* aContext,
   // If we have an prerasterized version of this image that matches the
   // drawing parameters, use that.
   RefPtr<SourceSurface> sourceSurface =
     LookupCachedSurface(aSize, params.svgContext, aFlags);
   if (sourceSurface) {
     RefPtr<gfxDrawable> svgDrawable =
       new gfxSurfaceDrawable(sourceSurface, sourceSurface->GetSize());
     Show(svgDrawable, params);
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   // else, we need to paint the image:
 
   if (mIsDrawing) {
     NS_WARNING("Refusing to make re-entrant call to VectorImage::Draw");
-    return ImgDrawResult::TEMPORARY_ERROR;
+    return DrawResult::TEMPORARY_ERROR;
   }
 
   AutoRestoreSVGState autoRestore(params, mSVGDocumentWrapper,
                                   mIsDrawing, contextPaint);
 
   bool didCache; // Was the surface put into the cache?
   RefPtr<gfxDrawable> svgDrawable = CreateSVGDrawable(params);
   sourceSurface = CreateSurface(params, svgDrawable, didCache);
   if (!sourceSurface) {
     MOZ_ASSERT(!didCache);
     Show(svgDrawable, params);
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   RefPtr<gfxDrawable> drawable =
     new gfxSurfaceDrawable(sourceSurface, params.size);
   Show(drawable, params);
   SendFrameComplete(didCache, params.flags);
 
   // Image got put into a painted layer, it will not be shared with another
   // process.
   MarkSurfaceShared(sourceSurface);
-  return ImgDrawResult::SUCCESS;
+  return DrawResult::SUCCESS;
 }
 
 already_AddRefed<gfxDrawable>
 VectorImage::CreateSVGDrawable(const SVGDrawingParameters& aParams)
 {
   RefPtr<gfxDrawingCallback> cb =
     new SVGDrawingCallback(mSVGDocumentWrapper,
                            aParams.viewportSize,
--- a/image/VectorImage.h
+++ b/image/VectorImage.h
@@ -76,17 +76,17 @@ protected:
   explicit VectorImage(ImageURL* aURI = nullptr);
   virtual ~VectorImage();
 
   virtual nsresult StartAnimation() override;
   virtual nsresult StopAnimation() override;
   virtual bool     ShouldAnimate() override;
 
 private:
-  Tuple<ImgDrawResult, IntSize, RefPtr<SourceSurface>>
+  Tuple<DrawResult, IntSize, RefPtr<SourceSurface>>
     GetFrameInternal(const IntSize& aSize,
                      const Maybe<SVGImageContext>& aSVGContext,
                      uint32_t aWhichFrame,
                      uint32_t aFlags) override;
 
   IntSize GetImageContainerSize(layers::LayerManager* aManager,
                                 const IntSize& aSize,
                                 uint32_t aFlags) override;
--- a/image/imgIContainer.idl
+++ b/image/imgIContainer.idl
@@ -2,17 +2,17 @@
  *
  * This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "nsISupports.idl"
 
 %{C++
-#include "ImgDrawResult.h"
+#include "DrawResult.h"
 #include "gfxContext.h"
 #include "gfxMatrix.h"
 #include "gfxRect.h"
 #include "mozilla/gfx/2D.h"
 #include "mozilla/Maybe.h"
 #include "mozilla/RefPtr.h"
 #include "nsRect.h"
 #include "nsSize.h"
@@ -40,17 +40,17 @@ namespace image {
 class ImageRegion;
 struct Orientation;
 
 }
 }
 
 %}
 
-native ImgDrawResult(mozilla::image::ImgDrawResult);
+native DrawResult(mozilla::image::DrawResult);
 [ptr] native gfxContext(gfxContext);
 [ref] native gfxMatrix(gfxMatrix);
 [ref] native gfxRect(gfxRect);
 [ref] native gfxSize(gfxSize);
 native SamplingFilter(mozilla::gfx::SamplingFilter);
 [ref] native nsIntRect(nsIntRect);
 native nsIntRectByVal(nsIntRect);
 [ref] native nsIntSize(nsIntSize);
@@ -427,20 +427,20 @@ interface imgIContainer : nsISupports
    *                snapping.
    * @param aWhichFrame Frame specifier of the FRAME_* variety.
    * @param aSamplingFilter The filter to be used if we're scaling the image.
    * @param aSVGContext If specified, SVG-related rendering context, such as
    *                    overridden attributes on the image document's root <svg>
    *                    node, and the size of the viewport that the full image
    *                    would occupy. Ignored for raster images.
    * @param aFlags Flags of the FLAG_* variety
-   * @return A ImgDrawResult value indicating whether and to what degree the
+   * @return A DrawResult value indicating whether and to what degree the
    *         drawing operation was successful.
    */
-  [noscript, notxpcom] ImgDrawResult
+  [noscript, notxpcom] DrawResult
   draw(in gfxContext aContext,
        [const] in nsIntSize aSize,
        [const] in ImageRegion aRegion,
        in uint32_t aWhichFrame,
        in SamplingFilter aSamplingFilter,
        [const] in MaybeSVGImageContext aSVGContext,
        in uint32_t aFlags,
        in float aOpacity);
--- a/image/moz.build
+++ b/image/moz.build
@@ -33,23 +33,23 @@ XPIDL_SOURCES += [
     'imgIScriptedNotificationObserver.idl',
     'imgITools.idl',
     'nsIIconURI.idl',
 ]
 
 XPIDL_MODULE = 'imglib2'
 
 EXPORTS += [
+    'DrawResult.h',
     'FrameTimeout.h',
     'ImageCacheKey.h',
     'ImageLogging.h',
     'ImageMetadata.h',
     'ImageOps.h',
     'ImageRegion.h',
-    'ImgDrawResult.h',
     'imgLoader.h',
     'imgRequest.h',
     'imgRequestProxy.h',
     'IProgressObserver.h',
     'Orientation.h',
     'SurfaceCacheUtils.h',
 ]
 
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -6925,31 +6925,31 @@ ComputeSnappedImageDrawingParameters(gfx
     ImageRegion::CreateWithSamplingRestriction(imageSpaceFill, subimage, extendMode);
 
   return SnappedImageDrawingParameters(transform, intImageSize,
                                        region,
                                        CSSIntSize(svgViewportSize.width,
                                                   svgViewportSize.height));
 }
 
-static ImgDrawResult
+static DrawResult
 DrawImageInternal(gfxContext&            aContext,
                   nsPresContext*         aPresContext,
                   imgIContainer*         aImage,
                   const SamplingFilter   aSamplingFilter,
                   const nsRect&          aDest,
                   const nsRect&          aFill,
                   const nsPoint&         aAnchor,
                   const nsRect&          aDirty,
                   const Maybe<SVGImageContext>& aSVGContext,
                   uint32_t               aImageFlags,
                   ExtendMode             aExtendMode = ExtendMode::CLAMP,
                   float                  aOpacity = 1.0)
 {
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
 
   aImageFlags |= imgIContainer::FLAG_ASYNC_NOTIFY;
 
   if (aPresContext->Type() == nsPresContext::eContext_Print) {
     // We want vector images to be passed on as vector commands, not a raster
     // image.
     aImageFlags |= imgIContainer::FLAG_BYPASS_SURFACE_CACHE;
   }
@@ -6984,32 +6984,32 @@ DrawImageInternal(gfxContext&           
                           aSVGContext ? aSVGContext : fallbackContext,
                           aImageFlags, aOpacity);
 
   }
 
   return result;
 }
 
-/* static */ ImgDrawResult
+/* static */ DrawResult
 nsLayoutUtils::DrawSingleUnscaledImage(gfxContext&          aContext,
                                        nsPresContext*       aPresContext,
                                        imgIContainer*       aImage,
                                        const SamplingFilter aSamplingFilter,
                                        const nsPoint&       aDest,
                                        const nsRect*        aDirty,
                                        uint32_t             aImageFlags,
                                        const nsRect*        aSourceArea)
 {
   CSSIntSize imageSize;
   aImage->GetWidth(&imageSize.width);
   aImage->GetHeight(&imageSize.height);
   if (imageSize.width < 1 || imageSize.height < 1) {
     NS_WARNING("Image width or height is non-positive");
-    return ImgDrawResult::TEMPORARY_ERROR;
+    return DrawResult::TEMPORARY_ERROR;
   }
 
   nsSize size(CSSPixel::ToAppUnits(imageSize));
   nsRect source;
   if (aSourceArea) {
     source = *aSourceArea;
   } else {
     source.SizeTo(size);
@@ -7022,34 +7022,34 @@ nsLayoutUtils::DrawSingleUnscaledImage(g
   // translation but we don't want to actually tile the image.
   fill.IntersectRect(fill, dest);
   return DrawImageInternal(aContext, aPresContext,
                            aImage, aSamplingFilter,
                            dest, fill, aDest, aDirty ? *aDirty : dest,
                            /* no SVGImageContext */ Nothing(), aImageFlags);
 }
 
-/* static */ ImgDrawResult
+/* static */ DrawResult
 nsLayoutUtils::DrawSingleImage(gfxContext&            aContext,
                                nsPresContext*         aPresContext,
                                imgIContainer*         aImage,
                                const SamplingFilter   aSamplingFilter,
                                const nsRect&          aDest,
                                const nsRect&          aDirty,
                                const Maybe<SVGImageContext>& aSVGContext,
                                uint32_t               aImageFlags,
                                const nsPoint*         aAnchorPoint,
                                const nsRect*          aSourceArea)
 {
   nscoord appUnitsPerCSSPixel = nsDeviceContext::AppUnitsPerCSSPixel();
   CSSIntSize pixelImageSize(ComputeSizeForDrawingWithFallback(aImage, aDest.Size()));
   if (pixelImageSize.width < 1 || pixelImageSize.height < 1) {
     NS_ASSERTION(pixelImageSize.width >= 0 && pixelImageSize.height >= 0,
                  "Image width or height is negative");
-    return ImgDrawResult::SUCCESS;  // no point in drawing a zero size image
+    return DrawResult::SUCCESS;  // no point in drawing a zero size image
   }
 
   nsSize imageSize(CSSPixel::ToAppUnits(pixelImageSize));
   nsRect source;
   nsCOMPtr<imgIContainer> image;
   if (aSourceArea) {
     source = *aSourceArea;
     nsIntRect subRect(source.x, source.y, source.width, source.height);
@@ -7229,17 +7229,17 @@ nsLayoutUtils::GetBackgroundFirstTilePos
                                          const nsPoint& aFill,
                                          const nsSize& aRepeatSize)
 {
   return nsPoint(NSToIntFloor(float(aFill.x - aDest.x) / aRepeatSize.width) * aRepeatSize.width,
                  NSToIntFloor(float(aFill.y - aDest.y) / aRepeatSize.height) * aRepeatSize.height) +
          aDest;
 }
 
-/* static */ ImgDrawResult
+/* static */ DrawResult
 nsLayoutUtils::DrawBackgroundImage(gfxContext&         aContext,
                                    nsIFrame*           aForFrame,
                                    nsPresContext*      aPresContext,
                                    imgIContainer*      aImage,
                                    const CSSIntSize&   aImageSize,
                                    SamplingFilter      aSamplingFilter,
                                    const nsRect&       aDest,
                                    const nsRect&       aFill,
@@ -7262,30 +7262,30 @@ nsLayoutUtils::DrawBackgroundImage(gfxCo
                              aDirty, svgContext, aImageFlags, aExtendMode,
                              aOpacity);
   }
 
   nsPoint firstTilePos = GetBackgroundFirstTilePos(aDest.TopLeft(), aFill.TopLeft(), aRepeatSize);
   for (int32_t i = firstTilePos.x; i < aFill.XMost(); i += aRepeatSize.width) {
     for (int32_t j = firstTilePos.y; j < aFill.YMost(); j += aRepeatSize.height) {
       nsRect dest(i, j, aDest.width, aDest.height);
-      ImgDrawResult result = DrawImageInternal(aContext, aPresContext, aImage, aSamplingFilter,
+      DrawResult result = DrawImageInternal(aContext, aPresContext, aImage, aSamplingFilter,
                                             dest, dest, aAnchor, aDirty, svgContext,
                                             aImageFlags, ExtendMode::CLAMP,
                                             aOpacity);
-      if (result != ImgDrawResult::SUCCESS) {
+      if (result != DrawResult::SUCCESS) {
         return result;
       }
     }
   }
 
-  return ImgDrawResult::SUCCESS;
-}
-
-/* static */ ImgDrawResult
+  return DrawResult::SUCCESS;
+}
+
+/* static */ DrawResult
 nsLayoutUtils::DrawImage(gfxContext&         aContext,
                          nsStyleContext*     aStyleContext,
                          nsPresContext*      aPresContext,
                          imgIContainer*      aImage,
                          const SamplingFilter aSamplingFilter,
                          const nsRect&       aDest,
                          const nsRect&       aFill,
                          const nsPoint&      aAnchor,
--- a/layout/base/nsLayoutUtils.h
+++ b/layout/base/nsLayoutUtils.h
@@ -151,17 +151,17 @@ class nsLayoutUtils
   typedef mozilla::gfx::Float Float;
   typedef mozilla::gfx::Point Point;
   typedef mozilla::gfx::Rect Rect;
   typedef mozilla::gfx::RectDouble RectDouble;
   typedef mozilla::gfx::Size Size;
   typedef mozilla::gfx::Matrix4x4 Matrix4x4;
   typedef mozilla::gfx::RectCornerRadii RectCornerRadii;
   typedef mozilla::gfx::StrokeOptions StrokeOptions;
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
 
 public:
   typedef mozilla::layers::FrameMetrics FrameMetrics;
   typedef mozilla::layers::ScrollMetadata ScrollMetadata;
   typedef FrameMetrics::ViewID ViewID;
   typedef mozilla::CSSPoint CSSPoint;
   typedef mozilla::CSSSize CSSSize;
   typedef mozilla::CSSIntSize CSSIntSize;
@@ -1801,17 +1801,17 @@ public:
    *                            repeats of the image. Sizes larger than aDest.Size()
    *                            create gaps between the images.
    *   @param aAnchor           A point in aFill which we will ensure is
    *                            pixel-aligned in the output.
    *   @param aDirty            Pixels outside this area may be skipped.
    *   @param aImageFlags       Image flags of the imgIContainer::FLAG_* variety.
    *   @param aExtendMode       How to extend the image over the dest rect.
    */
-  static ImgDrawResult DrawBackgroundImage(gfxContext&         aContext,
+  static DrawResult DrawBackgroundImage(gfxContext&         aContext,
                                         nsIFrame*           aForFrame,
                                         nsPresContext*      aPresContext,
                                         imgIContainer*      aImage,
                                         const CSSIntSize&   aImageSize,
                                         SamplingFilter      aSamplingFilter,
                                         const nsRect&       aDest,
                                         const nsRect&       aFill,
                                         const nsSize&       aRepeatSize,
@@ -1834,17 +1834,17 @@ public:
    *   @param aDest             Where one copy of the image should mapped to.
    *   @param aFill             The area to be filled with copies of the
    *                            image.
    *   @param aAnchor           A point in aFill which we will ensure is
    *                            pixel-aligned in the output.
    *   @param aDirty            Pixels outside this area may be skipped.
    *   @param aImageFlags       Image flags of the imgIContainer::FLAG_* variety
    */
-  static ImgDrawResult DrawImage(gfxContext&         aContext,
+  static DrawResult DrawImage(gfxContext&         aContext,
                               nsStyleContext*     aStyleContext,
                               nsPresContext*      aPresContext,
                               imgIContainer*      aImage,
                               const SamplingFilter aSamplingFilter,
                               const nsRect&       aDest,
                               const nsRect&       aFill,
                               const nsPoint&      aAnchor,
                               const nsRect&       aDirty,
@@ -1862,17 +1862,17 @@ public:
    *   @param aDirty            If non-null, then pixels outside this area may
    *                            be skipped.
    *   @param aImageFlags       Image flags of the imgIContainer::FLAG_* variety
    *   @param aSourceArea       If non-null, this area is extracted from
    *                            the image and drawn at aDest. It's
    *                            in appunits. For best results it should
    *                            be aligned with image pixels.
    */
-  static ImgDrawResult DrawSingleUnscaledImage(gfxContext&          aContext,
+  static DrawResult DrawSingleUnscaledImage(gfxContext&          aContext,
                                             nsPresContext*       aPresContext,
                                             imgIContainer*       aImage,
                                             const SamplingFilter aSamplingFilter,
                                             const nsPoint&       aDest,
                                             const nsRect*        aDirty,
                                             uint32_t             aImageFlags,
                                             const nsRect*        aSourceArea = nullptr);
 
@@ -1897,17 +1897,17 @@ public:
    *                            variety.
    *   @param aAnchor           If non-null, a point which we will ensure
    *                            is pixel-aligned in the output.
    *   @param aSourceArea       If non-null, this area is extracted from
    *                            the image and drawn in aDest. It's
    *                            in appunits. For best results it should
    *                            be aligned with image pixels.
    */
-  static ImgDrawResult DrawSingleImage(gfxContext&         aContext,
+  static DrawResult DrawSingleImage(gfxContext&         aContext,
                                     nsPresContext*      aPresContext,
                                     imgIContainer*      aImage,
                                     const SamplingFilter aSamplingFilter,
                                     const nsRect&       aDest,
                                     const nsRect&       aDirty,
                                     const mozilla::Maybe<SVGImageContext>& aSVGContext,
                                     uint32_t            aImageFlags,
                                     const nsPoint*      aAnchorPoint = nullptr,
--- a/layout/forms/nsButtonFrameRenderer.cpp
+++ b/layout/forms/nsButtonFrameRenderer.cpp
@@ -351,17 +351,17 @@ void
 nsDisplayButtonBorder::Paint(nsDisplayListBuilder* aBuilder,
                              gfxContext* aCtx)
 {
   NS_ASSERTION(mFrame, "No frame?");
   nsPresContext* pc = mFrame->PresContext();
   nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize());
 
   // draw the border and background inside the focus and outline borders
-  ImgDrawResult result =
+  DrawResult result =
     mBFR->PaintBorder(aBuilder, pc, *aCtx, mVisibleRect, r);
 
   nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
 }
 
 nsRect
 nsDisplayButtonBorder::GetBounds(nsDisplayListBuilder* aBuilder,
                                  bool* aSnap) const
@@ -431,17 +431,17 @@ void nsDisplayButtonForeground::Paint(ns
 {
   nsPresContext *presContext = mFrame->PresContext();
   const nsStyleDisplay *disp = mFrame->StyleDisplay();
   if (!mFrame->IsThemed(disp) ||
       !presContext->GetTheme()->ThemeDrawsFocusForWidget(disp->mAppearance)) {
     nsRect r = nsRect(ToReferenceFrame(), mFrame->GetSize());
 
     // Draw the -moz-focus-inner border
-    ImgDrawResult result =
+    DrawResult result =
       mBFR->PaintInnerFocusBorder(aBuilder, presContext, *aCtx, mVisibleRect, r);
 
     nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
   }
 }
 
 already_AddRefed<mozilla::layers::Layer>
 nsDisplayButtonForeground::BuildLayer(nsDisplayListBuilder* aBuilder,
@@ -518,34 +518,34 @@ nsButtonFrameRenderer::GetButtonInnerFoc
 
   nsMargin innerFocusPadding(0,0,0,0);
   if (mInnerFocusStyle) {
     mInnerFocusStyle->StylePadding()->GetPadding(innerFocusPadding);
   }
   aResult.Inflate(innerFocusPadding);
 }
 
-ImgDrawResult
+DrawResult
 nsButtonFrameRenderer::PaintInnerFocusBorder(
   nsDisplayListBuilder* aBuilder,
   nsPresContext* aPresContext,
   gfxContext& aRenderingContext,
   const nsRect& aDirtyRect,
   const nsRect& aRect)
 {
   // we draw the -moz-focus-inner border just inside the button's
   // normal border and padding, to match Windows themes.
 
   nsRect rect;
 
   PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
                          ? PaintBorderFlags::SYNC_DECODE_IMAGES
                          : PaintBorderFlags();
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
 
   if (mInnerFocusStyle) {
     GetButtonInnerFocusRect(aRect, rect);
 
     result &=
       nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame,
                                   aDirtyRect, rect, mInnerFocusStyle, flags);
   }
@@ -574,17 +574,17 @@ nsButtonFrameRenderer::CreateInnerFocusB
                                                 rect,
                                                 mInnerFocusStyle,
                                                 aBorderIsEmpty);
   }
 
   return Nothing();
 }
 
-ImgDrawResult
+DrawResult
 nsButtonFrameRenderer::PaintBorder(
   nsDisplayListBuilder* aBuilder,
   nsPresContext* aPresContext,
   gfxContext& aRenderingContext,
   const nsRect& aDirtyRect,
   const nsRect& aRect)
 {
   // get the button rect this is inside the focus and outline rects
@@ -593,17 +593,17 @@ nsButtonFrameRenderer::PaintBorder(
 
   PaintBorderFlags borderFlags = aBuilder->ShouldSyncDecodeImages()
                                ? PaintBorderFlags::SYNC_DECODE_IMAGES
                                : PaintBorderFlags();
 
   nsCSSRendering::PaintBoxShadowInner(aPresContext, aRenderingContext,
                                       mFrame, buttonRect);
 
-  ImgDrawResult result =
+  DrawResult result =
     nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame,
                                 aDirtyRect, buttonRect, context, borderFlags);
 
   return result;
 }
 
 /**
  * Call this when styles change
--- a/layout/forms/nsButtonFrameRenderer.h
+++ b/layout/forms/nsButtonFrameRenderer.h
@@ -20,44 +20,44 @@ class nsPresContext;
 struct nsRect;
 class nsStyleContext;
 
 
 #define NS_BUTTON_RENDERER_FOCUS_INNER_CONTEXT_INDEX  0
 #define NS_BUTTON_RENDERER_LAST_CONTEXT_INDEX   NS_BUTTON_RENDERER_FOCUS_INNER_CONTEXT_INDEX
 
 class nsButtonFrameRenderer {
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
 
 public:
 
   nsButtonFrameRenderer();
   ~nsButtonFrameRenderer();
 
   /**
    * Create display list items for the button
    */
   nsresult DisplayButton(nsDisplayListBuilder* aBuilder,
                          nsDisplayList* aBackground, nsDisplayList* aForeground);
 
 
-  ImgDrawResult PaintInnerFocusBorder(nsDisplayListBuilder* aBuilder,
+  DrawResult PaintInnerFocusBorder(nsDisplayListBuilder* aBuilder,
                                    nsPresContext* aPresContext,
                                    gfxContext& aRenderingContext,
                                    const nsRect& aDirtyRect,
                                    const nsRect& aRect);
 
   mozilla::Maybe<nsCSSBorderRenderer> CreateInnerFocusBorderRenderer(nsDisplayListBuilder* aBuilder,
                                                                      nsPresContext* aPresContext,
                                                                      gfxContext* aRenderingContext,
                                                                      const nsRect& aDirtyRect,
                                                                      const nsRect& aRect,
                                                                      bool* aBorderIsEmpty);
 
-  ImgDrawResult PaintBorder(nsDisplayListBuilder* aBuilder,
+  DrawResult PaintBorder(nsDisplayListBuilder* aBuilder,
                          nsPresContext* aPresContext,
                          gfxContext& aRenderingContext,
                          const nsRect& aDirtyRect,
                          const nsRect& aRect);
 
   void SetFrame(nsFrame* aFrame, nsPresContext* aPresContext);
 
   void SetDisabled(bool aDisabled, bool notify);
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -106,17 +106,17 @@ public:
                            bool* aSnap) const override;
   NS_DISPLAY_DECL_NAME("FieldSetBorder", TYPE_FIELDSET_BORDER_BACKGROUND)
 };
 
 void
 nsDisplayFieldSetBorder::Paint(nsDisplayListBuilder* aBuilder,
                                gfxContext* aCtx)
 {
-  image::ImgDrawResult result = static_cast<nsFieldSetFrame*>(mFrame)->
+  image::DrawResult result = static_cast<nsFieldSetFrame*>(mFrame)->
     PaintBorder(aBuilder, *aCtx, ToReferenceFrame(), mVisibleRect);
 
   nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
 }
 
 nsDisplayItemGeometry*
 nsDisplayFieldSetBorder::AllocateGeometry(nsDisplayListBuilder* aBuilder)
 {
@@ -235,17 +235,17 @@ nsFieldSetFrame::BuildDisplayList(nsDisp
   }
   // Put the inner frame's display items on the master list. Note that this
   // moves its border/background display items to our BorderBackground() list,
   // which isn't really correct, but it's OK because the inner frame is
   // anonymous and can't have its own border and background.
   contentDisplayItems.MoveTo(aLists);
 }
 
-image::ImgDrawResult
+image::DrawResult
 nsFieldSetFrame::PaintBorder(
   nsDisplayListBuilder* aBuilder,
   gfxContext& aRenderingContext,
   nsPoint aPt,
   const nsRect& aDirtyRect)
 {
   // If the border is smaller than the legend, move the border down
   // to be centered on the legend.  We call VisualBorderRectRelativeToSelf() to
@@ -254,17 +254,17 @@ nsFieldSetFrame::PaintBorder(
   // override nsIFrame::GetBorderRadii.
   nsRect rect = VisualBorderRectRelativeToSelf() + aPt;
   nsPresContext* presContext = PresContext();
 
   PaintBorderFlags borderFlags = aBuilder->ShouldSyncDecodeImages()
                                ? PaintBorderFlags::SYNC_DECODE_IMAGES
                                : PaintBorderFlags();
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
 
   nsCSSRendering::PaintBoxShadowInner(presContext, aRenderingContext,
                                       this, rect);
 
   if (nsIFrame* legend = GetLegend()) {
     // We want to avoid drawing our border under the legend, so clip out the
     // legend while drawing our border.  We don't want to use mLegendRect here,
     // because we do want to draw our border under the legend's inline-start and
--- a/layout/forms/nsFieldSetFrame.h
+++ b/layout/forms/nsFieldSetFrame.h
@@ -3,22 +3,22 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef nsFieldSetFrame_h___
 #define nsFieldSetFrame_h___
 
 #include "mozilla/Attributes.h"
-#include "ImgDrawResult.h"
+#include "DrawResult.h"
 #include "nsContainerFrame.h"
 
 class nsFieldSetFrame final : public nsContainerFrame
 {
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
 
 public:
   NS_DECL_FRAMEARENA_HELPERS(nsFieldSetFrame)
 
   explicit nsFieldSetFrame(nsStyleContext* aContext);
 
   nscoord
     GetIntrinsicISize(gfxContext* aRenderingContext,
@@ -42,17 +42,17 @@ public:
                                 nscoord* aBaseline) const override;
   bool GetNaturalBaselineBOffset(mozilla::WritingMode aWM,
                                  BaselineSharingGroup aBaselineGroup,
                                  nscoord* aBaseline) const override;
 
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsDisplayListSet& aLists) override;
 
-  ImgDrawResult PaintBorder(nsDisplayListBuilder* aBuilder,
+  DrawResult PaintBorder(nsDisplayListBuilder* aBuilder,
                          gfxContext& aRenderingContext,
                          nsPoint aPt, const nsRect& aDirtyRect);
 
 #ifdef DEBUG
   virtual void SetInitialChildList(ChildListID    aListID,
                                    nsFrameList&   aChildList) override;
   virtual void AppendFrames(ChildListID    aListID,
                             nsFrameList&   aFrameList) override;
--- a/layout/forms/nsRangeFrame.cpp
+++ b/layout/forms/nsRangeFrame.cpp
@@ -241,17 +241,17 @@ nsDisplayRangeFocusRing::Paint(nsDisplay
   nsStyleContext* styleContext =
     static_cast<nsRangeFrame*>(mFrame)->mOuterFocusStyle;
   MOZ_ASSERT(styleContext, "We only exist if mOuterFocusStyle is non-null");
 
   PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
                          ? PaintBorderFlags::SYNC_DECODE_IMAGES
                          : PaintBorderFlags();
 
-  ImgDrawResult result =
+  DrawResult result =
     nsCSSRendering::PaintBorder(mFrame->PresContext(), *aCtx, mFrame,
                                 mVisibleRect, GetBounds(aBuilder, &unused),
                                 styleContext, flags);
 
   nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
 }
 
 void
--- a/layout/generic/nsBulletFrame.cpp
+++ b/layout/generic/nsBulletFrame.cpp
@@ -241,17 +241,17 @@ public:
   bool
   CreateWebRenderCommands(nsDisplayItem* aItem,
                           wr::DisplayListBuilder& aBuilder,
                           wr::IpcResourceUpdateQueue& aResources,
                           const layers::StackingContextHelper& aSc,
                           mozilla::layers::WebRenderLayerManager* aManager,
                           nsDisplayListBuilder* aDisplayListBuilder);
 
-  ImgDrawResult
+  DrawResult
   Paint(gfxContext& aRenderingContext, nsPoint aPt,
         const nsRect& aDirtyRect, uint32_t aFlags,
         bool aDisableSubpixelAA, nsIFrame* aFrame);
 
   bool
   IsImageType() const
   {
     return mListStyleType == NS_STYLE_LIST_STYLE_NONE && mImage;
@@ -365,17 +365,17 @@ BulletRenderer::CreateWebRenderCommands(
                                    aSc, aManager, aDisplayListBuilder);
   } else {
     MOZ_ASSERT(IsTextType());
     return CreateWebRenderCommandsForText(aItem, aBuilder, aResources, aSc,
                                           aManager, aDisplayListBuilder);
   }
 }
 
-ImgDrawResult
+DrawResult
 BulletRenderer::Paint(gfxContext& aRenderingContext, nsPoint aPt,
                       const nsRect& aDirtyRect, uint32_t aFlags,
                       bool aDisableSubpixelAA, nsIFrame* aFrame)
 {
   if (IsImageType()) {
     SamplingFilter filter = nsLayoutUtils::GetSamplingFilterForFrame(aFrame);
     return nsLayoutUtils::DrawSingleImage(aRenderingContext,
                                           aFrame->PresContext(), mImage, filter,
@@ -417,17 +417,17 @@ BulletRenderer::Paint(gfxContext& aRende
       MOZ_CRASH("unreachable");
     }
   }
 
   if (IsTextType()) {
     PaintTextToContext(aFrame, &aRenderingContext, aDisableSubpixelAA);
   }
 
-  return ImgDrawResult::SUCCESS;
+  return DrawResult::SUCCESS;
 }
 
 bool
 BulletRenderer::BuildGlyphForText(nsDisplayItem* aItem, bool disableSubpixelAA)
 {
   MOZ_ASSERT(IsTextType());
 
   RefPtr<DrawTarget> screenTarget = gfxPlatform::GetPlatform()->ScreenReferenceDrawTarget();
@@ -765,17 +765,17 @@ nsDisplayBullet::CreateWebRenderCommands
 void nsDisplayBullet::Paint(nsDisplayListBuilder* aBuilder,
                             gfxContext* aCtx)
 {
   uint32_t flags = imgIContainer::FLAG_NONE;
   if (aBuilder->ShouldSyncDecodeImages()) {
     flags |= imgIContainer::FLAG_SYNC_DECODE;
   }
 
-  ImgDrawResult result = static_cast<nsBulletFrame*>(mFrame)->
+  DrawResult result = static_cast<nsBulletFrame*>(mFrame)->
     PaintBullet(*aCtx, ToReferenceFrame(), mVisibleRect, flags,
                 mDisableSubpixelAA);
 
   nsDisplayBulletGeometry::UpdateDrawResult(this, result);
 }
 
 void
 nsBulletFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
@@ -934,25 +934,25 @@ nsBulletFrame::CreateBulletRenderer(gfxC
       return Some(br);
     }
   }
 
   MOZ_CRASH("unreachable");
   return Nothing();
 }
 
-ImgDrawResult
+DrawResult
 nsBulletFrame::PaintBullet(gfxContext& aRenderingContext, nsPoint aPt,
                            const nsRect& aDirtyRect, uint32_t aFlags,
                            bool aDisableSubpixelAA)
 {
   Maybe<BulletRenderer> br = CreateBulletRenderer(aRenderingContext, aPt);
 
   if (!br) {
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   return br->Paint(aRenderingContext, aPt, aDirtyRect,
                    aFlags, aDisableSubpixelAA, this);
 }
 
 int32_t
 nsBulletFrame::SetListItemOrdinal(int32_t aNextOrdinal,
--- a/layout/generic/nsBulletFrame.h
+++ b/layout/generic/nsBulletFrame.h
@@ -37,17 +37,17 @@ private:
   nsBulletFrame *mFrame;
 };
 
 /**
  * A simple class that manages the layout and rendering of html bullets.
  * This class also supports the CSS list-style properties.
  */
 class nsBulletFrame final : public nsFrame {
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
 
 public:
   NS_DECL_FRAMEARENA_HELPERS(nsBulletFrame)
 #ifdef DEBUG
   NS_DECL_QUERYFRAME
 #endif
 
   explicit nsBulletFrame(nsStyleContext* aContext)
@@ -96,17 +96,17 @@ public:
 
   /* get list item text, with prefix & suffix */
   void GetListItemText(nsAString& aResult);
 
   void GetSpokenText(nsAString& aText);
 
   Maybe<BulletRenderer>
   CreateBulletRenderer(gfxContext& aRenderingContext, nsPoint aPt);
-  ImgDrawResult PaintBullet(gfxContext& aRenderingContext, nsPoint aPt,
+  DrawResult PaintBullet(gfxContext& aRenderingContext, nsPoint aPt,
                          const nsRect& aDirtyRect, uint32_t aFlags,
                          bool aDisableSubpixelAA);
 
   virtual bool IsEmpty() override;
   virtual bool IsSelfEmpty() override;
   virtual nscoord GetLogicalBaseline(mozilla::WritingMode aWritingMode) const override;
 
   float GetFontSizeInflation() const;
--- a/layout/generic/nsColumnSetFrame.cpp
+++ b/layout/generic/nsColumnSetFrame.cpp
@@ -275,17 +275,17 @@ nsColumnSetFrame::CreateBorderRenderers(
     skipSides |= mozilla::eSideBitsTopBottom;
     skipSides |= mozilla::eSideBitsRight;
   }
 
   ForEachColumn([&]
                 (const nsRect& aLineRect)
                 {
                   // Assert that we're not drawing a border-image here; if we were, we
-                  // couldn't ignore the ImgDrawResult that PaintBorderWithStyleBorder returns.
+                  // couldn't ignore the DrawResult that PaintBorderWithStyleBorder returns.
                   MOZ_ASSERT(border.mBorderImageSource.GetType() == eStyleImageType_Null);
 
                   gfx::DrawTarget* dt = aCtx ? aCtx->GetDrawTarget() : nullptr;
                   bool borderIsEmpty = false;
                   Maybe<nsCSSBorderRenderer> br =
                     nsCSSRendering::CreateBorderRendererWithStyleBorder(presContext, dt,
                                                                         this, aDirtyRect,
                                                                         aLineRect, border,
--- a/layout/generic/nsImageFrame.cpp
+++ b/layout/generic/nsImageFrame.cpp
@@ -1337,29 +1337,29 @@ public:
   virtual void Paint(nsDisplayListBuilder* aBuilder,
                      gfxContext* aCtx) override
   {
     // Always sync decode, because these icons are UI, and since they're not
     // discardable we'll pay the price of sync decoding at most once.
     uint32_t flags = imgIContainer::FLAG_SYNC_DECODE;
 
     nsImageFrame* f = static_cast<nsImageFrame*>(mFrame);
-    ImgDrawResult result =
+    DrawResult result =
       f->DisplayAltFeedback(*aCtx,
                             mVisibleRect,
                             ToReferenceFrame(),
                             flags);
 
     nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
   }
 
   NS_DISPLAY_DECL_NAME("AltFeedback", TYPE_ALT_FEEDBACK)
 };
 
-ImgDrawResult
+DrawResult
 nsImageFrame::DisplayAltFeedback(gfxContext& aRenderingContext,
                                  const nsRect& aDirtyRect,
                                  nsPoint aPt,
                                  uint32_t aFlags)
 {
   // We should definitely have a gIconLoad here.
   MOZ_ASSERT(gIconLoad, "How did we succeed in Init then?");
 
@@ -1376,55 +1376,55 @@ nsImageFrame::DisplayAltFeedback(gfxCont
   if (inner.IsEmpty()){
     inner.SizeTo(2*(nsPresContext::CSSPixelsToAppUnits(ICON_SIZE+ICON_PADDING+ALT_BORDER_WIDTH)),
                  2*(nsPresContext::CSSPixelsToAppUnits(ICON_SIZE+ICON_PADDING+ALT_BORDER_WIDTH)));
   }
 
   // Make sure we have enough room to actually render the border within
   // our frame bounds
   if ((inner.width < 2 * borderEdgeWidth) || (inner.height < 2 * borderEdgeWidth)) {
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   // Paint the border
   if (!isLoading || gIconLoad->mPrefShowLoadingPlaceholder) {
     nsRecessedBorder recessedBorder(borderEdgeWidth, PresContext());
 
     // Assert that we're not drawing a border-image here; if we were, we
-    // couldn't ignore the ImgDrawResult that PaintBorderWithStyleBorder returns.
+    // couldn't ignore the DrawResult that PaintBorderWithStyleBorder returns.
     MOZ_ASSERT(recessedBorder.mBorderImageSource.GetType() == eStyleImageType_Null);
 
     Unused <<
       nsCSSRendering::PaintBorderWithStyleBorder(PresContext(), aRenderingContext,
                                                  this, inner, inner,
                                                  recessedBorder, mStyleContext,
                                                  PaintBorderFlags::SYNC_DECODE_IMAGES);
   }
 
   // Adjust the inner rect to account for the one pixel recessed border,
   // and a six pixel padding on each edge
   inner.Deflate(nsPresContext::CSSPixelsToAppUnits(ICON_PADDING+ALT_BORDER_WIDTH),
                 nsPresContext::CSSPixelsToAppUnits(ICON_PADDING+ALT_BORDER_WIDTH));
   if (inner.IsEmpty()) {
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
 
   // Clip so we don't render outside the inner rect
   aRenderingContext.Save();
   aRenderingContext.Clip(
     NSRectToSnappedRect(inner, PresContext()->AppUnitsPerDevPixel(), *drawTarget));
 
-  ImgDrawResult result = ImgDrawResult::NOT_READY;
+  DrawResult result = DrawResult::NOT_READY;
 
   // Check if we should display image placeholders
   if (!gIconLoad->mPrefShowPlaceholders ||
       (isLoading && !gIconLoad->mPrefShowLoadingPlaceholder)) {
-    result = ImgDrawResult::SUCCESS;
+    result = DrawResult::SUCCESS;
   } else {
     nscoord size = nsPresContext::CSSPixelsToAppUnits(ICON_SIZE);
 
     imgIRequest* request = isLoading
                               ? nsImageFrame::gIconLoad->mLoadingImage
                               : nsImageFrame::gIconLoad->mBrokenImage;
 
     // If we weren't previously displaying an icon, register ourselves
@@ -1451,17 +1451,17 @@ nsImageFrame::DisplayAltFeedback(gfxCont
       nsRect dest(flushRight ? inner.XMost() - size : inner.x,
                   inner.y, size, size);
       result = nsLayoutUtils::DrawSingleImage(aRenderingContext, PresContext(), imgCon,
         nsLayoutUtils::GetSamplingFilterForFrame(this), dest, aDirtyRect,
         /* no SVGImageContext */ Nothing(), aFlags);
     }
 
     // If we could not draw the icon, just draw some graffiti in the mean time.
-    if (result == ImgDrawResult::NOT_READY) {
+    if (result == DrawResult::NOT_READY) {
       ColorPattern color(ToDeviceColor(Color(1.f, 0.f, 0.f, 1.f)));
 
       nscoord iconXPos = flushRight ? inner.XMost() - size : inner.x;
 
       // stroked rect:
       nsRect rect(iconXPos, inner.y, size, size);
       Rect devPxRect =
         ToRect(nsLayoutUtils::RectToGfxRect(rect, PresContext()->AppUnitsPerDevPixel()));
@@ -1535,22 +1535,22 @@ nsDisplayImage::Paint(nsDisplayListBuild
   uint32_t flags = imgIContainer::FLAG_NONE;
   if (aBuilder->ShouldSyncDecodeImages()) {
     flags |= imgIContainer::FLAG_SYNC_DECODE;
   }
   if (aBuilder->IsPaintingToWindow()) {
     flags |= imgIContainer::FLAG_HIGH_QUALITY_SCALING;
   }
 
-  ImgDrawResult result = static_cast<nsImageFrame*>(mFrame)->
+  DrawResult result = static_cast<nsImageFrame*>(mFrame)->
     PaintImage(*aCtx, ToReferenceFrame(), mVisibleRect, mImage, flags);
 
-  if (result == ImgDrawResult::NOT_READY ||
-      result == ImgDrawResult::INCOMPLETE ||
-      result == ImgDrawResult::TEMPORARY_ERROR) {
+  if (result == DrawResult::NOT_READY ||
+      result == DrawResult::INCOMPLETE ||
+      result == DrawResult::TEMPORARY_ERROR) {
     // If the current image failed to paint because it's still loading or
     // decoding, try painting the previous image.
     if (mPrevImage) {
       result = static_cast<nsImageFrame*>(mFrame)->
         PaintImage(*aCtx, ToReferenceFrame(), mVisibleRect, mPrevImage, flags);
     }
   }
 
@@ -1737,17 +1737,17 @@ nsDisplayImage::CreateWebRenderCommands(
     mImage->GetImageContainerAtSize(aManager, decodeSize, svgContext, flags);
   if (!container) {
     return false;
   }
 
   return aManager->CommandBuilder().PushImage(this, container, aBuilder, aResources, aSc, destRect);
 }
 
-ImgDrawResult
+DrawResult
 nsImageFrame::PaintImage(gfxContext& aRenderingContext, nsPoint aPt,
                          const nsRect& aDirtyRect, imgIContainer* aImage,
                          uint32_t aFlags)
 {
   DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
 
   // Render the image into our content area (the area inside
   // the borders and padding)
@@ -1770,17 +1770,17 @@ nsImageFrame::PaintImage(gfxContext& aRe
   uint32_t flags = aFlags;
   if (mForceSyncDecoding) {
     flags |= imgIContainer::FLAG_SYNC_DECODE;
   }
 
   Maybe<SVGImageContext> svgContext;
   SVGImageContext::MaybeStoreContextPaint(svgContext, this, aImage);
 
-  ImgDrawResult result =
+  DrawResult result =
     nsLayoutUtils::DrawSingleImage(aRenderingContext,
       PresContext(), aImage,
       nsLayoutUtils::GetSamplingFilterForFrame(this), dest, aDirtyRect,
       svgContext, flags, &anchorPoint);
 
   if (nsImageMap* map = GetImageMap()) {
     gfxPoint devPixelOffset =
       nsLayoutUtils::PointToGfxPoint(dest.TopLeft(),
@@ -1795,19 +1795,19 @@ nsImageFrame::PaintImage(gfxContext& aRe
 
     // then dashed black stroke over the top:
     ColorPattern black(ToDeviceColor(Color(0.f, 0.f, 0.f, 1.f)));
     StrokeOptions strokeOptions;
     nsLayoutUtils::InitDashPattern(strokeOptions, NS_STYLE_BORDER_STYLE_DOTTED);
     map->Draw(this, *drawTarget, black, strokeOptions);
   }
 
-  if (result == ImgDrawResult::SUCCESS) {
+  if (result == DrawResult::SUCCESS) {
     mPrevImage = aImage;
-  } else if (result == ImgDrawResult::BAD_IMAGE) {
+  } else if (result == DrawResult::BAD_IMAGE) {
     mPrevImage = nullptr;
   }
 
   return result;
 }
 
 void
 nsImageFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
--- a/layout/generic/nsImageFrame.h
+++ b/layout/generic/nsImageFrame.h
@@ -60,17 +60,17 @@ private:
 
 class nsImageFrame : public nsAtomicContainerFrame
                    , public nsIReflowCallback {
 public:
   template <typename T> using Maybe = mozilla::Maybe<T>;
   using Nothing = mozilla::Nothing;
   using Visibility = mozilla::Visibility;
 
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
   typedef mozilla::layers::ImageContainer ImageContainer;
   typedef mozilla::layers::ImageLayer ImageLayer;
   typedef mozilla::layers::LayerManager LayerManager;
 
   NS_DECL_FRAMEARENA_HELPERS(nsImageFrame)
   NS_DECL_QUERYFRAME
 
   virtual void DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData) override;
@@ -142,17 +142,17 @@ public:
   /**
    * Function to test whether aContent, which has aStyleContext as its style,
    * should get an image frame.  Note that this method is only used by the
    * frame constructor; it's only here because it uses gIconLoad for now.
    */
   static bool ShouldCreateImageFrameFor(mozilla::dom::Element* aElement,
                                           nsStyleContext* aStyleContext);
 
-  ImgDrawResult DisplayAltFeedback(gfxContext& aRenderingContext,
+  DrawResult DisplayAltFeedback(gfxContext& aRenderingContext,
                                 const nsRect& aDirtyRect,
                                 nsPoint aPt,
                                 uint32_t aFlags);
 
   nsRect GetInnerArea() const;
 
   /**
    * Return a map element associated with this image.
@@ -220,17 +220,17 @@ protected:
                         gfxContext&          aContext,
                         nsFontMetrics&      aFontMetrics);
 
   void DisplayAltText(nsPresContext*      aPresContext,
                       gfxContext&          aRenderingContext,
                       const nsString&      aAltText,
                       const nsRect&        aRect);
 
-  ImgDrawResult PaintImage(gfxContext& aRenderingContext, nsPoint aPt,
+  DrawResult PaintImage(gfxContext& aRenderingContext, nsPoint aPt,
                         const nsRect& aDirtyRect, imgIContainer* aImage,
                         uint32_t aFlags);
 
   /**
    * If we're ready to decode - that is, if our current request's image is
    * available and our decoding heuristics are satisfied - then trigger a decode
    * for our image at the size we predict it will be drawn next time it's
    * painted.
--- a/layout/mathml/nsMathMLChar.cpp
+++ b/layout/mathml/nsMathMLChar.cpp
@@ -1948,17 +1948,17 @@ void nsDisplayMathMLCharDebug::Paint(nsD
   nsStyleContext* styleContext = mFrame->StyleContext();
   nsRect rect = mRect + ToReferenceFrame();
 
   PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
                          ? PaintBorderFlags::SYNC_DECODE_IMAGES
                          : PaintBorderFlags();
 
   // Since this is used only for debugging, we don't need to worry about
-  // tracking the ImgDrawResult.
+  // tracking the DrawResult.
   Unused <<
     nsCSSRendering::PaintBorder(presContext, *aCtx, mFrame, mVisibleRect,
                                 rect, styleContext, flags, skipSides);
 
   nsCSSRendering::PaintOutline(presContext, *aCtx, mFrame,
                                mVisibleRect, rect, styleContext);
 }
 #endif
--- a/layout/mathml/nsMathMLmtableFrame.cpp
+++ b/layout/mathml/nsMathMLmtableFrame.cpp
@@ -315,17 +315,17 @@ public:
     nsRect bounds = nsRect(ToReferenceFrame(), mFrame->GetSize());
     nsMargin overflow = ComputeBorderOverflow(frame, styleBorder);
     bounds.Inflate(overflow);
 
     PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
                            ? PaintBorderFlags::SYNC_DECODE_IMAGES
                            : PaintBorderFlags();
 
-    ImgDrawResult result =
+    DrawResult result =
       nsCSSRendering::PaintBorderWithStyleBorder(mFrame->PresContext(), *aCtx,
                                                  mFrame, mVisibleRect,
                                                  bounds,
                                                  styleBorder,
                                                  mFrame->StyleContext(),
                                                  flags,
                                                  mFrame->GetSkipSides());
 
--- a/layout/painting/nsCSSRendering.cpp
+++ b/layout/painting/nsCSSRendering.cpp
@@ -621,17 +621,17 @@ nsCSSRendering::ComputePixelRadii(const 
   (*oBorderRadii)[C_TR] = Size(radii[eCornerTopRightX],
                                radii[eCornerTopRightY]);
   (*oBorderRadii)[C_BR] = Size(radii[eCornerBottomRightX],
                                radii[eCornerBottomRightY]);
   (*oBorderRadii)[C_BL] = Size(radii[eCornerBottomLeftX],
                                radii[eCornerBottomLeftY]);
 }
 
-ImgDrawResult
+DrawResult
 nsCSSRendering::PaintBorder(nsPresContext* aPresContext,
                             gfxContext& aRenderingContext,
                             nsIFrame* aForFrame,
                             const nsRect& aDirtyRect,
                             const nsRect& aBorderArea,
                             nsStyleContext* aStyleContext,
                             PaintBorderFlags aFlags,
                             Sides aSkipSides)
@@ -757,17 +757,17 @@ nsCSSRendering::CreateWebRenderCommandsF
   }
 
 
   uint32_t flags = 0;
   if (aDisplayListBuilder->ShouldSyncDecodeImages()) {
     flags |= nsImageRenderer::FLAG_SYNC_DECODE_IMAGES;
   }
 
-  image::ImgDrawResult result;
+  image::DrawResult result;
   Maybe<nsCSSBorderImageRenderer> bir =
     nsCSSBorderImageRenderer::CreateBorderImageRenderer(aForFrame->PresContext(),
                                                         aForFrame,
                                                         aBorderArea,
                                                         *styleBorder,
                                                         aItem->GetVisibleRect(),
                                                         aForFrame->GetSkipSides(),
                                                         flags,
@@ -881,17 +881,17 @@ ConstructBorderRenderer(nsPresContext* a
                              borderColors,
                              aStyleBorder.mBorderColors.get(),
                              bgColor,
                              !aForFrame->BackfaceIsHidden(),
                              *aNeedsClip ? Some(NSRectToRect(aBorderArea, oneDevPixel)) : Nothing());
 }
 
 
-ImgDrawResult
+DrawResult
 nsCSSRendering::PaintBorderWithStyleBorder(nsPresContext* aPresContext,
                                            gfxContext& aRenderingContext,
                                            nsIFrame* aForFrame,
                                            const nsRect& aDirtyRect,
                                            const nsRect& aBorderArea,
                                            const nsStyleBorder& aStyleBorder,
                                            nsStyleContext* aStyleContext,
                                            PaintBorderFlags aFlags,
@@ -905,50 +905,50 @@ nsCSSRendering::PaintBorderWithStyleBord
   // renderer draw the border.  DO not get the data from aForFrame, since the passed in style context
   // may be different!  Always use |aStyleContext|!
   const nsStyleDisplay* displayData = aStyleContext->StyleDisplay();
   if (displayData->mAppearance) {
     nsITheme *theme = aPresContext->GetTheme();
     if (theme &&
         theme->ThemeSupportsWidget(aPresContext, aForFrame,
                                    displayData->mAppearance)) {
-      return ImgDrawResult::SUCCESS; // Let the theme handle it.
+      return DrawResult::SUCCESS; // Let the theme handle it.
     }
   }
 
   if (!aStyleBorder.mBorderImageSource.IsEmpty()) {
-    ImgDrawResult result = ImgDrawResult::SUCCESS;
+    DrawResult result = DrawResult::SUCCESS;
 
     uint32_t irFlags = 0;
     if (aFlags & PaintBorderFlags::SYNC_DECODE_IMAGES) {
       irFlags |= nsImageRenderer::FLAG_SYNC_DECODE_IMAGES;
     }
 
     // Creating the border image renderer will request a decode, and we rely on
     // that happening.
     Maybe<nsCSSBorderImageRenderer> renderer =
       nsCSSBorderImageRenderer::CreateBorderImageRenderer(aPresContext, aForFrame, aBorderArea,
                                                           aStyleBorder, aDirtyRect, aSkipSides,
                                                           irFlags, &result);
     // renderer was created successfully, which means border image is ready to
     // be used.
     if (renderer) {
-      MOZ_ASSERT(result == ImgDrawResult::SUCCESS);
+      MOZ_ASSERT(result == DrawResult::SUCCESS);
       return renderer->DrawBorderImage(aPresContext, aRenderingContext,
                                        aForFrame, aDirtyRect);
     }
   }
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
 
   // If we had a border-image, but it wasn't loaded, then we should return
-  // ImgDrawResult::NOT_READY; we'll want to try again if we do a paint with sync
+  // DrawResult::NOT_READY; we'll want to try again if we do a paint with sync
   // decoding enabled.
   if (aStyleBorder.mBorderImageSource.GetType() != eStyleImageType_Null) {
-    result = ImgDrawResult::NOT_READY;
+    result = DrawResult::NOT_READY;
   }
 
   nsMargin border = aStyleBorder.GetComputedBorder();
   if (0 == border.left && 0 == border.right &&
       0 == border.top  && 0 == border.bottom) {
     // Empty border area
     return result;
   }
@@ -2013,39 +2013,39 @@ nsCSSRendering::PaintBGParams::ForSingle
 
   PaintBGParams result(aPresCtx, aDirtyRect, aBorderArea,
                        aFrame, aPaintFlags, aLayer, aCompositionOp,
                        aOpacity);
 
   return result;
 }
 
-ImgDrawResult
+DrawResult
 nsCSSRendering::PaintStyleImageLayer(const PaintBGParams& aParams,
                                      gfxContext& aRenderingCtx)
 {
   AUTO_PROFILER_LABEL("nsCSSRendering::PaintStyleImageLayer", GRAPHICS);
 
   NS_PRECONDITION(aParams.frame,
                   "Frame is expected to be provided to PaintStyleImageLayer");
 
   nsStyleContext *sc;
   if (!FindBackground(aParams.frame, &sc)) {
     // We don't want to bail out if moz-appearance is set on a root
     // node. If it has a parent content node, bail because it's not
     // a root, otherwise keep going in order to let the theme stuff
     // draw the background. The canvas really should be drawing the
     // bg, but there's no way to hook that up via css.
     if (!aParams.frame->StyleDisplay()->mAppearance) {
-      return ImgDrawResult::SUCCESS;
+      return DrawResult::SUCCESS;
     }
 
     nsIContent* content = aParams.frame->GetContent();
     if (!content || content->GetParent()) {
-      return ImgDrawResult::SUCCESS;
+      return DrawResult::SUCCESS;
     }
 
     sc = aParams.frame->StyleContext();
   }
 
   return PaintStyleImageLayerWithSC(aParams, aRenderingCtx, sc, *aParams.frame->StyleBorder());
 }
 
@@ -2098,17 +2098,17 @@ nsCSSRendering::CanBuildWebRenderDisplay
 
   if (styleImage->GetType() == eStyleImageType_Gradient) {
     return true;
   }
 
   return false;
 }
 
-ImgDrawResult
+DrawResult
 nsCSSRendering::BuildWebRenderDisplayItemsForStyleImageLayer(const PaintBGParams& aParams,
                                                              mozilla::wr::DisplayListBuilder& aBuilder,
                                                              mozilla::wr::IpcResourceUpdateQueue& aResources,
                                                              const mozilla::layers::StackingContextHelper& aSc,
                                                              mozilla::layers::WebRenderLayerManager* aManager,
                                                              nsDisplayItem* aItem)
 {
   NS_PRECONDITION(aParams.frame,
@@ -2117,22 +2117,22 @@ nsCSSRendering::BuildWebRenderDisplayIte
   nsStyleContext *sc;
   if (!FindBackground(aParams.frame, &sc)) {
     // We don't want to bail out if moz-appearance is set on a root
     // node. If it has a parent content node, bail because it's not
     // a root, otherwise keep going in order to let the theme stuff
     // draw the background. The canvas really should be drawing the
     // bg, but there's no way to hook that up via css.
     if (!aParams.frame->StyleDisplay()->mAppearance) {
-      return ImgDrawResult::SUCCESS;
+      return DrawResult::SUCCESS;
     }
 
     nsIContent* content = aParams.frame->GetContent();
     if (!content || content->GetParent()) {
-      return ImgDrawResult::SUCCESS;
+      return DrawResult::SUCCESS;
     }
 
     sc = aParams.frame->StyleContext();
   }
   return BuildWebRenderDisplayItemsForStyleImageLayerWithSC(aParams, aBuilder, aResources, aSc,
                                                             aManager, aItem,
                                                             sc, *aParams.frame->StyleBorder());
 }
@@ -2607,17 +2607,17 @@ DetermineCompositionOp(const nsCSSRender
     }
 
     return nsCSSRendering::GetGFXCompositeMode(layer.mComposite);
   }
 
   return nsCSSRendering::GetGFXBlendMode(layer.mBlendMode);
 }
 
-ImgDrawResult
+DrawResult
 nsCSSRendering::PaintStyleImageLayerWithSC(const PaintBGParams& aParams,
                                            gfxContext& aRenderingCtx,
                                            nsStyleContext *aBackgroundSC,
                                            const nsStyleBorder& aBorder)
 {
   NS_PRECONDITION(aParams.frame,
                   "Frame is expected to be provided to PaintStyleImageLayerWithSC");
 
@@ -2638,17 +2638,17 @@ nsCSSRendering::PaintStyleImageLayerWith
       nsRect drawing(aParams.borderArea);
       theme->GetWidgetOverflow(aParams.presCtx.DeviceContext(),
                                aParams.frame, displayData->mAppearance,
                                &drawing);
       drawing.IntersectRect(drawing, aParams.dirtyRect);
       theme->DrawWidgetBackground(&aRenderingCtx, aParams.frame,
                                   displayData->mAppearance, aParams.borderArea,
                                   drawing);
-      return ImgDrawResult::SUCCESS;
+      return DrawResult::SUCCESS;
     }
   }
 
   // For canvas frames (in the CSS sense) we draw the background color using
   // a solid color item that gets added in nsLayoutUtils::PaintFrame,
   // or nsSubDocumentFrame::BuildDisplayList (bug 488242). (The solid
   // color may be moved into nsDisplayCanvasBackground by
   // nsPresShell::AddCanvasBackgroundColorItem, and painted by
@@ -2676,17 +2676,17 @@ nsCSSRendering::PaintStyleImageLayerWith
   if ((drawBackgroundColor && aParams.layer >= 0) || paintMask) {
     drawBackgroundColor = false;
   }
 
   // At this point, drawBackgroundImage and drawBackgroundColor are
   // true if and only if we are actually supposed to paint an image or
   // color into aDirtyRect, respectively.
   if (!drawBackgroundImage && !drawBackgroundColor)
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
 
   // The 'bgClipArea' (used only by the image tiling logic, far below)
   // is the caller-provided aParams.bgClipRect if any, or else the area
   // determined by the value of 'background-clip' in
   // SetupCurrentBackgroundClip.  (Arguably it should be the
   // intersection, but that breaks the table painter -- in particular,
   // taking the intersection breaks reftests/bugs/403249-1[ab].)
   nscoord appUnitsPerPixel = aParams.presCtx.AppUnitsPerDevPixel();
@@ -2714,23 +2714,23 @@ nsCSSRendering::PaintStyleImageLayerWith
 
   // If there is no background image, draw a color.  (If there is
   // neither a background image nor a color, we wouldn't have gotten
   // this far.)
   if (!drawBackgroundImage) {
     if (!isCanvasFrame) {
       DrawBackgroundColor(clipState, &aRenderingCtx, appUnitsPerPixel);
     }
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   if (layers.mImageCount < 1) {
     // Return if there are no background layers, all work from this point
     // onwards happens iteratively on these.
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   MOZ_ASSERT((aParams.layer < 0) ||
              (layers.mImageCount > uint32_t(aParams.layer)));
   bool drawAllLayers = (aParams.layer < 0);
 
   // Ensure we get invalidated for loads of the image.  We need to do
   // this here because this might be the only code that knows about the
@@ -2757,17 +2757,17 @@ nsCSSRendering::PaintStyleImageLayerWith
   Sides skipSides = aParams.frame->GetSkipSides();
   nsRect paintBorderArea =
     ::BoxDecorationRectForBackground(aParams.frame, aParams.borderArea,
                                      skipSides, &aBorder);
   nsRect clipBorderArea =
     ::BoxDecorationRectForBorder(aParams.frame, aParams.borderArea,
                                  skipSides, &aBorder);
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
   StyleGeometryBox currentBackgroundClip = StyleGeometryBox::BorderBox;
   uint32_t count = drawAllLayers
     ? layers.mImageCount                  // iterate all image layers.
     : layers.mImageCount - aParams.layer; // iterate from the bottom layer to
                                           // the 'aParams.layer-th' layer.
   NS_FOR_VISIBLE_IMAGE_LAYERS_BACK_TO_FRONT_WITH_RANGE(i, layers,
                                                        layers.mImageCount - 1,
                                                        count) {
@@ -2844,17 +2844,17 @@ nsCSSRendering::PaintStyleImageLayerWith
         aRenderingCtx.SetOp(CompositionOp::OP_OVER);
       }
     }
   }
 
   return result;
 }
 
-ImgDrawResult
+DrawResult
 nsCSSRendering::BuildWebRenderDisplayItemsForStyleImageLayerWithSC(const PaintBGParams& aParams,
                                                                    mozilla::wr::DisplayListBuilder& aBuilder,
                                                                    mozilla::wr::IpcResourceUpdateQueue& aResources,
                                                                    const mozilla::layers::StackingContextHelper& aSc,
                                                                    mozilla::layers::WebRenderLayerManager* aManager,
                                                                    nsDisplayItem* aItem,
                                                                    nsStyleContext *aBackgroundSC,
                                                                    const nsStyleBorder& aBorder)
@@ -2879,20 +2879,20 @@ nsCSSRendering::BuildWebRenderDisplayIte
                                      skipSides, &aBorder);
 
   const nsStyleImageLayers& layers = aBackgroundSC->StyleBackground()->mImage;
   const nsStyleImageLayers::Layer& layer = layers.mLayers[aParams.layer];
 
   // Skip the following layer painting code if we found the dirty region is
   // empty or the current layer is not selected for drawing.
   if (clipState.mDirtyRectInDevPx.IsEmpty()) {
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
   nsBackgroundLayerState state =
     PrepareImageLayer(&aParams.presCtx, aParams.frame,
                       aParams.paintFlags, paintBorderArea,
                       clipState.mBGClipArea, layer, nullptr);
   result &= state.mImageRenderer.PrepareResult();
   if (!state.mFillArea.IsEmpty()) {
     return state.mImageRenderer.BuildWebRenderDisplayItemsForLayer(&aParams.presCtx,
                                      aBuilder, aResources, aSc,
--- a/layout/painting/nsCSSRendering.h
+++ b/layout/painting/nsCSSRendering.h
@@ -102,17 +102,17 @@ struct nsCSSRendering {
   typedef mozilla::gfx::CompositionOp CompositionOp;
   typedef mozilla::gfx::DrawTarget DrawTarget;
   typedef mozilla::gfx::Float Float;
   typedef mozilla::gfx::Point Point;
   typedef mozilla::gfx::Rect Rect;
   typedef mozilla::gfx::Size Size;
   typedef mozilla::gfx::RectCornerRadii RectCornerRadii;
   typedef mozilla::layers::LayerManager LayerManager;
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
   typedef nsIFrame::Sides Sides;
 
   /**
    * Initialize any static variables used by nsCSSRendering.
    */
   static void Init();
 
   /**
@@ -157,31 +157,31 @@ struct nsCSSRendering {
                                 nscoord aAppUnitsPerPixel,
                                 RectCornerRadii *oBorderRadii);
 
   /**
    * Render the border for an element using css rendering rules
    * for borders. aSkipSides says which sides to skip
    * when rendering, the default is to skip none.
    */
-  static ImgDrawResult PaintBorder(nsPresContext* aPresContext,
+  static DrawResult PaintBorder(nsPresContext* aPresContext,
                                 gfxContext& aRenderingContext,
                                 nsIFrame* aForFrame,
                                 const nsRect& aDirtyRect,
                                 const nsRect& aBorderArea,
                                 nsStyleContext* aStyleContext,
                                 mozilla::PaintBorderFlags aFlags,
                                 Sides aSkipSides = Sides());
 
   /**
    * Like PaintBorder, but taking an nsStyleBorder argument instead of
    * getting it from aStyleContext. aSkipSides says which sides to skip
    * when rendering, the default is to skip none.
    */
-  static ImgDrawResult PaintBorderWithStyleBorder(nsPresContext* aPresContext,
+  static DrawResult PaintBorderWithStyleBorder(nsPresContext* aPresContext,
                                                gfxContext& aRenderingContext,
                                                nsIFrame* aForFrame,
                                                const nsRect& aDirtyRect,
                                                const nsRect& aBorderArea,
                                                const nsStyleBorder& aBorderStyle,
                                                nsStyleContext* aStyleContext,
                                                mozilla::PaintBorderFlags aFlags,
                                                Sides aSkipSides = Sides());
@@ -489,50 +489,50 @@ struct nsCSSRendering {
        borderArea(aBorderArea),
        frame(aFrame),
        paintFlags(aPaintFlags),
        layer(aLayer),
        compositionOp(aCompositionOp),
        opacity(aOpacity) {}
   };
 
-  static ImgDrawResult PaintStyleImageLayer(const PaintBGParams& aParams,
+  static DrawResult PaintStyleImageLayer(const PaintBGParams& aParams,
                                          gfxContext& aRenderingCtx);
 
   /**
    * Same as |PaintStyleImageLayer|, except using the provided style structs.
    * This short-circuits the code that ensures that the root element's
    * {background|mask} is drawn on the canvas.
    * The aLayer parameter allows you to paint a single layer of the
    * {background|mask}.
    * The default value for aLayer, -1, means that all layers will be painted.
    * The background color will only be painted if the back-most layer is also
    * being painted and (aParams.paintFlags & PAINTBG_MASK_IMAGE) is false.
    * aCompositionOp is only respected if a single layer is specified (aLayer != -1).
    * If all layers are painted, the image layer's blend mode (or the mask
    * layer's composition mode) will be used.
    */
-  static ImgDrawResult PaintStyleImageLayerWithSC(const PaintBGParams& aParams,
+  static DrawResult PaintStyleImageLayerWithSC(const PaintBGParams& aParams,
                                                gfxContext& aRenderingCtx,
                                                nsStyleContext *mBackgroundSC,
                                                const nsStyleBorder& aBorder);
 
   static bool CanBuildWebRenderDisplayItemsForStyleImageLayer(LayerManager* aManager,
                                                               nsPresContext& aPresCtx,
                                                               nsIFrame *aFrame,
                                                               const nsStyleBackground* aBackgroundStyle,
                                                               int32_t aLayer);
-  static ImgDrawResult BuildWebRenderDisplayItemsForStyleImageLayer(const PaintBGParams& aParams,
+  static DrawResult BuildWebRenderDisplayItemsForStyleImageLayer(const PaintBGParams& aParams,
                                                                  mozilla::wr::DisplayListBuilder& aBuilder,
                                                                  mozilla::wr::IpcResourceUpdateQueue& aResources,
                                                                  const mozilla::layers::StackingContextHelper& aSc,
                                                                  mozilla::layers::WebRenderLayerManager* aManager,
                                                                  nsDisplayItem* aItem);
 
-  static ImgDrawResult BuildWebRenderDisplayItemsForStyleImageLayerWithSC(const PaintBGParams& aParams,
+  static DrawResult BuildWebRenderDisplayItemsForStyleImageLayerWithSC(const PaintBGParams& aParams,
                                                                        mozilla::wr::DisplayListBuilder& aBuilder,
                                                                        mozilla::wr::IpcResourceUpdateQueue& aResources,
                                                                        const mozilla::layers::StackingContextHelper& aSc,
                                                                        mozilla::layers::WebRenderLayerManager* aManager,
                                                                        nsDisplayItem* aItem,
                                                                        nsStyleContext *mBackgroundSC,
                                                                        const nsStyleBorder& aBorder);
 
--- a/layout/painting/nsCSSRenderingBorders.cpp
+++ b/layout/painting/nsCSSRenderingBorders.cpp
@@ -3640,22 +3640,22 @@ nsCSSBorderRenderer::CreateWebRenderComm
 /* static */Maybe<nsCSSBorderImageRenderer>
 nsCSSBorderImageRenderer::CreateBorderImageRenderer(nsPresContext* aPresContext,
                                                     nsIFrame* aForFrame,
                                                     const nsRect& aBorderArea,
                                                     const nsStyleBorder& aStyleBorder,
                                                     const nsRect& aDirtyRect,
                                                     Sides aSkipSides,
                                                     uint32_t aFlags,
-                                                    ImgDrawResult* aDrawResult)
+                                                    DrawResult* aDrawResult)
 {
   MOZ_ASSERT(aDrawResult);
 
   if (aDirtyRect.IsEmpty()) {
-    *aDrawResult = ImgDrawResult::SUCCESS;
+    *aDrawResult = DrawResult::SUCCESS;
     return Nothing();
   }
 
   nsImageRenderer imgRenderer(aForFrame, &aStyleBorder.mBorderImageSource, aFlags);
   if (!imgRenderer.PrepareImage()) {
     *aDrawResult = imgRenderer.PrepareResult();
     return Nothing();
   }
@@ -3665,21 +3665,21 @@ nsCSSBorderImageRenderer::CreateBorderIm
   // knows about the association of the style data with the frame.
   // XXX We shouldn't really... since if anybody is passing in a
   // different style, they'll potentially have the wrong size for the
   // border too.
   aForFrame->AssociateImage(aStyleBorder.mBorderImageSource, aPresContext);
 
   nsCSSBorderImageRenderer renderer(aForFrame, aBorderArea,
                                     aStyleBorder, aSkipSides, imgRenderer);
-  *aDrawResult = ImgDrawResult::SUCCESS;
+  *aDrawResult = DrawResult::SUCCESS;
   return Some(renderer);
 }
 
-ImgDrawResult
+DrawResult
 nsCSSBorderImageRenderer::DrawBorderImage(nsPresContext* aPresContext,
                                           gfxContext& aRenderingContext,
                                           nsIFrame* aForFrame,
                                           const nsRect& aDirtyRect)
 {
   // NOTE: no Save() yet, we do that later by calling autoSR.EnsureSaved()
   // in case we need it.
   gfxContextAutoSaveRestore autoSR;
@@ -3745,17 +3745,17 @@ nsCSSBorderImageRenderer::DrawBorderImag
     mSlice.right,
   };
   const int32_t sliceHeight[3] = {
     mSlice.top,
     std::max(mImageSize.height - mSlice.top - mSlice.bottom, 0),
     mSlice.bottom,
   };
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
 
   for (int i = LEFT; i <= RIGHT; i++) {
     for (int j = TOP; j <= BOTTOM; j++) {
       uint8_t fillStyleH, fillStyleV;
       nsSize unitSize;
 
       if (i == MIDDLE && j == MIDDLE) {
         // Discard the middle portion unless set to fill.
--- a/layout/painting/nsCSSRenderingBorders.h
+++ b/layout/painting/nsCSSRenderingBorders.h
@@ -298,19 +298,19 @@ public:
   static mozilla::Maybe<nsCSSBorderImageRenderer>
   CreateBorderImageRenderer(nsPresContext* aPresContext,
                             nsIFrame* aForFrame,
                             const nsRect& aBorderArea,
                             const nsStyleBorder& aStyleBorder,
                             const nsRect& aDirtyRect,
                             nsIFrame::Sides aSkipSides,
                             uint32_t aFlags,
-                            mozilla::image::ImgDrawResult* aDrawResult);
+                            mozilla::image::DrawResult* aDrawResult);
 
-  mozilla::image::ImgDrawResult
+  mozilla::image::DrawResult
   DrawBorderImage(nsPresContext* aPresContext,
                   gfxContext& aRenderingContext,
                   nsIFrame* aForFrame,
                   const nsRect& aDirtyRect);
   void
   CreateWebRenderCommands(nsDisplayItem* aItem,
                           nsIFrame* aForFrame,
                           mozilla::wr::DisplayListBuilder& aBuilder,
--- a/layout/painting/nsDisplayList.cpp
+++ b/layout/painting/nsDisplayList.cpp
@@ -4032,17 +4032,17 @@ nsDisplayBackgroundImage::CreateWebRende
   }
   CheckForBorderItem(this, mImageFlags);
   nsCSSRendering::PaintBGParams params =
     nsCSSRendering::PaintBGParams::ForSingleLayer(*StyleFrame()->PresContext(),
                                                   mVisibleRect, mBackgroundRect,
                                                   StyleFrame(), mImageFlags, mLayer,
                                                   CompositionOp::OP_OVER);
   params.bgClipRect = &mBounds;
-  ImgDrawResult result =
+  DrawResult result =
     nsCSSRendering::BuildWebRenderDisplayItemsForStyleImageLayer(params, aBuilder, aResources, aSc, aManager, this);
   nsDisplayBackgroundGeometry::UpdateDrawResult(this, result);
 
   return true;
 }
 
 void
 nsDisplayBackgroundImage::HitTest(nsDisplayListBuilder* aBuilder,
@@ -4195,17 +4195,17 @@ nsDisplayBackgroundImage::PaintInternal(
   }
 
   nsCSSRendering::PaintBGParams params =
     nsCSSRendering::PaintBGParams::ForSingleLayer(*StyleFrame()->PresContext(),
                                                   aBounds, mBackgroundRect,
                                                   StyleFrame(), mImageFlags, mLayer,
                                                   CompositionOp::OP_OVER);
   params.bgClipRect = aClipRect;
-  ImgDrawResult result = nsCSSRendering::PaintStyleImageLayer(params, *aCtx);
+  DrawResult result = nsCSSRendering::PaintStyleImageLayer(params, *aCtx);
 
   if (clip == StyleGeometryBox::Text) {
     ctx->PopGroupAndBlend();
   }
 
   nsDisplayBackgroundGeometry::UpdateDrawResult(this, result);
 }
 
@@ -4496,17 +4496,17 @@ nsDisplayImageContainer::ConfigureLayer(
   int32_t imageHeight;
   image->GetWidth(&imageWidth);
   image->GetHeight(&imageHeight);
   NS_ASSERTION(imageWidth != 0 && imageHeight != 0, "Invalid image size!");
 
   if (imageWidth > 0 && imageHeight > 0) {
     // We're actually using the ImageContainer. Let our frame know that it
     // should consider itself to have painted successfully.
-    nsDisplayBackgroundGeometry::UpdateDrawResult(this, ImgDrawResult::SUCCESS);
+    nsDisplayBackgroundGeometry::UpdateDrawResult(this, DrawResult::SUCCESS);
   }
 
   // XXX(seth): Right now we ignore aParameters.Scale() and
   // aParameters.Offset(), because FrameLayerBuilder already applies
   // aParameters.Scale() via the layer's post-transform, and
   // aParameters.Offset() is always zero.
   MOZ_ASSERT(aParameters.Offset() == LayerIntPoint(0,0));
 
@@ -5671,17 +5671,17 @@ void
 nsDisplayBorder::Paint(nsDisplayListBuilder* aBuilder,
                        gfxContext* aCtx) {
   nsPoint offset = ToReferenceFrame();
 
   PaintBorderFlags flags = aBuilder->ShouldSyncDecodeImages()
                          ? PaintBorderFlags::SYNC_DECODE_IMAGES
                          : PaintBorderFlags();
 
-  ImgDrawResult result =
+  DrawResult result =
     nsCSSRendering::PaintBorder(mFrame->PresContext(), *aCtx, mFrame,
                                 mVisibleRect,
                                 nsRect(offset, mFrame->GetSize()),
                                 mFrame->StyleContext(),
                                 flags,
                                 mFrame->GetSkipSides());
 
   nsDisplayBorderGeometry::UpdateDrawResult(this, result);
@@ -9578,17 +9578,17 @@ nsDisplayMask::PaintMask(nsDisplayListBu
                                                   borderArea, aBuilder,
                                                   nullptr,
                                                   mHandleOpacity, imgParmas);
   ComputeMaskGeometry(params);
   nsSVGIntegrationUtils::PaintMask(params);
 
   nsDisplayMaskGeometry::UpdateDrawResult(this, imgParmas.result);
 
-  return imgParmas.result == mozilla::image::ImgDrawResult::SUCCESS;
+  return imgParmas.result == mozilla::image::DrawResult::SUCCESS;
 }
 
 LayerState
 nsDisplayMask::GetLayerState(nsDisplayListBuilder* aBuilder,
                              LayerManager* aManager,
                              const ContainerLayerParameters& aParameters)
 {
   if (CanPaintOnMaskLayer(aManager)) {
--- a/layout/painting/nsDisplayList.h
+++ b/layout/painting/nsDisplayList.h
@@ -1879,17 +1879,17 @@ public:
   typedef mozilla::layers::FrameMetrics::ViewID ViewID;
   typedef mozilla::layers::Layer Layer;
   typedef mozilla::layers::LayerManager LayerManager;
   typedef mozilla::layers::StackingContextHelper StackingContextHelper;
   typedef mozilla::layers::WebRenderCommand WebRenderCommand;
   typedef mozilla::layers::WebRenderParentCommand WebRenderParentCommand;
   typedef mozilla::LayerState LayerState;
   typedef mozilla::image::imgDrawingParams imgDrawingParams;
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
   typedef class mozilla::gfx::DrawTarget DrawTarget;
 
   // This is never instantiated directly (it has pure virtual methods), so no
   // need to count constructors and destructors.
   nsDisplayItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame);
   nsDisplayItem(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
                 const ActiveScrolledRoot* aActiveScrolledRoot);
 
--- a/layout/painting/nsDisplayListInvalidation.h
+++ b/layout/painting/nsDisplayListInvalidation.h
@@ -100,17 +100,17 @@ bool ShouldSyncDecodeImages(nsDisplayLis
  * that is inheriting from it. See nsDisplayItemGenericImageGeometry for an
  * example.
  */
 template <typename T>
 class nsImageGeometryMixin
 {
 public:
   nsImageGeometryMixin(nsDisplayItem* aItem, nsDisplayListBuilder* aBuilder)
-    : mLastDrawResult(mozilla::image::ImgDrawResult::NOT_READY)
+    : mLastDrawResult(mozilla::image::DrawResult::NOT_READY)
     , mWaitingForPaint(false)
   {
     // Transfer state from the previous version of this geometry item.
     auto lastGeometry =
       static_cast<T*>(mozilla::FrameLayerBuilder::GetMostRecentGeometry(aItem));
     if (lastGeometry) {
       mLastDrawResult = lastGeometry->mLastDrawResult;
       mWaitingForPaint = lastGeometry->mWaitingForPaint;
@@ -121,17 +121,17 @@ public:
     // painted, UpdateDrawResult will get called, and we'll clear the flag.
     if (ShouldSyncDecodeImages(aBuilder) &&
         ShouldInvalidateToSyncDecodeImages()) {
       mWaitingForPaint = true;
     }
   }
 
   static void UpdateDrawResult(nsDisplayItem* aItem,
-                               mozilla::image::ImgDrawResult aResult)
+                               mozilla::image::DrawResult aResult)
   {
     auto lastGeometry =
       static_cast<T*>(mozilla::FrameLayerBuilder::GetMostRecentGeometry(aItem));
     if (lastGeometry) {
       lastGeometry->mLastDrawResult = aResult;
       lastGeometry->mWaitingForPaint = false;
     }
   }
@@ -142,26 +142,26 @@ public:
       // We previously invalidated for sync decoding and haven't gotten painted
       // since them. This suggests that our display item is completely occluded
       // and there's no point in invalidating again - and because the reftest
       // harness takes a new snapshot every time we invalidate, doing so might
       // lead to an invalidation loop if we're in a reftest.
       return false;
     }
 
-    if (mLastDrawResult == mozilla::image::ImgDrawResult::SUCCESS ||
-        mLastDrawResult == mozilla::image::ImgDrawResult::BAD_IMAGE) {
+    if (mLastDrawResult == mozilla::image::DrawResult::SUCCESS ||
+        mLastDrawResult == mozilla::image::DrawResult::BAD_IMAGE) {
       return false;
     }
 
     return true;
   }
 
 private:
-  mozilla::image::ImgDrawResult mLastDrawResult;
+  mozilla::image::DrawResult mLastDrawResult;
   bool mWaitingForPaint;
 };
 
 /**
  * nsDisplayItemGenericImageGeometry is a generic geometry item class that
  * includes nsImageGeometryMixin.
  *
  * This should be sufficient for most display items that draw images.
--- a/layout/painting/nsImageRenderer.cpp
+++ b/layout/painting/nsImageRenderer.cpp
@@ -55,17 +55,17 @@ nsImageRenderer::nsImageRenderer(nsIFram
                                  const nsStyleImage* aImage,
                                  uint32_t aFlags)
   : mForFrame(aForFrame)
   , mImage(aImage)
   , mType(aImage->GetType())
   , mImageContainer(nullptr)
   , mGradientData(nullptr)
   , mPaintServerFrame(nullptr)
-  , mPrepareResult(ImgDrawResult::NOT_READY)
+  , mPrepareResult(DrawResult::NOT_READY)
   , mSize(0, 0)
   , mFlags(aFlags)
   , mExtendMode(ExtendMode::CLAMP)
   , mMaskOp(NS_STYLE_MASK_MODE_MATCH_SOURCE)
 {
 }
 
 nsImageRenderer::~nsImageRenderer()
@@ -110,31 +110,31 @@ ShouldTreatAsCompleteDueToSyncDecode(con
 
   return true;
 }
 
 bool
 nsImageRenderer::PrepareImage()
 {
   if (mImage->IsEmpty()) {
-    mPrepareResult = ImgDrawResult::BAD_IMAGE;
+    mPrepareResult = DrawResult::BAD_IMAGE;
     return false;
   }
 
   if (!mImage->IsComplete()) {
     // Make sure the image is actually decoding.
     bool frameComplete = mImage->StartDecoding();
 
     // Check again to see if we finished.
     // We cannot prepare the image for rendering if it is not fully loaded.
     // Special case: If we requested a sync decode and the image has loaded, push
     // on through because the Draw() will do a sync decode then.
     if (!(frameComplete || mImage->IsComplete()) &&
         !ShouldTreatAsCompleteDueToSyncDecode(mImage, mFlags)) {
-      mPrepareResult = ImgDrawResult::NOT_READY;
+      mPrepareResult = DrawResult::NOT_READY;
       return false;
     }
   }
 
   switch (mType) {
     case eStyleImageType_Image: {
       MOZ_ASSERT(mImage->GetImageData(),
                  "must have image data, since we checked IsEmpty above");
@@ -149,71 +149,71 @@ nsImageRenderer::PrepareImage()
         mImageContainer.swap(srcImage);
       } else {
         nsIntRect actualCropRect;
         bool isEntireImage;
         bool success =
           mImage->ComputeActualCropRect(actualCropRect, &isEntireImage);
         if (!success || actualCropRect.IsEmpty()) {
           // The cropped image has zero size
-          mPrepareResult = ImgDrawResult::BAD_IMAGE;
+          mPrepareResult = DrawResult::BAD_IMAGE;
           return false;
         }
         if (isEntireImage) {
           // The cropped image is identical to the source image
           mImageContainer.swap(srcImage);
         } else {
           nsCOMPtr<imgIContainer> subImage = ImageOps::Clip(srcImage,
                                                             actualCropRect,
                                                             Nothing());
           mImageContainer.swap(subImage);
         }
       }
-      mPrepareResult = ImgDrawResult::SUCCESS;
+      mPrepareResult = DrawResult::SUCCESS;
       break;
     }
     case eStyleImageType_Gradient:
       mGradientData = mImage->GetGradientData();
-      mPrepareResult = ImgDrawResult::SUCCESS;
+      mPrepareResult = DrawResult::SUCCESS;
       break;
     case eStyleImageType_Element:
     {
       nsAutoString elementId =
         NS_LITERAL_STRING("#") + nsDependentAtomString(mImage->GetElementId());
       nsCOMPtr<nsIURI> targetURI;
       nsCOMPtr<nsIURI> base = mForFrame->GetContent()->GetBaseURI();
       nsContentUtils::NewURIWithDocumentCharset(getter_AddRefs(targetURI), elementId,
                                                 mForFrame->GetContent()->GetUncomposedDoc(), base);
       nsSVGPaintingProperty* property = SVGObserverUtils::GetPaintingPropertyForURI(
           targetURI, mForFrame->FirstContinuation(),
           SVGObserverUtils::BackgroundImageProperty());
       if (!property) {
-        mPrepareResult = ImgDrawResult::BAD_IMAGE;
+        mPrepareResult = DrawResult::BAD_IMAGE;
         return false;
       }
 
       // If the referenced element is an <img>, <canvas>, or <video> element,
       // prefer SurfaceFromElement as it's more reliable.
       mImageElementSurface =
         nsLayoutUtils::SurfaceFromElement(property->GetReferencedElement());
       if (!mImageElementSurface.GetSourceSurface()) {
         nsIFrame* paintServerFrame = property->GetReferencedFrame();
         // If there's no referenced frame, or the referenced frame is
         // non-displayable SVG, then we have nothing valid to paint.
         if (!paintServerFrame ||
             (paintServerFrame->IsFrameOfType(nsIFrame::eSVG) &&
              !paintServerFrame->IsFrameOfType(nsIFrame::eSVGPaintServer) &&
              !static_cast<nsSVGDisplayableFrame*>(do_QueryFrame(paintServerFrame)))) {
-          mPrepareResult = ImgDrawResult::BAD_IMAGE;
+          mPrepareResult = DrawResult::BAD_IMAGE;
           return false;
         }
         mPaintServerFrame = paintServerFrame;
       }
 
-      mPrepareResult = ImgDrawResult::SUCCESS;
+      mPrepareResult = DrawResult::SUCCESS;
       break;
     }
     case eStyleImageType_Null:
     default:
       break;
   }
 
   return IsReady();
@@ -436,60 +436,60 @@ ConvertImageRendererToDrawFlags(uint32_t
     drawFlags |= imgIContainer::FLAG_SYNC_DECODE;
   }
   if (aImageRendererFlags & nsImageRenderer::FLAG_PAINTING_TO_WINDOW) {
     drawFlags |= imgIContainer::FLAG_HIGH_QUALITY_SCALING;
   }
   return drawFlags;
 }
 
-ImgDrawResult
+DrawResult
 nsImageRenderer::Draw(nsPresContext*       aPresContext,
                       gfxContext&          aRenderingContext,
                       const nsRect&        aDirtyRect,
                       const nsRect&        aDest,
                       const nsRect&        aFill,
                       const nsPoint&       aAnchor,
                       const nsSize&        aRepeatSize,
                       const CSSIntRect&    aSrc,
                       float                aOpacity)
 {
   if (!IsReady()) {
     NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
-    return ImgDrawResult::TEMPORARY_ERROR;
+    return DrawResult::TEMPORARY_ERROR;
   }
   if (aDest.IsEmpty() || aFill.IsEmpty() ||
       mSize.width <= 0 || mSize.height <= 0) {
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   SamplingFilter samplingFilter = nsLayoutUtils::GetSamplingFilterForFrame(mForFrame);
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
   RefPtr<gfxContext> ctx = &aRenderingContext;
   IntRect tmpDTRect;
 
   if (ctx->CurrentOp() != CompositionOp::OP_OVER || mMaskOp == NS_STYLE_MASK_MODE_LUMINANCE) {
     gfxRect clipRect = ctx->GetClipExtents(gfxContext::eDeviceSpace);
     tmpDTRect = RoundedOut(ToRect(clipRect));
     if (tmpDTRect.IsEmpty()) {
-      return ImgDrawResult::SUCCESS;
+      return DrawResult::SUCCESS;
     }
     RefPtr<DrawTarget> tempDT =
       gfxPlatform::GetPlatform()->CreateSimilarSoftwareDrawTarget(ctx->GetDrawTarget(),
                                                                   tmpDTRect.Size(),
                                                                   SurfaceFormat::B8G8R8A8);
     if (!tempDT || !tempDT->IsValid()) {
       gfxDevCrash(LogReason::InvalidContext) << "ImageRenderer::Draw problem " << gfx::hexa(tempDT);
-      return ImgDrawResult::TEMPORARY_ERROR;
+      return DrawResult::TEMPORARY_ERROR;
     }
     tempDT->SetTransform(ctx->GetDrawTarget()->GetTransform() * Matrix::Translation(-tmpDTRect.TopLeft()));
     ctx = gfxContext::CreatePreservingTransformOrNull(tempDT);
     if (!ctx) {
       gfxDevCrash(LogReason::InvalidContext) << "ImageRenderer::Draw problem " << gfx::hexa(tempDT);
-      return ImgDrawResult::TEMPORARY_ERROR;
+      return DrawResult::TEMPORARY_ERROR;
     }
   }
 
   switch (mType) {
     case eStyleImageType_Image:
     {
       CSSIntSize imageSize(nsPresContext::AppUnitsToIntCSSPixels(mSize.width),
                            nsPresContext::AppUnitsToIntCSSPixels(mSize.height));
@@ -512,17 +512,17 @@ nsImageRenderer::Draw(nsPresContext*    
       renderer.Paint(*ctx, aDest, aFill, aRepeatSize, aSrc, aDirtyRect, aOpacity);
       break;
     }
     case eStyleImageType_Element:
     {
       RefPtr<gfxDrawable> drawable = DrawableForElement(aDest, *ctx);
       if (!drawable) {
         NS_WARNING("Could not create drawable for element");
-        return ImgDrawResult::TEMPORARY_ERROR;
+        return DrawResult::TEMPORARY_ERROR;
       }
 
       nsCOMPtr<imgIContainer> image(ImageOps::CreateFromDrawable(drawable));
       result =
         nsLayoutUtils::DrawImage(*ctx, mForFrame->StyleContext(),
                                  aPresContext, image,
                                  samplingFilter, aDest, aFill, aAnchor, aDirtyRect,
                                  ConvertImageRendererToDrawFlags(mFlags),
@@ -551,38 +551,38 @@ nsImageRenderer::Draw(nsPresContext*    
     }
 
     dt->SetTransform(oldTransform);
   }
 
   return result;
 }
 
-ImgDrawResult
+DrawResult
 nsImageRenderer::BuildWebRenderDisplayItems(nsPresContext* aPresContext,
                                             mozilla::wr::DisplayListBuilder& aBuilder,
                                             mozilla::wr::IpcResourceUpdateQueue& aResources,
                                             const mozilla::layers::StackingContextHelper& aSc,
                                             mozilla::layers::WebRenderLayerManager* aManager,
                                             nsDisplayItem* aItem,
                                             const nsRect& aDirtyRect,
                                             const nsRect& aDest,
                                             const nsRect& aFill,
                                             const nsPoint& aAnchor,
                                             const nsSize& aRepeatSize,
                                             const CSSIntRect& aSrc,
                                             float aOpacity)
 {
   if (!IsReady()) {
     NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
-    return ImgDrawResult::NOT_READY;
+    return DrawResult::NOT_READY;
   }
   if (aDest.IsEmpty() || aFill.IsEmpty() ||
       mSize.width <= 0 || mSize.height <= 0) {
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   switch (mType) {
     case eStyleImageType_Gradient:
     {
       nsCSSGradientRenderer renderer =
         nsCSSGradientRenderer::Create(aPresContext, mGradientData, mSize);
 
@@ -606,25 +606,25 @@ nsImageRenderer::BuildWebRenderDisplayIt
       Maybe<SVGImageContext> svgContext;
       gfx::IntSize decodeSize =
         nsLayoutUtils::ComputeImageContainerDrawingParameters(mImageContainer, mForFrame, destRect,
                                                               aSc, containerFlags, svgContext);
       RefPtr<layers::ImageContainer> container =
         mImageContainer->GetImageContainerAtSize(aManager, decodeSize, svgContext, containerFlags);
       if (!container) {
         NS_WARNING("Failed to get image container");
-        return ImgDrawResult::NOT_READY;
+        return DrawResult::NOT_READY;
       }
 
       gfx::IntSize size;
       Maybe<wr::ImageKey> key = aManager->CommandBuilder().CreateImageKey(aItem, container, aBuilder,
                                                                           aResources, aSc, size, Nothing());
 
       if (key.isNothing()) {
-        return ImgDrawResult::BAD_IMAGE;
+        return DrawResult::BAD_IMAGE;
       }
 
       nsPoint firstTilePos = nsLayoutUtils::GetBackgroundFirstTilePos(aDest.TopLeft(),
                                                                       aFill.TopLeft(),
                                                                       aRepeatSize);
       LayoutDeviceRect fillRect = LayoutDeviceRect::FromAppUnits(
           nsRect(firstTilePos.x, firstTilePos.y,
                  aFill.XMost() - firstTilePos.x, aFill.YMost() - firstTilePos.y),
@@ -641,28 +641,28 @@ nsImageRenderer::BuildWebRenderDisplayIt
                          wr::ToLayoutSize(destRect.Size()), wr::ToLayoutSize(gapSize),
                          wr::ToImageRendering(samplingFilter), key.value());
       break;
     }
     default:
       break;
   }
 
-  return ImgDrawResult::SUCCESS;
+  return DrawResult::SUCCESS;
 }
 
 already_AddRefed<gfxDrawable>
 nsImageRenderer::DrawableForElement(const nsRect& aImageRect,
                                     gfxContext&  aContext)
 {
   NS_ASSERTION(mType == eStyleImageType_Element,
                "DrawableForElement only makes sense if backed by an element");
   if (mPaintServerFrame) {
     // XXX(seth): In order to not pass FLAG_SYNC_DECODE_IMAGES here,
-    // DrawableFromPaintServer would have to return a ImgDrawResult indicating
+    // DrawableFromPaintServer would have to return a DrawResult indicating
     // whether any images could not be painted because they weren't fully
     // decoded. Even always passing FLAG_SYNC_DECODE_IMAGES won't eliminate all
     // problems, as it won't help if there are image which haven't finished
     // loading, but it's better than nothing.
     int32_t appUnitsPerDevPixel = mForFrame->PresContext()->AppUnitsPerDevPixel();
     nsRect destRect = aImageRect - aImageRect.TopLeft();
     nsIntSize roundedOut = destRect.ToOutsidePixels(appUnitsPerDevPixel).Size();
     IntSize imageSize(roundedOut.width, roundedOut.height);
@@ -677,44 +677,44 @@ nsImageRenderer::DrawableForElement(cons
   }
   NS_ASSERTION(mImageElementSurface.GetSourceSurface(), "Surface should be ready.");
   RefPtr<gfxDrawable> drawable = new gfxSurfaceDrawable(
                                 mImageElementSurface.GetSourceSurface().get(),
                                 mImageElementSurface.mSize);
   return drawable.forget();
 }
 
-ImgDrawResult
+DrawResult
 nsImageRenderer::DrawLayer(nsPresContext*       aPresContext,
                            gfxContext&          aRenderingContext,
                            const nsRect&        aDest,
                            const nsRect&        aFill,
                            const nsPoint&       aAnchor,
                            const nsRect&        aDirty,
                            const nsSize&        aRepeatSize,
                            float                aOpacity)
 {
   if (!IsReady()) {
     NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
-    return ImgDrawResult::TEMPORARY_ERROR;
+    return DrawResult::TEMPORARY_ERROR;
   }
   if (aDest.IsEmpty() || aFill.IsEmpty() ||
       mSize.width <= 0 || mSize.height <= 0) {
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   return Draw(aPresContext, aRenderingContext,
               aDirty, aDest, aFill, aAnchor, aRepeatSize,
               CSSIntRect(0, 0,
                          nsPresContext::AppUnitsToIntCSSPixels(mSize.width),
                          nsPresContext::AppUnitsToIntCSSPixels(mSize.height)),
               aOpacity);
 }
 
-ImgDrawResult
+DrawResult
 nsImageRenderer::BuildWebRenderDisplayItemsForLayer(nsPresContext*       aPresContext,
                                                     mozilla::wr::DisplayListBuilder& aBuilder,
                                                     mozilla::wr::IpcResourceUpdateQueue& aResources,
                                                     const mozilla::layers::StackingContextHelper& aSc,
                                                     mozilla::layers::WebRenderLayerManager* aManager,
                                                     nsDisplayItem*       aItem,
                                                     const nsRect&        aDest,
                                                     const nsRect&        aFill,
@@ -724,17 +724,17 @@ nsImageRenderer::BuildWebRenderDisplayIt
                                                     float                aOpacity)
 {
   if (!IsReady()) {
     NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
     return mPrepareResult;
   }
   if (aDest.IsEmpty() || aFill.IsEmpty() ||
       mSize.width <= 0 || mSize.height <= 0) {
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
   return BuildWebRenderDisplayItems(aPresContext, aBuilder, aResources, aSc,
                                     aManager, aItem,
                                     aDirty, aDest, aFill, aAnchor, aRepeatSize,
                                     CSSIntRect(0, 0,
                                                nsPresContext::AppUnitsToIntCSSPixels(mSize.width),
                                                nsPresContext::AppUnitsToIntCSSPixels(mSize.height)),
                                     aOpacity);
@@ -839,35 +839,35 @@ RequiresScaling(const nsRect&        aFi
   // If we have no tiling in either direction, we can skip the intermediate
   // scaling step.
   return (aHFill != NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH ||
           aVFill != NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH) &&
          (aUnitSize.width != aFill.width ||
           aUnitSize.height != aFill.height);
 }
 
-ImgDrawResult
+DrawResult
 nsImageRenderer::DrawBorderImageComponent(nsPresContext*       aPresContext,
                                           gfxContext&          aRenderingContext,
                                           const nsRect&        aDirtyRect,
                                           const nsRect&        aFill,
                                           const CSSIntRect&    aSrc,
                                           uint8_t              aHFill,
                                           uint8_t              aVFill,
                                           const nsSize&        aUnitSize,
                                           uint8_t              aIndex,
                                           const Maybe<nsSize>& aSVGViewportSize,
                                           const bool           aHasIntrinsicRatio)
 {
   if (!IsReady()) {
     NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
-    return ImgDrawResult::BAD_ARGS;
+    return DrawResult::BAD_ARGS;
   }
   if (aFill.IsEmpty() || aSrc.IsEmpty()) {
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   if (mType == eStyleImageType_Image || mType == eStyleImageType_Element) {
     nsCOMPtr<imgIContainer> subImage;
 
     // To draw one portion of an image into a border component, we stretch that
     // portion to match the size of that border component and then draw onto.
     // However, preserveAspectRatio attribute of a SVG image may break this rule.
@@ -898,17 +898,17 @@ nsImageRenderer::DrawBorderImageComponen
       // invalidate that cache, and it's not clear that it's worth the trouble
       // since using border-image with -moz-element is rare.
 
       RefPtr<gfxDrawable> drawable =
         DrawableForElement(nsRect(nsPoint(), mSize),
                            aRenderingContext);
       if (!drawable) {
         NS_WARNING("Could not create drawable for element");
-        return ImgDrawResult::TEMPORARY_ERROR;
+        return DrawResult::TEMPORARY_ERROR;
       }
 
       nsCOMPtr<imgIContainer> image(ImageOps::CreateFromDrawable(drawable));
       subImage = ImageOps::Clip(image, srcRect, aSVGViewportSize);
     }
 
     MOZ_ASSERT(!aSVGViewportSize ||
                subImage->GetType() == imgIContainer::TYPE_VECTOR);
--- a/layout/painting/nsImageRenderer.h
+++ b/layout/painting/nsImageRenderer.h
@@ -96,17 +96,17 @@ struct CSSSizeOrRatio
  * nsStyleImage image, which may internally be a real image, a sub image, or a
  * CSS gradient.
  *
  * @note Always call the member functions in the order of PrepareImage(),
  * SetSize(), and Draw*().
  */
 class nsImageRenderer {
 public:
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
   typedef mozilla::layers::LayerManager LayerManager;
   typedef mozilla::layers::ImageContainer ImageContainer;
 
   enum {
     FLAG_SYNC_DECODE_IMAGES = 0x01,
     FLAG_PAINTING_TO_WINDOW = 0x02
   };
   enum FitType
@@ -190,31 +190,31 @@ public:
   void SetPreferredSize(const mozilla::CSSSizeOrRatio& aIntrinsicSize,
                         const nsSize& aDefaultSize);
 
   /**
    * Draws the image to the target rendering context using
    * {background|mask}-specific arguments.
    * @see nsLayoutUtils::DrawImage() for parameters.
    */
-  ImgDrawResult DrawLayer(nsPresContext*       aPresContext,
+  DrawResult DrawLayer(nsPresContext*       aPresContext,
                        gfxContext&          aRenderingContext,
                        const nsRect&        aDest,
                        const nsRect&        aFill,
                        const nsPoint&       aAnchor,
                        const nsRect&        aDirty,
                        const nsSize&        aRepeatSize,
                        float                aOpacity);
 
   /**
    * Builds WebRender DisplayItems for an image using
    * {background|mask}-specific arguments.
    * @see nsLayoutUtils::DrawImage() for parameters.
    */
-  ImgDrawResult BuildWebRenderDisplayItemsForLayer(nsPresContext*       aPresContext,
+  DrawResult BuildWebRenderDisplayItemsForLayer(nsPresContext*       aPresContext,
                                                 mozilla::wr::DisplayListBuilder& aBuilder,
                                                 mozilla::wr::IpcResourceUpdateQueue& aResource,
                                                 const mozilla::layers::StackingContextHelper& aSc,
                                                 mozilla::layers::WebRenderLayerManager* aManager,
                                                 nsDisplayItem*       aItem,
                                                 const nsRect&        aDest,
                                                 const nsRect&        aFill,
                                                 const nsPoint&       aAnchor,
@@ -236,17 +236,17 @@ public:
    *                                  6 7 8
    * aSVGViewportSize The image size evaluated by default sizing algorithm.
    * Pass Nothing() if we can read a valid viewport size or aspect-ratio from
    * the drawing image directly, otherwise, pass Some() with viewport size
    * evaluated from default sizing algorithm.
    * aHasIntrinsicRatio is used to record if the source image has fixed
    * intrinsic ratio.
    */
-  ImgDrawResult
+  DrawResult
   DrawBorderImageComponent(nsPresContext*       aPresContext,
                            gfxContext&          aRenderingContext,
                            const nsRect&        aDirtyRect,
                            const nsRect&        aFill,
                            const mozilla::CSSIntRect& aSrc,
                            uint8_t              aHFill,
                            uint8_t              aVFill,
                            const nsSize&        aUnitSize,
@@ -256,51 +256,51 @@ public:
 
   bool IsRasterImage();
   bool IsAnimatedImage();
 
   /// Retrieves the image associated with this nsImageRenderer, if there is one.
   already_AddRefed<imgIContainer> GetImage();
 
   bool IsImageContainerAvailable(layers::LayerManager* aManager, uint32_t aFlags);
-  bool IsReady() const { return mPrepareResult == ImgDrawResult::SUCCESS; }
-  ImgDrawResult PrepareResult() const { return mPrepareResult; }
+  bool IsReady() const { return mPrepareResult == DrawResult::SUCCESS; }
+  DrawResult PrepareResult() const { return mPrepareResult; }
   void SetExtendMode(mozilla::gfx::ExtendMode aMode) { mExtendMode = aMode; }
   void SetMaskOp(uint8_t aMaskOp) { mMaskOp = aMaskOp; }
   void PurgeCacheForViewportChange(const mozilla::Maybe<nsSize>& aSVGViewportSize,
                                    const bool aHasRatio);
   nsStyleImageType GetType() const { return mType; }
   already_AddRefed<nsStyleGradient> GetGradientData();
 
 private:
   /**
    * Draws the image to the target rendering context.
    * aSrc is a rect on the source image which will be mapped to aDest; it's
    * currently only used for gradients.
    *
    * @see nsLayoutUtils::DrawImage() for other parameters.
    */
-  ImgDrawResult Draw(nsPresContext*       aPresContext,
+  DrawResult Draw(nsPresContext*       aPresContext,
                   gfxContext&          aRenderingContext,
                   const nsRect&        aDirtyRect,
                   const nsRect&        aDest,
                   const nsRect&        aFill,
                   const nsPoint&       aAnchor,
                   const nsSize&        aRepeatSize,
                   const mozilla::CSSIntRect& aSrc,
                   float                aOpacity = 1.0);
 
   /**
    * Builds WebRender DisplayItems for the image.
    * aSrc is a rect on the source image which will be mapped to aDest; it's
    * currently only used for gradients.
    *
    * @see nsLayoutUtils::DrawImage() for other parameters.
    */
-  ImgDrawResult BuildWebRenderDisplayItems(nsPresContext*       aPresContext,
+  DrawResult BuildWebRenderDisplayItems(nsPresContext*       aPresContext,
                                         mozilla::wr::DisplayListBuilder& aBuilder,
                                         mozilla::wr::IpcResourceUpdateQueue& aResources,
                                         const mozilla::layers::StackingContextHelper& aSc,
                                         mozilla::layers::WebRenderLayerManager* aManager,
                                         nsDisplayItem*       aItem,
                                         const nsRect&        aDirtyRect,
                                         const nsRect&        aDest,
                                         const nsRect&        aFill,
@@ -320,17 +320,17 @@ private:
 
   nsIFrame*                 mForFrame;
   const nsStyleImage*       mImage;
   nsStyleImageType          mType;
   nsCOMPtr<imgIContainer>   mImageContainer;
   RefPtr<nsStyleGradient> mGradientData;
   nsIFrame*                 mPaintServerFrame;
   nsLayoutUtils::SurfaceFromElementResult mImageElementSurface;
-  ImgDrawResult                mPrepareResult;
+  DrawResult                mPrepareResult;
   nsSize                    mSize; // unscaled size of the image, in app units
   uint32_t                  mFlags;
   mozilla::gfx::ExtendMode  mExtendMode;
   uint8_t                   mMaskOp;
 };
 
 } // namespace mozilla
 
--- a/layout/svg/SVGContextPaint.h
+++ b/layout/svg/SVGContextPaint.h
@@ -13,17 +13,17 @@
 #include "gfxTypes.h"
 #include "gfxUtils.h"
 #include "mozilla/AlreadyAddRefed.h"
 #include "mozilla/Assertions.h"
 #include "mozilla/gfx/2D.h"
 #include "nsColor.h"
 #include "nsStyleStruct.h"
 #include "nsTArray.h"
-#include "ImgDrawResult.h"
+#include "DrawResult.h"
 
 class gfxContext;
 class nsIDocument;
 class nsSVGPaintServerFrame;
 
 namespace mozilla {
 
 /**
--- a/layout/svg/nsFilterInstance.cpp
+++ b/layout/svg/nsFilterInstance.cpp
@@ -6,17 +6,17 @@
 
 // Main header first:
 #include "nsFilterInstance.h"
 
 // MFBT headers next:
 #include "mozilla/UniquePtr.h"
 
 // Keep others in (case-insensitive) order:
-#include "ImgDrawResult.h"
+#include "DrawResult.h"
 #include "gfx2DGlue.h"
 #include "gfxContext.h"
 #include "gfxPlatform.h"
 #include "gfxUtils.h"
 #include "mozilla/gfx/Helpers.h"
 #include "mozilla/gfx/PatternHelpers.h"
 #include "nsSVGDisplayableFrame.h"
 #include "nsCSSFilterInstance.h"
--- a/layout/svg/nsSVGClipPathFrame.cpp
+++ b/layout/svg/nsSVGClipPathFrame.cpp
@@ -4,17 +4,17 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Main header first:
 #include "nsSVGClipPathFrame.h"
 
 // Keep others in (case-insensitive) order:
 #include "AutoReferenceChainGuard.h"
-#include "ImgDrawResult.h"
+#include "DrawResult.h"
 #include "gfxContext.h"
 #include "mozilla/dom/SVGClipPathElement.h"
 #include "nsGkAtoms.h"
 #include "SVGObserverUtils.h"
 #include "SVGGeometryElement.h"
 #include "SVGGeometryFrame.h"
 #include "nsSVGUtils.h"
 
--- a/layout/svg/nsSVGContainerFrame.cpp
+++ b/layout/svg/nsSVGContainerFrame.cpp
@@ -3,17 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Main header first:
 #include "nsSVGContainerFrame.h"
 
 // Keep others in (case-insensitive) order:
-#include "ImgDrawResult.h"
+#include "DrawResult.h"
 #include "mozilla/RestyleManager.h"
 #include "mozilla/RestyleManagerInlines.h"
 #include "nsCSSFrameConstructor.h"
 #include "SVGObserverUtils.h"
 #include "nsSVGElement.h"
 #include "nsSVGUtils.h"
 #include "nsSVGAnimatedTransformList.h"
 #include "SVGTextFrame.h"
--- a/layout/svg/nsSVGForeignObjectFrame.cpp
+++ b/layout/svg/nsSVGForeignObjectFrame.cpp
@@ -3,17 +3,17 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 // Main header first:
 #include "nsSVGForeignObjectFrame.h"
 
 // Keep others in (case-insensitive) order:
-#include "ImgDrawResult.h"
+#include "DrawResult.h"
 #include "gfxContext.h"
 #include "nsDisplayList.h"
 #include "nsGkAtoms.h"
 #include "nsNameSpaceManager.h"
 #include "nsLayoutUtils.h"
 #include "nsRegion.h"
 #include "nsSVGContainerFrame.h"
 #include "SVGObserverUtils.h"
--- a/layout/svg/nsSVGIntegrationUtils.cpp
+++ b/layout/svg/nsSVGIntegrationUtils.cpp
@@ -499,17 +499,17 @@ PaintMaskSurface(const PaintFramesParams
                                                       nsCSSRendering::PAINTBG_MASK_IMAGE,
                                                       i, compositionOp,
                                                       aOpacity);
 
       aParams.imgParams.result &=
         nsCSSRendering::PaintStyleImageLayerWithSC(params, *maskContext, aSC,
                                               *aParams.frame->StyleBorder());
     } else {
-      aParams.imgParams.result &= ImgDrawResult::NOT_READY;
+      aParams.imgParams.result &= DrawResult::NOT_READY;
     }
   }
 }
 
 struct MaskPaintResult {
   RefPtr<SourceSurface> maskSurface;
   Matrix maskTransform;
   bool transparentBlackMask;
@@ -576,17 +576,17 @@ CreateAndPaintMaskSurface(const PaintFra
   Matrix maskSurfaceMatrix =
     ctx.CurrentMatrix() * Matrix::Translation(-aParams.maskRect.TopLeft());
 
   PaintMaskSurface(aParams, maskDT,
                    paintResult.opacityApplied ? aOpacity : 1.0,
                    aSC, aMaskFrames, maskSurfaceMatrix,
                    aOffsetToUserSpace);
 
-  if (aParams.imgParams.result != ImgDrawResult::SUCCESS) {
+  if (aParams.imgParams.result != DrawResult::SUCCESS) {
     // Now we know the status of mask resource since we used it while painting.
     // According to the return value of PaintMaskSurface, we know whether mask
     // resource is resolvable or not.
     //
     // For a HTML doc:
     //   According to css-masking spec, always create a mask surface when
     //   we have any item in maskFrame even if all of those items are
     //   non-resolvable <mask-sources> or <images>.
--- a/layout/svg/nsSVGIntegrationUtils.h
+++ b/layout/svg/nsSVGIntegrationUtils.h
@@ -2,17 +2,17 @@
 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef NSSVGINTEGRATIONUTILS_H_
 #define NSSVGINTEGRATIONUTILS_H_
 
-#include "ImgDrawResult.h"
+#include "DrawResult.h"
 #include "gfxMatrix.h"
 #include "gfxRect.h"
 #include "nsRegionFwd.h"
 #include "mozilla/gfx/Rect.h"
 
 class gfxContext;
 class gfxDrawable;
 class nsDisplayList;
--- a/layout/svg/nsSVGMaskFrame.cpp
+++ b/layout/svg/nsSVGMaskFrame.cpp
@@ -68,17 +68,17 @@ nsSVGMaskFrame::GetMaskForMaskedFrame(Ma
   maskSurfaceRect.RoundOut();
   context->Restore();
 
   bool resultOverflows;
   IntSize maskSurfaceSize =
     nsSVGUtils::ConvertToSurfaceSize(maskSurfaceRect.Size(), &resultOverflows);
 
   if (resultOverflows || maskSurfaceSize.IsEmpty()) {
-    // Return value other then ImgDrawResult::SUCCESS, so the caller can skip
+    // Return value other then DrawResult::SUCCESS, so the caller can skip
     // painting the masked frame(aParams.maskedFrame).
     return nullptr;
   }
 
   uint8_t maskType;
   if (aParams.maskMode == NS_STYLE_MASK_MODE_MATCH_SOURCE) {
     maskType = StyleSVGReset()->mMaskType;
   } else {
--- a/layout/svg/nsSVGUtils.h
+++ b/layout/svg/nsSVGUtils.h
@@ -6,17 +6,17 @@
 
 #ifndef NS_SVGUTILS_H
 #define NS_SVGUTILS_H
 
 // include math.h to pick up definition of M_ maths defines e.g. M_PI
 #include <math.h>
 
 #include "DrawMode.h"
-#include "ImgDrawResult.h"
+#include "DrawResult.h"
 #include "gfx2DGlue.h"
 #include "gfxMatrix.h"
 #include "gfxPoint.h"
 #include "gfxRect.h"
 #include "mozilla/gfx/Rect.h"
 #include "nsAlgorithm.h"
 #include "nsChangeHint.h"
 #include "nsColor.h"
--- a/layout/tables/nsTableCellFrame.cpp
+++ b/layout/tables/nsTableCellFrame.cpp
@@ -361,17 +361,17 @@ nsTableCellFrame::DecorateForSelection(D
         StrokeLineWithSnapping(nsPoint(mRect.width - (2*onePixel), 2*onePixel),
                                nsPoint(mRect.width - (2*onePixel), mRect.height-onePixel),
                                appUnitsPerDevPixel, *aDrawTarget, color);
       }
     }
   }
 }
 
-ImgDrawResult
+DrawResult
 nsTableCellFrame::PaintBackground(gfxContext&          aRenderingContext,
                                   const nsRect&        aDirtyRect,
                                   nsPoint              aPt,
                                   uint32_t             aFlags)
 {
   nsRect rect(aPt, GetSize());
   nsCSSRendering::PaintBGParams params =
     nsCSSRendering::PaintBGParams::ForAllLayers(*PresContext(),
@@ -421,17 +421,17 @@ public:
   virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
                            bool* aSnap) const override;
   NS_DISPLAY_DECL_NAME("TableCellBackground", TYPE_TABLE_CELL_BACKGROUND)
 };
 
 void nsDisplayTableCellBackground::Paint(nsDisplayListBuilder* aBuilder,
                                          gfxContext* aCtx)
 {
-  ImgDrawResult result = static_cast<nsTableCellFrame*>(mFrame)->
+  DrawResult result = static_cast<nsTableCellFrame*>(mFrame)->
     PaintBackground(*aCtx, mVisibleRect, ToReferenceFrame(),
                     aBuilder->GetBackgroundPaintFlags());
 
   nsDisplayTableItemGeometry::UpdateDrawResult(this, result);
 }
 
 nsRect
 nsDisplayTableCellBackground::GetBounds(nsDisplayListBuilder* aBuilder,
@@ -1168,17 +1168,17 @@ nsBCTableCellFrame::GetBorderOverflow()
   LogicalMargin halfBorder(wm,
                            BC_BORDER_START_HALF_COORD(d2a, mBStartBorder),
                            BC_BORDER_END_HALF_COORD(d2a, mIEndBorder),
                            BC_BORDER_END_HALF_COORD(d2a, mBEndBorder),
                            BC_BORDER_START_HALF_COORD(d2a, mIStartBorder));
   return halfBorder.GetPhysicalMargin(wm);
 }
 
-ImgDrawResult
+DrawResult
 nsBCTableCellFrame::PaintBackground(gfxContext&          aRenderingContext,
                                     const nsRect&        aDirtyRect,
                                     nsPoint              aPt,
                                     uint32_t             aFlags)
 {
   // make border-width reflect the half of the border-collapse
   // assigned border that's inside the cell
   WritingMode wm = GetWritingMode();
--- a/layout/tables/nsTableCellFrame.h
+++ b/layout/tables/nsTableCellFrame.h
@@ -30,17 +30,17 @@
  *
  * @author  sclark
  */
 class nsTableCellFrame : public nsContainerFrame,
                          public nsITableCellLayout,
                          public nsIPercentBSizeObserver
 {
   typedef mozilla::gfx::DrawTarget DrawTarget;
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
 
   friend nsTableCellFrame* NS_NewTableCellFrame(nsIPresShell*   aPresShell,
                                                 nsStyleContext* aContext,
                                                 nsTableFrame* aTableFrame);
 
   nsTableCellFrame(nsStyleContext* aContext, nsTableFrame* aTableFrame)
     : nsTableCellFrame(aContext, aTableFrame, kClassID) {}
 
@@ -224,17 +224,17 @@ public:
       MOZ_ASSERT(cellFrame, "How do we have a non-cell sibling?");
     }
 #endif // DEBUG
     return static_cast<nsTableCellFrame*>(sibling);
   }
 
   virtual LogicalMargin GetBorderWidth(WritingMode aWM) const;
 
-  virtual ImgDrawResult PaintBackground(gfxContext&          aRenderingContext,
+  virtual DrawResult PaintBackground(gfxContext&          aRenderingContext,
                                      const nsRect&        aDirtyRect,
                                      nsPoint              aPt,
                                      uint32_t             aFlags);
 
   void DecorateForSelection(DrawTarget* aDrawTarget, nsPoint aPt);
 
   virtual bool ComputeCustomOverflow(nsOverflowAreas& aOverflowAreas) override;
 
@@ -317,17 +317,17 @@ inline void nsTableCellFrame::SetHasPctO
   } else {
     RemoveStateBits(NS_TABLE_CELL_HAS_PCT_OVER_BSIZE);
   }
 }
 
 // nsBCTableCellFrame
 class nsBCTableCellFrame final : public nsTableCellFrame
 {
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
 public:
   NS_DECL_FRAMEARENA_HELPERS(nsBCTableCellFrame)
 
   nsBCTableCellFrame(nsStyleContext* aContext, nsTableFrame* aTableFrame);
 
   ~nsBCTableCellFrame();
 
   virtual nsMargin GetUsedBorder() const override;
@@ -342,17 +342,17 @@ public:
   void SetBorderWidth(LogicalSide aSide, BCPixelSize aPixelValue);
 
   virtual nsMargin GetBorderOverflow() override;
 
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override;
 #endif
 
-  virtual ImgDrawResult PaintBackground(gfxContext&          aRenderingContext,
+  virtual DrawResult PaintBackground(gfxContext&          aRenderingContext,
                                      const nsRect&        aDirtyRect,
                                      nsPoint              aPt,
                                      uint32_t             aFlags) override;
 
 private:
 
   // These are the entire width of the border (the cell edge contains only
   // the inner half, per the macros in nsTablePainter.h).
--- a/layout/tables/nsTableFrame.h
+++ b/layout/tables/nsTableFrame.h
@@ -118,17 +118,17 @@ enum nsTableColType {
   * Used as a pseudo-frame within nsTableWrapperFrame, it may also be used
   * stand-alone as the top-level frame.
   *
   * The principal child list contains row group frames. There is also an
   * additional child list, kColGroupList, which contains the col group frames.
   */
 class nsTableFrame : public nsContainerFrame
 {
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
   typedef mozilla::WritingMode WritingMode;
   typedef mozilla::LogicalMargin LogicalMargin;
   typedef mozilla::TableReflowInput TableReflowInput;
 
 public:
   NS_DECL_FRAMEARENA_HELPERS(nsTableFrame)
 
   typedef nsTArray<nsIFrame*> FrameTArray;
--- a/layout/xul/nsGroupBoxFrame.cpp
+++ b/layout/xul/nsGroupBoxFrame.cpp
@@ -35,17 +35,17 @@ public:
 #ifdef DEBUG_FRAME_DUMP
   virtual nsresult GetFrameName(nsAString& aResult) const override {
     return MakeFrameName(NS_LITERAL_STRING("GroupBoxFrame"), aResult);
   }
 #endif
 
   virtual bool HonorPrintBackgroundSettings() override { return false; }
 
-  ImgDrawResult PaintBorder(gfxContext& aRenderingContext,
+  DrawResult PaintBorder(gfxContext& aRenderingContext,
                                    nsPoint aPt,
                                    const nsRect& aDirtyRect);
   nsRect GetBackgroundRectRelativeToSelf(nscoord* aOutYOffset = nullptr, nsRect* aOutGroupRect = nullptr);
 
   // make sure we our kids get our orient and align instead of us.
   // our child box has no content node so it will search for a parent with one.
   // that will be us.
   virtual void GetInitialOrientation(bool& aHorizontal) override { aHorizontal = false; }
@@ -133,17 +133,17 @@ nsDisplayXULGroupBorder::ComputeInvalida
 
   nsDisplayItem::ComputeInvalidationRegion(aBuilder, aGeometry, aInvalidRegion);
 }
 
 void
 nsDisplayXULGroupBorder::Paint(nsDisplayListBuilder* aBuilder,
                                    gfxContext* aCtx)
 {
-  ImgDrawResult result = static_cast<nsGroupBoxFrame*>(mFrame)
+  DrawResult result = static_cast<nsGroupBoxFrame*>(mFrame)
     ->PaintBorder(*aCtx, ToReferenceFrame(), mVisibleRect);
 
   nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
 }
 
 void
 nsGroupBoxFrame::BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                   const nsDisplayListSet& aLists)
@@ -188,17 +188,17 @@ nsGroupBoxFrame::GetBackgroundRectRelati
   }
   if (aOutGroupRect) {
     *aOutGroupRect = groupRect;
   }
 
   return nsRect(0, yoff, mRect.width, mRect.height - yoff);
 }
 
-ImgDrawResult
+DrawResult
 nsGroupBoxFrame::PaintBorder(gfxContext& aRenderingContext,
     nsPoint aPt, const nsRect& aDirtyRect) {
 
   DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
 
   Sides skipSides;
   const nsStyleBorder* borderStyleData = StyleBorder();
   const nsMargin& border = borderStyleData->GetComputedBorder();
@@ -206,17 +206,17 @@ nsGroupBoxFrame::PaintBorder(gfxContext&
 
   nsRect groupRect;
   nsIFrame* groupBox = GetCaptionBox(groupRect);
 
   nscoord yoff = 0;
   nsRect rect = GetBackgroundRectRelativeToSelf(&yoff, &groupRect) + aPt;
   groupRect += aPt;
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
   if (groupBox) {
     int32_t appUnitsPerDevPixel = PresContext()->AppUnitsPerDevPixel();
 
     // we should probably use PaintBorderEdges to do this but for now just use clipping
     // to achieve the same effect.
 
     // draw left side
     nsRect clipRect(rect);
--- a/layout/xul/nsImageBoxFrame.cpp
+++ b/layout/xul/nsImageBoxFrame.cpp
@@ -350,93 +350,93 @@ nsImageBoxFrame::BuildDisplayList(nsDisp
 
   CreateOwnLayerIfNeeded(aBuilder, &list);
 
   aLists.Content()->AppendToTop(&list);
 }
 
 already_AddRefed<imgIContainer>
 nsImageBoxFrame::GetImageContainerForPainting(const nsPoint& aPt,
-                                              ImgDrawResult& aDrawResult,
+                                              DrawResult& aDrawResult,
                                               Maybe<nsPoint>& aAnchorPoint,
                                               nsRect& aDest)
 {
   if (!mImageRequest) {
     // This probably means we're drawn by a native theme.
-    aDrawResult = ImgDrawResult::SUCCESS;
+    aDrawResult = DrawResult::SUCCESS;
     return nullptr;
   }
 
   // Don't draw if the image's size isn't available.
   uint32_t imgStatus;
   if (!NS_SUCCEEDED(mImageRequest->GetImageStatus(&imgStatus)) ||
       !(imgStatus & imgIRequest::STATUS_SIZE_AVAILABLE)) {
-    aDrawResult = ImgDrawResult::NOT_READY;
+    aDrawResult = DrawResult::NOT_READY;
     return nullptr;
   }
 
   nsCOMPtr<imgIContainer> imgCon;
   mImageRequest->GetImage(getter_AddRefs(imgCon));
 
   if (!imgCon) {
-    aDrawResult = ImgDrawResult::NOT_READY;
+    aDrawResult = DrawResult::NOT_READY;
     return nullptr;
   }
 
   aDest = GetDestRect(aPt, aAnchorPoint);
-  aDrawResult = ImgDrawResult::SUCCESS;
+  aDrawResult = DrawResult::SUCCESS;
   return imgCon.forget();
 }
 
-ImgDrawResult
+DrawResult
 nsImageBoxFrame::PaintImage(gfxContext& aRenderingContext,
                             const nsRect& aDirtyRect, nsPoint aPt,
                             uint32_t aFlags)
 {
-  ImgDrawResult result;
+  DrawResult result;
   Maybe<nsPoint> anchorPoint;
   nsRect dest;
   nsCOMPtr<imgIContainer> imgCon = GetImageContainerForPainting(aPt, result,
                                                                 anchorPoint,
                                                                 dest);
   if (!imgCon) {
     return result;
   }
 
   // don't draw if the image is not dirty
   // XXX(seth): Can this actually happen anymore?
   nsRect dirty;
   if (!dirty.IntersectRect(aDirtyRect, dest)) {
-    return ImgDrawResult::TEMPORARY_ERROR;
+    return DrawResult::TEMPORARY_ERROR;
   }
 
   bool hasSubRect = !mUseSrcAttr && (mSubRect.width > 0 || mSubRect.height > 0);
 
   Maybe<SVGImageContext> svgContext;
   SVGImageContext::MaybeStoreContextPaint(svgContext, this, imgCon);
   return nsLayoutUtils::DrawSingleImage(
            aRenderingContext,
            PresContext(), imgCon,
            nsLayoutUtils::GetSamplingFilterForFrame(this),
            dest, dirty,
            svgContext, aFlags,
            anchorPoint.ptrOr(nullptr),
            hasSubRect ? &mSubRect : nullptr);
 }
 
-ImgDrawResult
+DrawResult
 nsImageBoxFrame::CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
                                          mozilla::wr::IpcResourceUpdateQueue& aResources,
                                          const StackingContextHelper& aSc,
                                          mozilla::layers::WebRenderLayerManager* aManager,
                                          nsDisplayItem* aItem,
                                          nsPoint aPt,
                                          uint32_t aFlags)
 {
-  ImgDrawResult result;
+  DrawResult result;
   Maybe<nsPoint> anchorPoint;
   nsRect dest;
   nsCOMPtr<imgIContainer> imgCon = GetImageContainerForPainting(aPt, result,
                                                                 anchorPoint,
                                                                 dest);
   if (!imgCon) {
     return result;
   }
@@ -455,35 +455,35 @@ nsImageBoxFrame::CreateWebRenderCommands
   Maybe<SVGImageContext> svgContext;
   gfx::IntSize decodeSize =
     nsLayoutUtils::ComputeImageContainerDrawingParameters(imgCon, aItem->Frame(), fillRect,
                                                           aSc, containerFlags, svgContext);
   RefPtr<layers::ImageContainer> container =
     imgCon->GetImageContainerAtSize(aManager, decodeSize, svgContext, containerFlags);
   if (!container) {
     NS_WARNING("Failed to get image container");
-    return ImgDrawResult::NOT_READY;
+    return DrawResult::NOT_READY;
   }
 
   gfx::IntSize size;
   Maybe<wr::ImageKey> key = aManager->CommandBuilder().CreateImageKey(aItem, container,
                                                                       aBuilder, aResources,
                                                                       aSc, size, Nothing());
   if (key.isNothing()) {
-    return ImgDrawResult::BAD_IMAGE;
+    return DrawResult::BAD_IMAGE;
   }
   wr::LayoutRect fill = aSc.ToRelativeLayoutRect(fillRect);
 
   LayoutDeviceSize gapSize(0, 0);
   SamplingFilter sampleFilter = nsLayoutUtils::GetSamplingFilterForFrame(aItem->Frame());
   aBuilder.PushImage(fill, fill, !BackfaceIsHidden(),
                      wr::ToLayoutSize(fillRect.Size()), wr::ToLayoutSize(gapSize),
                      wr::ToImageRendering(sampleFilter), key.value());
 
-  return ImgDrawResult::SUCCESS;
+  return DrawResult::SUCCESS;
 }
 
 nsRect
 nsImageBoxFrame::GetDestRect(const nsPoint& aOffset, Maybe<nsPoint>& aAnchorPoint)
 {
   nsCOMPtr<imgIContainer> imgCon;
   mImageRequest->GetImage(getter_AddRefs(imgCon));
   MOZ_ASSERT(imgCon);
@@ -534,17 +534,17 @@ void nsDisplayXULImage::Paint(nsDisplayL
   // the intrinsic size of the image and we aren't likely to implement predictive
   // decoding at the correct size for this class like nsImageFrame has.
   uint32_t flags = imgIContainer::FLAG_SYNC_DECODE_IF_FAST;
   if (aBuilder->ShouldSyncDecodeImages())
     flags |= imgIContainer::FLAG_SYNC_DECODE;
   if (aBuilder->IsPaintingToWindow())
     flags |= imgIContainer::FLAG_HIGH_QUALITY_SCALING;
 
-  ImgDrawResult result = static_cast<nsImageBoxFrame*>(mFrame)->
+  DrawResult result = static_cast<nsImageBoxFrame*>(mFrame)->
     PaintImage(*aCtx, mVisibleRect, ToReferenceFrame(), flags);
 
   nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
 }
 
 LayerState
 nsDisplayXULImage::GetLayerState(nsDisplayListBuilder* aBuilder,
                                  LayerManager* aManager,
@@ -584,17 +584,17 @@ nsDisplayXULImage::CreateWebRenderComman
   uint32_t flags = imgIContainer::FLAG_SYNC_DECODE_IF_FAST;
   if (aDisplayListBuilder->ShouldSyncDecodeImages()) {
     flags |= imgIContainer::FLAG_SYNC_DECODE;
   }
   if (aDisplayListBuilder->IsPaintingToWindow()) {
     flags |= imgIContainer::FLAG_HIGH_QUALITY_SCALING;
   }
 
-  ImgDrawResult result = imageFrame->
+  DrawResult result = imageFrame->
     CreateWebRenderCommands(aBuilder, aResources, aSc, aManager, this, ToReferenceFrame(), flags);
 
   nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
   return true;
 }
 
 nsDisplayItemGeometry*
 nsDisplayXULImage::AllocateGeometry(nsDisplayListBuilder* aBuilder)
--- a/layout/xul/nsImageBoxFrame.h
+++ b/layout/xul/nsImageBoxFrame.h
@@ -32,17 +32,17 @@ private:
   virtual ~nsImageBoxListener();
 
   nsImageBoxFrame *mFrame;
 };
 
 class nsImageBoxFrame final : public nsLeafBoxFrame
 {
 public:
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
   typedef mozilla::layers::ImageContainer ImageContainer;
   typedef mozilla::layers::LayerManager LayerManager;
 
   friend class nsDisplayXULImage;
   NS_DECL_FRAMEARENA_HELPERS(nsImageBoxFrame)
 
   virtual nsSize GetXULPrefSize(nsBoxLayoutState& aBoxLayoutState) override;
   virtual nsSize GetXULMinSize(nsBoxLayoutState& aBoxLayoutState) override;
@@ -83,25 +83,25 @@ public:
   void UpdateLoadFlags();
 
   virtual void BuildDisplayList(nsDisplayListBuilder*   aBuilder,
                                 const nsDisplayListSet& aLists) override;
 
   virtual ~nsImageBoxFrame();
 
   already_AddRefed<imgIContainer> GetImageContainerForPainting(const nsPoint& aPt,
-                                                               ImgDrawResult& aDrawResult,
+                                                               DrawResult& aDrawResult,
                                                                Maybe<nsPoint>& aAnchorPoint,
                                                                nsRect& aDest);
 
-  ImgDrawResult PaintImage(gfxContext& aRenderingContext,
+  DrawResult PaintImage(gfxContext& aRenderingContext,
                         const nsRect& aDirtyRect,
                         nsPoint aPt, uint32_t aFlags);
 
-  ImgDrawResult CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
+  DrawResult CreateWebRenderCommands(mozilla::wr::DisplayListBuilder& aBuilder,
                                      mozilla::wr::IpcResourceUpdateQueue& aResources,
                                      const mozilla::layers::StackingContextHelper& aSc,
                                      mozilla::layers::WebRenderLayerManager* aManager,
                                      nsDisplayItem* aItem,
                                      nsPoint aPt,
                                      uint32_t aFlags);
 
   bool CanOptimizeToImageLayer();
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -2811,17 +2811,17 @@ public:
 
   virtual void Paint(nsDisplayListBuilder* aBuilder,
                      gfxContext* aCtx) override
   {
     MOZ_ASSERT(aBuilder);
     DrawTargetAutoDisableSubpixelAntialiasing disable(aCtx->GetDrawTarget(),
                                                       mDisableSubpixelAA);
 
-    ImgDrawResult result = static_cast<nsTreeBodyFrame*>(mFrame)
+    DrawResult result = static_cast<nsTreeBodyFrame*>(mFrame)
       ->PaintTreeBody(*aCtx, mVisibleRect, ToReferenceFrame(), aBuilder);
 
     nsDisplayItemGenericImageGeometry::UpdateDrawResult(this, result);
   }
 
   NS_DISPLAY_DECL_NAME("XULTreeBody", TYPE_XUL_TREE_BODY)
 
   virtual nsRect GetComponentAlphaBounds(nsDisplayListBuilder* aBuilder) const override
@@ -2894,17 +2894,17 @@ nsTreeBodyFrame::BuildDisplayList(nsDisp
           }
         }
       }
     }
   }
 #endif
 }
 
-ImgDrawResult
+DrawResult
 nsTreeBodyFrame::PaintTreeBody(gfxContext& aRenderingContext,
                                const nsRect& aDirtyRect, nsPoint aPt,
                                nsDisplayListBuilder* aBuilder)
 {
   // Update our available height and our page count.
   CalcInnerBox();
 
   DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
@@ -2923,17 +2923,17 @@ nsTreeBodyFrame::PaintTreeBody(gfxContex
                                   NS_FRAME_IS_DIRTY);
   }
 #ifdef DEBUG
   int32_t rowCount = mRowCount;
   mView->GetRowCount(&rowCount);
   NS_WARNING_ASSERTION(mRowCount == rowCount, "row count changed unexpectedly");
 #endif
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
 
   // Loop through our columns and paint them (e.g., for sorting).  This is only
   // relevant when painting backgrounds, since columns contain no content.  Content
   // is contained in the rows.
   for (nsTreeColumn* currCol = mColumns->GetFirstColumn(); currCol;
        currCol = currCol->GetNext()) {
     nsRect colRect;
     nsresult rv = currCol->GetRect(this, mInnerBox.y, mInnerBox.height,
@@ -2978,17 +2978,17 @@ nsTreeBodyFrame::PaintTreeBody(gfxContex
   }
   aRenderingContext.Restore();
 
   return result;
 }
 
 
 
-ImgDrawResult
+DrawResult
 nsTreeBodyFrame::PaintColumn(nsTreeColumn*        aColumn,
                              const nsRect&        aColumnRect,
                              nsPresContext*      aPresContext,
                              gfxContext&          aRenderingContext,
                              const nsRect&        aDirtyRect)
 {
   NS_PRECONDITION(aColumn && aColumn->GetFrame(), "invalid column passed");
 
@@ -3008,31 +3008,31 @@ nsTreeBodyFrame::PaintColumn(nsTreeColum
   nsMargin colMargin;
   colContext->StyleMargin()->GetMargin(colMargin);
   colRect.Deflate(colMargin);
 
   return PaintBackgroundLayer(colContext, aPresContext, aRenderingContext,
                               colRect, aDirtyRect);
 }
 
-ImgDrawResult
+DrawResult
 nsTreeBodyFrame::PaintRow(int32_t               aRowIndex,
                           const nsRect&         aRowRect,
                           nsPresContext*        aPresContext,
                           gfxContext&           aRenderingContext,
                           const nsRect&         aDirtyRect,
                           nsPoint               aPt,
                           nsDisplayListBuilder* aBuilder)
 {
   // We have been given a rect for our row.  We treat this row like a full-blown
   // frame, meaning that it can have borders, margins, padding, and a background.
 
   // Without a view, we have no data. Check for this up front.
   if (!mView) {
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   nsresult rv;
 
   // Now obtain the properties for our row.
   // XXX Automatically fill in the following props: open, closed, container, leaf, selected, focused
   PrefillPropertyArray(aRowIndex, nullptr);
 
@@ -3046,17 +3046,17 @@ nsTreeBodyFrame::PaintRow(int32_t       
 
   // Obtain the margins for the row and then deflate our rect by that
   // amount.  The row is assumed to be contained within the deflated rect.
   nsRect rowRect(aRowRect);
   nsMargin rowMargin;
   rowContext->StyleMargin()->GetMargin(rowMargin);
   rowRect.Deflate(rowMargin);
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
 
   // Paint our borders and background for our row rect.
   nsITheme* theme = nullptr;
   auto appearance = rowContext->StyleDisplay()->mAppearance;
   if (appearance) {
     theme = aPresContext->GetTheme();
   }
 
@@ -3168,17 +3168,17 @@ nsTreeBodyFrame::PaintRow(int32_t       
                               aBuilder);
       }
     }
   }
 
   return result;
 }
 
-ImgDrawResult
+DrawResult
 nsTreeBodyFrame::PaintSeparator(int32_t              aRowIndex,
                                 const nsRect&        aSeparatorRect,
                                 nsPresContext*      aPresContext,
                                 gfxContext&          aRenderingContext,
                                 const nsRect&        aDirtyRect)
 {
   // Resolve style for the separator.
   nsStyleContext* separatorContext = GetPseudoStyleContext(nsCSSAnonBoxes::mozTreeSeparator);
@@ -3186,17 +3186,17 @@ nsTreeBodyFrame::PaintSeparator(int32_t 
   nsITheme *theme = nullptr;
   const nsStyleDisplay* displayData = separatorContext->StyleDisplay();
   if ( displayData->mAppearance ) {
     theme = aPresContext->GetTheme();
     if (theme && theme->ThemeSupportsWidget(aPresContext, nullptr, displayData->mAppearance))
       useTheme = true;
   }
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
 
   // use -moz-appearance if provided.
   if (useTheme) {
     nsRect dirty;
     dirty.IntersectRect(aSeparatorRect, aDirtyRect);
     theme->DrawWidgetBackground(&aRenderingContext, this,
                                 displayData->mAppearance, aSeparatorRect, dirty);
   }
@@ -3225,17 +3225,17 @@ nsTreeBodyFrame::PaintSeparator(int32_t 
     result &= PaintBackgroundLayer(separatorContext, aPresContext,
                                    aRenderingContext, separatorRect,
                                    aDirtyRect);
   }
 
   return result;
 }
 
-ImgDrawResult
+DrawResult
 nsTreeBodyFrame::PaintCell(int32_t               aRowIndex,
                            nsTreeColumn*         aColumn,
                            const nsRect&         aCellRect,
                            nsPresContext*        aPresContext,
                            gfxContext&           aRenderingContext,
                            const nsRect&         aDirtyRect,
                            nscoord&              aCurrX,
                            nsPoint               aPt,
@@ -3259,17 +3259,17 @@ nsTreeBodyFrame::PaintCell(int32_t      
   // Obtain the margins for the cell and then deflate our rect by that
   // amount.  The cell is assumed to be contained within the deflated rect.
   nsRect cellRect(aCellRect);
   nsMargin cellMargin;
   cellContext->StyleMargin()->GetMargin(cellMargin);
   cellRect.Deflate(cellMargin);
 
   // Paint our borders and background for our row rect.
-  ImgDrawResult result = PaintBackgroundLayer(cellContext, aPresContext,
+  DrawResult result = PaintBackgroundLayer(cellContext, aPresContext,
                                            aRenderingContext, cellRect,
                                            aDirtyRect);
 
   // Adjust the rect for its border and padding.
   AdjustForBorderPadding(cellContext, cellRect);
 
   nscoord currX = cellRect.x;
   nscoord remainingWidth = cellRect.width;
@@ -3430,17 +3430,17 @@ nsTreeBodyFrame::PaintCell(int32_t      
     }
   }
 
   aCurrX = currX;
 
   return result;
 }
 
-ImgDrawResult
+DrawResult
 nsTreeBodyFrame::PaintTwisty(int32_t              aRowIndex,
                              nsTreeColumn*        aColumn,
                              const nsRect&        aTwistyRect,
                              nsPresContext*      aPresContext,
                              gfxContext&          aRenderingContext,
                              const nsRect&        aDirtyRect,
                              nscoord&             aRemainingWidth,
                              nscoord&             aCurrX)
@@ -3477,17 +3477,17 @@ nsTreeBodyFrame::PaintTwisty(int32_t    
   // Subtract out the remaining width.  This is done even when we don't actually paint a twisty in
   // this cell, so that cells in different rows still line up.
   nsRect copyRect(twistyRect);
   copyRect.Inflate(twistyMargin);
   aRemainingWidth -= copyRect.width;
   if (!isRTL)
     aCurrX += copyRect.width;
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
 
   if (shouldPaint) {
     // Paint our borders and background for our image rect.
     result &= PaintBackgroundLayer(twistyContext, aPresContext,
                                    aRenderingContext, twistyRect,
                                    aDirtyRect);
 
     if (theme) {
@@ -3531,17 +3531,17 @@ nsTreeBodyFrame::PaintTwisty(int32_t    
               imgIContainer::FLAG_NONE, &imageSize);
       }
     }
   }
 
   return result;
 }
 
-ImgDrawResult
+DrawResult
 nsTreeBodyFrame::PaintImage(int32_t               aRowIndex,
                             nsTreeColumn*         aColumn,
                             const nsRect&         aImageRect,
                             nsPresContext*        aPresContext,
                             gfxContext&           aRenderingContext,
                             const nsRect&         aDirtyRect,
                             nscoord&              aRemainingWidth,
                             nscoord&              aCurrX,
@@ -3567,17 +3567,17 @@ nsTreeBodyFrame::PaintImage(int32_t     
   // Get the image.
   bool useImageRegion = true;
   nsCOMPtr<imgIContainer> image;
   GetImage(aRowIndex, aColumn, false, imageContext, useImageRegion, getter_AddRefs(image));
 
   // Get the image destination size.
   nsSize imageDestSize = GetImageDestSize(imageContext, useImageRegion, image);
   if (!imageDestSize.width || !imageDestSize.height) {
-    return ImgDrawResult::SUCCESS;
+    return DrawResult::SUCCESS;
   }
 
   // Get the borders and padding.
   nsMargin bp(0,0,0,0);
   GetBorderPadding(imageContext, bp);
 
   // destRect will be passed as the aDestRect argument in the DrawImage method.
   // Start with the imageDestSize width and height.
@@ -3604,17 +3604,17 @@ nsTreeBodyFrame::PaintImage(int32_t     
     if (!aColumn->IsCycler()) {
       // If this column is not a cycler, we won't center the image horizontally.
       // We adjust the imageRect width so that the image is placed at the start
       // of the cell.
       imageRect.width = destRect.width;
     }
   }
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
 
   if (image) {
     if (isRTL)
       imageRect.x = rightEdge - imageRect.width;
     // Paint our borders and background for our image rect
     result &= PaintBackgroundLayer(imageContext, aPresContext,
                                    aRenderingContext, imageRect,
                                    aDirtyRect);
@@ -3715,17 +3715,17 @@ nsTreeBodyFrame::PaintImage(int32_t     
 
 // Disable PGO for PaintText because MSVC 2015 seems to have decided
 // that it can null out the alreadyAddRefed<nsFontMetrics> used to
 // initialize fontMet after storing fontMet on the stack in the same
 // space, overwriting fontMet's stack storage with null.
 #ifdef _MSC_VER
 # pragma optimize("g", off)
 #endif
-ImgDrawResult
+DrawResult
 nsTreeBodyFrame::PaintText(int32_t              aRowIndex,
                            nsTreeColumn*        aColumn,
                            const nsRect&        aTextRect,
                            nsPresContext*      aPresContext,
                            gfxContext&          aRenderingContext,
                            const nsRect&        aDirtyRect,
                            nscoord&             aCurrX)
 {
@@ -3740,17 +3740,17 @@ nsTreeBodyFrame::PaintText(int32_t      
   if (aColumn->Type() == nsITreeColumn::TYPE_PASSWORD) {
     TextEditRules::FillBufWithPWChars(&text, text.Length());
   }
 
   // We're going to paint this text so we need to ensure bidi is enabled if
   // necessary
   CheckTextForBidi(text);
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
 
   if (text.Length() == 0) {
     // Don't paint an empty string. XXX What about background/borders? Still paint?
     return result;
   }
 
   int32_t appUnitsPerDevPixel = PresContext()->AppUnitsPerDevPixel();
   DrawTarget* drawTarget = aRenderingContext.GetDrawTarget();
@@ -3850,17 +3850,17 @@ nsTreeBodyFrame::PaintText(int32_t      
   }
 
   return result;
 }
 #ifdef _MSC_VER
 # pragma optimize("", on)
 #endif
 
-ImgDrawResult
+DrawResult
 nsTreeBodyFrame::PaintCheckbox(int32_t              aRowIndex,
                                nsTreeColumn*        aColumn,
                                const nsRect&        aCheckboxRect,
                                nsPresContext*      aPresContext,
                                gfxContext&          aRenderingContext,
                                const nsRect&        aDirtyRect)
 {
   NS_PRECONDITION(aColumn && aColumn->GetFrame(), "invalid column passed");
@@ -3883,17 +3883,17 @@ nsTreeBodyFrame::PaintCheckbox(int32_t  
     imageSize.height = checkboxRect.height;
   if (imageSize.width > checkboxRect.width)
     imageSize.width = checkboxRect.width;
 
   if (StyleVisibility()->mDirection == NS_STYLE_DIRECTION_RTL)
     checkboxRect.x = rightEdge - checkboxRect.width;
 
   // Paint our borders and background for our image rect.
-  ImgDrawResult result = PaintBackgroundLayer(checkboxContext, aPresContext,
+  DrawResult result = PaintBackgroundLayer(checkboxContext, aPresContext,
                                            aRenderingContext, checkboxRect,
                                            aDirtyRect);
 
   // Time to paint the checkbox.
   // Adjust the rect for its border and padding.
   nsMargin bp(0,0,0,0);
   GetBorderPadding(checkboxContext, bp);
   checkboxRect.Deflate(bp);
@@ -3919,17 +3919,17 @@ nsTreeBodyFrame::PaintCheckbox(int32_t  
         aPresContext,
         image, SamplingFilter::POINT, pt, &aDirtyRect,
         imgIContainer::FLAG_NONE, &imageSize);
   }
 
   return result;
 }
 
-ImgDrawResult
+DrawResult
 nsTreeBodyFrame::PaintProgressMeter(int32_t               aRowIndex,
                                     nsTreeColumn*         aColumn,
                                     const nsRect&         aProgressMeterRect,
                                     nsPresContext*        aPresContext,
                                     gfxContext&           aRenderingContext,
                                     const nsRect&         aDirtyRect,
                                     nsDisplayListBuilder* aBuilder)
 {
@@ -3943,17 +3943,17 @@ nsTreeBodyFrame::PaintProgressMeter(int3
   // amount. The progress meter is assumed to be contained within the deflated
   // rect.
   nsRect meterRect(aProgressMeterRect);
   nsMargin meterMargin;
   meterContext->StyleMargin()->GetMargin(meterMargin);
   meterRect.Deflate(meterMargin);
 
   // Paint our borders and background for our progress meter rect.
-  ImgDrawResult result = PaintBackgroundLayer(meterContext, aPresContext,
+  DrawResult result = PaintBackgroundLayer(meterContext, aPresContext,
                                            aRenderingContext, meterRect,
                                            aDirtyRect);
 
   // Time to paint our progress.
   int32_t state;
   mView->GetProgressMode(aRowIndex, aColumn, &state);
   if (state == nsITreeView::PROGRESS_NORMAL) {
     // Adjust the rect for its border and padding.
@@ -4023,17 +4023,17 @@ nsTreeBodyFrame::PaintProgressMeter(int3
           aDirtyRect, drawFlags);
     }
   }
 
   return result;
 }
 
 
-ImgDrawResult
+DrawResult
 nsTreeBodyFrame::PaintDropFeedback(const nsRect&        aDropFeedbackRect,
                                    nsPresContext*      aPresContext,
                                    gfxContext&          aRenderingContext,
                                    const nsRect&        aDirtyRect,
                                    nsPoint              aPt)
 {
   // Paint the drop feedback in between rows.
 
@@ -4054,17 +4054,17 @@ nsTreeBodyFrame::PaintDropFeedback(const
     currX = aDropFeedbackRect.x;
   }
 
   PrefillPropertyArray(mSlots->mDropRow, primaryCol);
 
   // Resolve the style to use for the drop feedback.
   nsStyleContext* feedbackContext = GetPseudoStyleContext(nsCSSAnonBoxes::mozTreeDropFeedback);
 
-  ImgDrawResult result = ImgDrawResult::SUCCESS;
+  DrawResult result = DrawResult::SUCCESS;
 
   // Paint only if it is visible.
   if (feedbackContext->StyleVisibility()->IsVisibleOrCollapsed()) {
     int32_t level;
     mView->GetLevel(mSlots->mDropRow, &level);
 
     // If our previous or next row has greater level use that for
     // correct visual indentation.
@@ -4132,29 +4132,29 @@ nsTreeBodyFrame::PaintDropFeedback(const
     result &= PaintBackgroundLayer(feedbackContext, aPresContext,
                                    aRenderingContext, feedbackRect,
                                    aDirtyRect);
   }
 
   return result;
 }
 
-ImgDrawResult
+DrawResult
 nsTreeBodyFrame::PaintBackgroundLayer(nsStyleContext*      aStyleContext,
                                       nsPresContext*      aPresContext,
                                       gfxContext&          aRenderingContext,
                                       const nsRect&        aRect,
                                       const nsRect&        aDirtyRect)
 {
   const nsStyleBorder* myBorder = aStyleContext->StyleBorder();
   nsCSSRendering::PaintBGParams params =
     nsCSSRendering::PaintBGParams::ForAllLayers(*aPresContext,
                                                 aDirtyRect, aRect, this,
                                                 nsCSSRendering::PAINTBG_SYNC_DECODE_IMAGES);
-  ImgDrawResult result =
+  DrawResult result =
     nsCSSRendering::PaintStyleImageLayerWithSC(params, aRenderingContext, aStyleContext,
                                                *myBorder);
 
   result &=
     nsCSSRendering::PaintBorderWithStyleBorder(aPresContext, aRenderingContext,
                                                this, aDirtyRect, aRect,
                                                *myBorder, mStyleContext,
                                                PaintBorderFlags::SYNC_DECODE_IMAGES);
--- a/layout/xul/tree/nsTreeBodyFrame.h
+++ b/layout/xul/tree/nsTreeBodyFrame.h
@@ -48,17 +48,17 @@ struct nsTreeImageCacheEntry
 
 // The actual frame that paints the cells and rows.
 class nsTreeBodyFrame final
   : public nsLeafBoxFrame
   , public nsIScrollbarMediator
   , public nsIReflowCallback
 {
   typedef mozilla::layout::ScrollbarActivity ScrollbarActivity;
-  typedef mozilla::image::ImgDrawResult ImgDrawResult;
+  typedef mozilla::image::DrawResult DrawResult;
 
 public:
   explicit nsTreeBodyFrame(nsStyleContext* aContext);
   ~nsTreeBodyFrame();
 
   NS_DECL_QUERYFRAME
   NS_DECL_FRAMEARENA_HELPERS(nsTreeBodyFrame)
 
@@ -185,122 +185,122 @@ public:
     nsScrollbarFrame*    mVScrollbar;
     RefPtr<Element>      mVScrollbarContent;
     nsScrollbarFrame*    mHScrollbar;
     RefPtr<Element>      mHScrollbarContent;
     nsIFrame*            mColumnsFrame;
     nsIScrollableFrame*  mColumnsScrollFrame;
   };
 
-  ImgDrawResult PaintTreeBody(gfxContext& aRenderingContext,
+  DrawResult PaintTreeBody(gfxContext& aRenderingContext,
                            const nsRect& aDirtyRect, nsPoint aPt,
                            nsDisplayListBuilder* aBuilder);
 
   nsITreeBoxObject* GetTreeBoxObject() const { return mTreeBoxObject; }
 
   // Get the base element, <tree> or <select>
   nsIContent* GetBaseElement();
 
   bool GetVerticalOverflow() const { return mVerticalOverflow; }
   bool GetHorizontalOverflow() const {return mHorizontalOverflow; }
 
 protected:
   friend class nsOverflowChecker;
 
   // This method paints a specific column background of the tree.
-  ImgDrawResult PaintColumn(nsTreeColumn*        aColumn,
+  DrawResult PaintColumn(nsTreeColumn*        aColumn,
                          const nsRect&        aColumnRect,
                          nsPresContext*       aPresContext,
                          gfxContext&          aRenderingContext,
                          const nsRect&        aDirtyRect);
 
   // This method paints a single row in the tree.
-  ImgDrawResult PaintRow(int32_t               aRowIndex,
+  DrawResult PaintRow(int32_t               aRowIndex,
                       const nsRect&         aRowRect,
                       nsPresContext*        aPresContext,
                       gfxContext&           aRenderingContext,
                       const nsRect&         aDirtyRect,
                       nsPoint               aPt,
                       nsDisplayListBuilder* aBuilder);
 
   // This method paints a single separator in the tree.
-  ImgDrawResult PaintSeparator(int32_t              aRowIndex,
+  DrawResult PaintSeparator(int32_t              aRowIndex,
                             const nsRect&        aSeparatorRect,
                             nsPresContext*       aPresContext,
                             gfxContext&          aRenderingContext,
                             const nsRect&        aDirtyRect);
 
   // This method paints a specific cell in a given row of the tree.
-  ImgDrawResult PaintCell(int32_t               aRowIndex,
+  DrawResult PaintCell(int32_t               aRowIndex,
                        nsTreeColumn*         aColumn,
                        const nsRect&         aCellRect,
                        nsPresContext*        aPresContext,
                        gfxContext&           aRenderingContext,
                        const nsRect&         aDirtyRect,
                        nscoord&              aCurrX,
                        nsPoint               aPt,
                        nsDisplayListBuilder* aBuilder);
 
   // This method paints the twisty inside a cell in the primary column of an tree.
-  ImgDrawResult PaintTwisty(int32_t              aRowIndex,
+  DrawResult PaintTwisty(int32_t              aRowIndex,
                          nsTreeColumn*        aColumn,
                          const nsRect&        aTwistyRect,
                          nsPresContext*       aPresContext,
                          gfxContext&          aRenderingContext,
                          const nsRect&        aDirtyRect,
                          nscoord&             aRemainingWidth,
                          nscoord&             aCurrX);
 
   // This method paints the image inside the cell of an tree.
-  ImgDrawResult PaintImage(int32_t               aRowIndex,
+  DrawResult PaintImage(int32_t               aRowIndex,
                         nsTreeColumn*         aColumn,
                         const nsRect&         aImageRect,
                         nsPresContext*        aPresContext,
                         gfxContext&           aRenderingContext,
                         const nsRect&         aDirtyRect,
                         nscoord&              aRemainingWidth,
                         nscoord&              aCurrX,
                         nsDisplayListBuilder* aBuilder);
 
   // This method paints the text string inside a particular cell of the tree.
-  ImgDrawResult PaintText(int32_t             aRowIndex,
+  DrawResult PaintText(int32_t             aRowIndex,
                        nsTreeColumn*       aColumn,
                        const nsRect&       aTextRect,
                        nsPresContext*      aPresContext,
                        gfxContext&         aRenderingContext,
                        const nsRect&       aDirtyRect,
                        nscoord&            aCurrX);
 
   // This method paints the checkbox inside a particular cell of the tree.
-  ImgDrawResult PaintCheckbox(int32_t              aRowIndex,
+  DrawResult PaintCheckbox(int32_t              aRowIndex,
                            nsTreeColumn*        aColumn,
                            const nsRect&        aCheckboxRect,
                            nsPresContext*       aPresContext,
                            gfxContext&          aRenderingContext,
                            const nsRect&        aDirtyRect);
 
   // This method paints the progress meter inside a particular cell of the tree.
-  ImgDrawResult PaintProgressMeter(int32_t               aRowIndex,
+  DrawResult PaintProgressMeter(int32_t               aRowIndex,
                                 nsTreeColumn*         aColumn,
                                 const nsRect&         aProgressMeterRect,
                                 nsPresContext*        aPresContext,
                                 gfxContext&           aRenderingContext,
                                 const nsRect&         aDirtyRect,
                                 nsDisplayListBuilder* aBuilder);
 
   // This method paints a drop feedback of the tree.
-  ImgDrawResult PaintDropFeedback(const nsRect&        aDropFeedbackRect,
+  DrawResult PaintDropFeedback(const nsRect&        aDropFeedbackRect,
                                nsPresContext*       aPresContext,
                                gfxContext&          aRenderingContext,
                                const nsRect&        aDirtyRect,
                                nsPoint              aPt);
 
   // This method is called with a specific style context and rect to
   // paint the background rect as if it were a full-blown frame.
-  ImgDrawResult PaintBackgroundLayer(nsStyleContext*      aStyleContext,
+  DrawResult PaintBackgroundLayer(nsStyleContext*      aStyleContext,
                                   nsPresContext*       aPresContext,
                                   gfxContext&          aRenderingContext,
                                   const nsRect&        aRect,
                                   const nsRect&        aDirtyRect);
 
 
   // An internal hit test.  aX and aY are expected to be in twips in the
   // coordinate system of this frame.
--- a/widget/nsBaseDragService.cpp
+++ b/widget/nsBaseDragService.cpp
@@ -754,22 +754,22 @@ nsBaseDragService::DrawDragForImage(nsPr
                                          SurfaceFormat::B8G8R8A8);
     if (!dt || !dt->IsValid())
       return NS_ERROR_FAILURE;
 
     RefPtr<gfxContext> ctx = gfxContext::CreateOrNull(dt);
     if (!ctx)
       return NS_ERROR_FAILURE;
 
-    ImgDrawResult res =
+    DrawResult res =
       imgContainer->Draw(ctx, destSize, ImageRegion::Create(destSize),
                          imgIContainer::FRAME_CURRENT,
                          SamplingFilter::GOOD, /* no SVGImageContext */ Nothing(),
                          imgIContainer::FLAG_SYNC_DECODE, 1.0);
-    if (res == ImgDrawResult::BAD_IMAGE || res == ImgDrawResult::BAD_ARGS) {
+    if (res == DrawResult::BAD_IMAGE || res == DrawResult::BAD_ARGS) {
       return NS_ERROR_FAILURE;
     }
     *aSurface = dt->Snapshot();
   } else {
     *aSurface = aCanvas->GetSurfaceSnapshot();
   }
 
   return result;