Bug 619500 - Disable svg-as-borderimage with viewbox support in gecko 48. r=me, a=lizzard
authorcku <cku@mozilla.com>
Thu, 14 Jul 2016 12:29:34 +0800
changeset 333669 08c34cfb8ed1041f70bdf29faaa045ebc9ff0277
parent 333668 6aadf9572f77373308a5c4319770958e4cbf5566
child 333670 24af5e8917a2a3efabc8f1c614c709282fc2d473
push id6219
push usercbook@mozilla.com
push dateSat, 16 Jul 2016 07:59:46 +0000
treeherdermozilla-beta@08c34cfb8ed1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme, lizzard
bugs619500
milestone48.0
Bug 619500 - Disable svg-as-borderimage with viewbox support in gecko 48. r=me, a=lizzard MozReview-Commit-ID: 3juRznKXZU5
image/ClippedImage.cpp
image/ClippedImage.h
image/ImageOps.cpp
image/ImageOps.h
image/VectorImage.cpp
image/imgIContainer.idl
layout/base/nsCSSRendering.cpp
layout/base/nsCSSRendering.h
layout/reftests/border-image/reftest.list
--- a/image/ClippedImage.cpp
+++ b/image/ClippedImage.cpp
@@ -132,28 +132,21 @@ private:
   const nsIntSize               mSize;
   const Maybe<SVGImageContext>& mSVGContext;
   const uint32_t                mWhichFrame;
   const uint32_t                mFlags;
   DrawResult                    mDrawResult;
 };
 
 ClippedImage::ClippedImage(Image* aImage,
-                           nsIntRect aClip,
-                           const Maybe<nsSize>& aSVGViewportSize)
+                           nsIntRect aClip)
   : ImageWrapper(aImage)
   , mClip(aClip)
 {
   MOZ_ASSERT(aImage != nullptr, "ClippedImage requires an existing Image");
-  MOZ_ASSERT_IF(aSVGViewportSize,
-                aImage->GetType() == imgIContainer::TYPE_VECTOR);
-  if (aSVGViewportSize) {
-    mSVGViewportSize = Some(aSVGViewportSize->ToNearestPixels(
-                                        nsPresContext::AppUnitsPerCSSPixel()));
-  }
 }
 
 ClippedImage::~ClippedImage()
 { }
 
 bool
 ClippedImage::ShouldClip()
 {
@@ -164,25 +157,16 @@ ClippedImage::ShouldClip()
   if (mShouldClip.isNothing()) {
     int32_t width, height;
     RefPtr<ProgressTracker> progressTracker =
       InnerImage()->GetProgressTracker();
     if (InnerImage()->HasError()) {
       // If there's a problem with the inner image we'll let it handle
       // everything.
       mShouldClip.emplace(false);
-    } else if (mSVGViewportSize && !mSVGViewportSize->IsEmpty()) {
-      // Clamp the clipping region to the size of the SVG viewport.
-      nsIntRect svgViewportRect(nsIntPoint(0,0), *mSVGViewportSize);
-
-      mClip = mClip.Intersect(svgViewportRect);
-
-      // If the clipping region is the same size as the SVG viewport size
-      // we don't have to do anything.
-      mShouldClip.emplace(!mClip.IsEqualInterior(svgViewportRect));
     } else if (NS_SUCCEEDED(InnerImage()->GetWidth(&width)) && width > 0 &&
                NS_SUCCEEDED(InnerImage()->GetHeight(&height)) && height > 0) {
       // Clamp the clipping region to the size of the underlying image.
       mClip = mClip.Intersect(nsIntRect(0, 0, width, height));
 
       // If the clipping region is the same size as the underlying image we
       // don't have to do anything.
       mShouldClip.emplace(!mClip.IsEqualInterior(nsIntRect(0, 0, width,
@@ -432,36 +416,28 @@ ClippedImage::DrawSingleTile(gfxContext*
                              const Maybe<SVGImageContext>& aSVGContext,
                              uint32_t aFlags)
 {
   MOZ_ASSERT(!MustCreateSurface(aContext, aSize, aRegion, aFlags),
              "Shouldn't need to create a surface");
 
   gfxRect clip(mClip.x, mClip.y, mClip.width, mClip.height);
   nsIntSize size(aSize), innerSize(aSize);
-  bool needScale = false;
-  if (mSVGViewportSize && !mSVGViewportSize->IsEmpty()) {
-    innerSize = *mSVGViewportSize;
-    needScale = true;
-  } else if (NS_SUCCEEDED(InnerImage()->GetWidth(&innerSize.width)) &&
-             NS_SUCCEEDED(InnerImage()->GetHeight(&innerSize.height))) {
-    needScale = true;
-  } else {
-    MOZ_ASSERT_UNREACHABLE(
-               "If ShouldClip() led us to draw then we should never get here");
-  }
-
-  if (needScale) {
+  if (NS_SUCCEEDED(InnerImage()->GetWidth(&innerSize.width)) &&
+      NS_SUCCEEDED(InnerImage()->GetHeight(&innerSize.height))) {
     double scaleX = aSize.width / clip.width;
     double scaleY = aSize.height / clip.height;
 
     // Map the clip and size to the scale requested by the caller.
     clip.Scale(scaleX, scaleY);
     size = innerSize;
     size.Scale(scaleX, scaleY);
+  } else {
+    MOZ_ASSERT(false,
+               "If ShouldClip() led us to draw then we should never get here");
   }
 
   // We restrict our drawing to only the clipping region, and translate so that
   // the clipping region is placed at the position the caller expects.
   ImageRegion region(aRegion);
   region.MoveBy(clip.x, clip.y);
   region = region.Intersect(clip);
 
@@ -498,27 +474,18 @@ ClippedImage::OptimalImageSizeForDest(co
                                       Filter aFilter, uint32_t aFlags)
 {
   if (!ShouldClip()) {
     return InnerImage()->OptimalImageSizeForDest(aDest, aWhichFrame, aFilter,
                                                  aFlags);
   }
 
   int32_t imgWidth, imgHeight;
-  bool needScale = false;
-  if (mSVGViewportSize && !mSVGViewportSize->IsEmpty()) {
-    imgWidth = mSVGViewportSize->width;
-    imgHeight = mSVGViewportSize->height;
-    needScale = true;
-  } else if (NS_SUCCEEDED(InnerImage()->GetWidth(&imgWidth)) &&
-             NS_SUCCEEDED(InnerImage()->GetHeight(&imgHeight))) {
-    needScale = true;
-  }
-
-  if (needScale) {
+  if (NS_SUCCEEDED(InnerImage()->GetWidth(&imgWidth)) &&
+      NS_SUCCEEDED(InnerImage()->GetHeight(&imgHeight))) {
     // To avoid ugly sampling artifacts, ClippedImage needs the image size to
     // be chosen such that the clipping region lies on pixel boundaries.
 
     // First, we select a scale that's good for ClippedImage. An integer
     // multiple of the size of the clipping region is always fine.
     nsIntSize scale(ceil(aDest.width / mClip.width),
                     ceil(aDest.height / mClip.height));
 
@@ -530,22 +497,22 @@ ClippedImage::OptimalImageSizeForDest(co
                                             aFilter, aFlags);
 
     // To get our final result, we take the inner image's desired size and
     // determine how large the clipped region would be at that scale. (Again, we
     // ensure an integer multiple of the size of the clipping region.)
     nsIntSize finalScale(ceil(double(innerDesiredSize.width) / imgWidth),
                          ceil(double(innerDesiredSize.height) / imgHeight));
     return mClip.Size() * finalScale;
+  }else {
+    MOZ_ASSERT(false,
+               "If ShouldClip() led us to draw then we should never get here");
+    return InnerImage()->OptimalImageSizeForDest(aDest, aWhichFrame, aFilter,
+                                                 aFlags);
   }
-
-  MOZ_ASSERT(false,
-             "If ShouldClip() led us to draw then we should never get here");
-  return InnerImage()->OptimalImageSizeForDest(aDest, aWhichFrame, aFilter,
-                                               aFlags);
 }
 
 NS_IMETHODIMP_(nsIntRect)
 ClippedImage::GetImageSpaceInvalidationRect(const nsIntRect& aRect)
 {
   if (!ShouldClip()) {
     return InnerImage()->GetImageSpaceInvalidationRect(aRect);
   }
--- a/image/ClippedImage.h
+++ b/image/ClippedImage.h
@@ -59,18 +59,17 @@ public:
   NS_IMETHOD_(nsIntRect) GetImageSpaceInvalidationRect(const nsIntRect& aRect)
     override;
   nsIntSize OptimalImageSizeForDest(const gfxSize& aDest,
                                     uint32_t aWhichFrame,
                                     gfx::Filter aFilter,
                                     uint32_t aFlags) override;
 
 protected:
-  ClippedImage(Image* aImage, nsIntRect aClip,
-               const Maybe<nsSize>& aSVGViewportSize);
+  ClippedImage(Image* aImage, nsIntRect aClip);
 
   virtual ~ClippedImage();
 
 private:
   Pair<DrawResult, RefPtr<SourceSurface>>
     GetFrameInternal(const nsIntSize& aSize,
                      const Maybe<SVGImageContext>& aSVGContext,
                      uint32_t aWhichFrame,
@@ -84,18 +83,17 @@ private:
                             const Maybe<SVGImageContext>& aSVGContext,
                             uint32_t aFlags);
 
   // If we are forced to draw a temporary surface, we cache it here.
   UniquePtr<ClippedImageCachedSurface> mCachedSurface;
 
   nsIntRect        mClip;            // The region to clip to.
   Maybe<bool>      mShouldClip;      // Memoized ShouldClip() if present.
-  Maybe<nsIntSize> mSVGViewportSize; // If we're clipping a VectorImage, this
-                                     // is the size of viewport of that image.
+
   friend class DrawSingleTileCallback;
   friend class ImageOps;
 };
 
 } // namespace image
 } // namespace mozilla
 
 #endif // mozilla_image_ClippedImage_h
--- a/image/ImageOps.cpp
+++ b/image/ImageOps.cpp
@@ -35,29 +35,27 @@ ImageOps::Freeze(Image* aImage)
 ImageOps::Freeze(imgIContainer* aImage)
 {
   nsCOMPtr<imgIContainer> frozenImage =
     new FrozenImage(static_cast<Image*>(aImage));
   return frozenImage.forget();
 }
 
 /* static */ already_AddRefed<Image>
-ImageOps::Clip(Image* aImage, nsIntRect aClip,
-               const Maybe<nsSize>& aSVGViewportSize)
+ImageOps::Clip(Image* aImage, nsIntRect aClip)
 {
-  RefPtr<Image> clippedImage = new ClippedImage(aImage, aClip, aSVGViewportSize);
+  RefPtr<Image> clippedImage = new ClippedImage(aImage, aClip);
   return clippedImage.forget();
 }
 
 /* static */ already_AddRefed<imgIContainer>
-ImageOps::Clip(imgIContainer* aImage, nsIntRect aClip,
-               const Maybe<nsSize>& aSVGViewportSize)
+ImageOps::Clip(imgIContainer* aImage, nsIntRect aClip)
 {
   nsCOMPtr<imgIContainer> clippedImage =
-    new ClippedImage(static_cast<Image*>(aImage), aClip, aSVGViewportSize);
+    new ClippedImage(static_cast<Image*>(aImage), aClip);
   return clippedImage.forget();
 }
 
 /* static */ already_AddRefed<Image>
 ImageOps::Orient(Image* aImage, Orientation aOrientation)
 {
   RefPtr<Image> orientedImage = new OrientedImage(aImage, aOrientation);
   return orientedImage.forget();
--- a/image/ImageOps.h
+++ b/image/ImageOps.h
@@ -37,27 +37,20 @@ public:
   static already_AddRefed<Image> Freeze(Image* aImage);
   static already_AddRefed<imgIContainer> Freeze(imgIContainer* aImage);
 
   /**
    * Creates a clipped version of an existing image. Animation is unaffected.
    *
    * @param aImage           The existing image.
    * @param aClip            The rectangle to clip the image against.
-   * @param aSVGViewportSize The specific viewort size of aImage. Unless aImage
-   *                         is a vector image without intrinsic size, this
-   *                         argument should be pass as Nothing().
    */
-  static already_AddRefed<Image> Clip(Image* aImage, nsIntRect aClip,
-                                      const Maybe<nsSize>& aSVGViewportSize =
-                                        Nothing());
+  static already_AddRefed<Image> Clip(Image* aImage, nsIntRect aClip);
   static already_AddRefed<imgIContainer> Clip(imgIContainer* aImage,
-                                              nsIntRect aClip,
-                                              const Maybe<nsSize>& aSVGViewportSize =
-                                                Nothing());
+                                              nsIntRect aClip);
 
   /**
    * Creates a version of an existing image which is rotated and/or flipped to
    * the specified orientation.
    *
    * @param aImage         The existing image.
    * @param aOrientation   The desired orientation.
    */
--- a/image/VectorImage.cpp
+++ b/image/VectorImage.cpp
@@ -826,42 +826,25 @@ VectorImage::Draw(gfxContext* aContext,
 
   if (mAnimationConsumers == 0 && mProgressTracker) {
     mProgressTracker->OnUnlockedDraw();
   }
 
   AutoRestore<bool> autoRestoreIsDrawing(mIsDrawing);
   mIsDrawing = true;
 
-  Maybe<SVGImageContext> svgContext;
-  // If FLAG_FORCE_PRESERVEASPECTRATIO_NONE bit is set, that mean we should
-  // overwrite SVG preserveAspectRatio attibute of this image with none, and
-  // always stretch this image to viewport non-uniformly.
-  // And we can do this only if the caller pass in the the SVG viewport, via
-  // aSVGContext.
-  if ((aFlags & FLAG_FORCE_PRESERVEASPECTRATIO_NONE) && aSVGContext.isSome()) {
-    Maybe<SVGPreserveAspectRatio> aspectRatio =
-      Some(SVGPreserveAspectRatio(SVG_PRESERVEASPECTRATIO_NONE,
-                                  SVG_MEETORSLICE_UNKNOWN));
-    svgContext =
-      Some(SVGImageContext(aSVGContext->GetViewportSize(),
-                           aspectRatio));
-  } else {
-    svgContext = aSVGContext;
-  }
-
   float animTime =
     (aWhichFrame == FRAME_FIRST) ? 0.0f
                                  : mSVGDocumentWrapper->GetCurrentTime();
-  AutoSVGRenderingState autoSVGState(svgContext, animTime,
+  AutoSVGRenderingState autoSVGState(aSVGContext, animTime,
                                      mSVGDocumentWrapper->GetRootSVGElem());
 
 
   SVGDrawingParameters params(aContext, aSize, aRegion, aFilter,
-                              svgContext, animTime, aFlags);
+                              aSVGContext, animTime, aFlags);
 
   if (aFlags & FLAG_BYPASS_SURFACE_CACHE) {
     CreateSurfaceAndShow(params);
     return DrawResult::SUCCESS;
   }
 
   LookupResult result =
     SurfaceCache::Lookup(ImageKey(this),
--- a/image/imgIContainer.idl
+++ b/image/imgIContainer.idl
@@ -180,38 +180,27 @@ interface imgIContainer : nsISupports
    * DataSourceSurface instead of a hardware accelerated surface. This can be
    * important for performance (by avoiding an upload to/readback from the GPU)
    * when the caller knows they want a SourceSurface of type DATA.
    *
    * FLAG_BYPASS_SURFACE_CACHE: Forces drawing to happen rather than taking
    * cached rendering from the surface cache. This is used when we are printing,
    * for example, where we want the vector commands from VectorImages to end up
    * in the PDF output rather than a cached rendering at screen resolution.
-   *
-   * FLAG_FORCE_PRESERVEASPECTRATIO_NONE: Force scaling this image
-   * non-uniformly if necessary. This flag is for vector image only. A raster
-   * image should ignore this flag. While drawing a vector image with this
-   * flag, do not force uniform scaling even if its root <svg> node has a
-   * preserveAspectRatio attribute that would otherwise require uniform
-   * scaling , such as xMinYMin/ xMidYMin. Always scale the graphic content of
-   * the given image non-uniformly if necessary such that the image's
-   * viewBox (if specified or implied by height/width attributes) exactly
-   * matches the viewport rectangle.
    */
   const unsigned long FLAG_NONE                            = 0x0;
   const unsigned long FLAG_SYNC_DECODE                     = 0x1;
   const unsigned long FLAG_SYNC_DECODE_IF_FAST             = 0x2;
   const unsigned long FLAG_ASYNC_NOTIFY                    = 0x4;
   const unsigned long FLAG_DECODE_NO_PREMULTIPLY_ALPHA     = 0x8;
   const unsigned long FLAG_DECODE_NO_COLORSPACE_CONVERSION = 0x10;
   const unsigned long FLAG_CLAMP                           = 0x20;
   const unsigned long FLAG_HIGH_QUALITY_SCALING            = 0x40;
   const unsigned long FLAG_WANT_DATA_SURFACE               = 0x80;
   const unsigned long FLAG_BYPASS_SURFACE_CACHE            = 0x100;
-  const unsigned long FLAG_FORCE_PRESERVEASPECTRATIO_NONE  = 0x200;
 
   /**
    * A constant specifying the default set of decode flags (i.e., the default
    * values for FLAG_DECODE_*).
    */
   const unsigned long DECODE_FLAGS_DEFAULT = 0;
 
   /**
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -3710,37 +3710,28 @@ DrawBorderImage(nsPresContext*       aPr
         unitSize.width = borderWidth[i];
         unitSize.height = borderHeight[j];
         fillStyleH = NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH;
         fillStyleV = NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH;
       }
 
       nsRect destArea(borderX[i], borderY[j], borderWidth[i], borderHeight[j]);
       nsRect subArea(sliceX[i], sliceY[j], sliceWidth[i], sliceHeight[j]);
-      if (subArea.IsEmpty())
-        continue;
 
       nsIntRect intSubArea = subArea.ToOutsidePixels(nsPresContext::AppUnitsPerCSSPixel());
-      // intrinsicSize.CanComputeConcreteSize() return false means we can not
-      // read intrinsic size from aStyleBorder.mBorderImageSource.
-      // In this condition, we pass imageSize(a resolved size comes from
-      // default sizing algorithm) to renderer as the viewport size.
-      Maybe<nsSize> svgViewportSize = intrinsicSize.CanComputeConcreteSize() ?
-        Nothing() : Some(imageSize);
 
       result &=
         renderer.DrawBorderImageComponent(aPresContext,
                                           aRenderingContext, aDirtyRect,
                                           destArea, CSSIntRect(intSubArea.x,
                                                                intSubArea.y,
                                                                intSubArea.width,
                                                                intSubArea.height),
                                           fillStyleH, fillStyleV,
-                                          unitSize, j * (RIGHT + 1) + i,
-                                          svgViewportSize);
+                                          unitSize, j * (RIGHT + 1) + i);
     }
   }
 
   return result;
 }
 
 // Begin table border-collapsing section
 // These functions were written to not disrupt the normal ones and yet satisfy some additional requirements
@@ -4770,18 +4761,17 @@ nsImageRenderer::PrepareImage()
           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());
+                                                            actualCropRect);
           mImageContainer.swap(subImage);
         }
       }
       mPrepareResult = DrawResult::SUCCESS;
       break;
     }
     case eStyleImageType_Gradient:
       mGradientData = mImage->GetGradientData();
@@ -5306,43 +5296,34 @@ DrawResult
 nsImageRenderer::DrawBorderImageComponent(nsPresContext*       aPresContext,
                                           nsRenderingContext&  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)
+                                          uint8_t              aIndex)
 {
   if (!IsReady()) {
     NS_NOTREACHED("Ensure PrepareImage() has returned true before calling me");
     return DrawResult::BAD_ARGS;
   }
   if (aFill.IsEmpty() || aSrc.IsEmpty()) {
     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.
-    // To get correct rendering result, we add
-    // FLAG_FORCE_PRESERVEASPECTRATIO_NONE flag here, to tell mImage to ignore
-    // preserveAspectRatio attribute, and always do non-uniform stretch.
-    uint32_t drawFlags = ConvertImageRendererToDrawFlags(mFlags) |
-                           imgIContainer::FLAG_FORCE_PRESERVEASPECTRATIO_NONE;
     // Retrieve or create the subimage we'll draw.
     nsIntRect srcRect(aSrc.x, aSrc.y, aSrc.width, aSrc.height);
     if (mType == eStyleImageType_Image) {
       if ((subImage = mImage->GetSubImage(aIndex)) == nullptr) {
-        subImage = ImageOps::Clip(mImageContainer, srcRect, aSVGViewportSize);
+        subImage = ImageOps::Clip(mImageContainer, srcRect);
         mImage->SetSubImage(aIndex, subImage);
       }
     } else {
       // This path, for eStyleImageType_Element, is currently slower than it
       // needs to be because we don't cache anything. (In particular, if we have
       // to draw to a temporary surface inside ClippedImage, we don't cache that
       // temporary surface since we immediately throw the ClippedImage we create
       // here away.) However, if we did cache, we'd need to know when to
@@ -5352,41 +5333,38 @@ nsImageRenderer::DrawBorderImageComponen
       RefPtr<gfxDrawable> drawable = DrawableForElement(nsRect(nsPoint(), mSize),
                                                           aRenderingContext);
       if (!drawable) {
         NS_WARNING("Could not create drawable for element");
         return DrawResult::TEMPORARY_ERROR;
       }
 
       nsCOMPtr<imgIContainer> image(ImageOps::CreateFromDrawable(drawable));
-      subImage = ImageOps::Clip(image, srcRect, aSVGViewportSize);
+      subImage = ImageOps::Clip(image, srcRect);
     }
 
-    MOZ_ASSERT_IF(aSVGViewportSize,
-                  subImage->GetType() == imgIContainer::TYPE_VECTOR);
-
     Filter filter = nsLayoutUtils::GetGraphicsFilterForFrame(mForFrame);
 
     if (!RequiresScaling(aFill, aHFill, aVFill, aUnitSize)) {
       return nsLayoutUtils::DrawSingleImage(*aRenderingContext.ThebesContext(),
                                             aPresContext,
                                             subImage,
                                             filter,
                                             aFill, aDirtyRect,
                                             nullptr,
-                                            drawFlags);
+                                            ConvertImageRendererToDrawFlags(mFlags));
     }
 
     nsRect tile = ComputeTile(aFill, aHFill, aVFill, aUnitSize);
     return nsLayoutUtils::DrawImage(*aRenderingContext.ThebesContext(),
                                     aPresContext,
                                     subImage,
                                     filter,
                                     tile, aFill, tile.TopLeft(), aDirtyRect,
-                                    drawFlags);
+                                    ConvertImageRendererToDrawFlags(mFlags));
   }
 
   nsRect destTile = RequiresScaling(aFill, aHFill, aVFill, aUnitSize)
                   ? ComputeTile(aFill, aHFill, aVFill, aUnitSize)
                   : aFill;
 
   return Draw(aPresContext, aRenderingContext, aDirtyRect, destTile,
               aFill, destTile.TopLeft(), aSrc);
--- a/layout/base/nsCSSRendering.h
+++ b/layout/base/nsCSSRendering.h
@@ -226,32 +226,27 @@ public:
    * aFill), if aSrc and the dest tile are different sizes, the image will be
    * scaled to map aSrc onto the dest tile.
    * aHFill and aVFill are the repeat patterns for the component -
    * NS_STYLE_BORDER_IMAGE_REPEAT_*
    * aUnitSize The scaled size of a single source rect (in destination coords)
    * aIndex identifies the component: 0 1 2
    *                                  3 4 5
    *                                  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.
    */
   DrawResult
   DrawBorderImageComponent(nsPresContext*       aPresContext,
                            nsRenderingContext&  aRenderingContext,
                            const nsRect&        aDirtyRect,
                            const nsRect&        aFill,
                            const mozilla::CSSIntRect& aSrc,
                            uint8_t              aHFill,
                            uint8_t              aVFill,
                            const nsSize&        aUnitSize,
-                           uint8_t              aIndex,
-                           const mozilla::Maybe<nsSize>& aSVGViewportSize);
+                           uint8_t              aIndex);
 
   bool IsRasterImage();
   bool IsAnimatedImage();
 
   /// Retrieves the image associated with this nsImageRenderer, if there is one.
   already_AddRefed<imgIContainer> GetImage();
 
   bool IsReady() const { return mPrepareResult == DrawResult::SUCCESS; }
--- a/layout/reftests/border-image/reftest.list
+++ b/layout/reftests/border-image/reftest.list
@@ -78,12 +78,8 @@ fuzzy(1,1058) fails-if(OSX) fuzzy-if(ski
 fuzzy(1,602) == border-image-repeating-radial-gradient-width.html border-image-repeating-radial-gradient-width-ref.html
 fuzzy(3,18000) fails-if(OSX) fuzzy-if(skiaContent,4,10305) == border-image-repeating-radial-gradient-slice-width.html border-image-repeating-radial-gradient-slice-width-ref.html
 == border-image-repeating-radial-gradient-repeat-repeat-2.html border-image-repeating-radial-gradient-repeat-repeat-2-ref.html
 fuzzy(1,1054) fails-if(OSX) fuzzy-if(skiaContent,2,500) == border-image-repeating-radial-gradient-repeat-round-2.html border-image-repeating-radial-gradient-repeat-round-2-ref.html
 
 # border-image-source (-moz-)element
 fuzzy(125,5808) fuzzy-if(B2G,151,5809) == border-image-element.html border-image-element-ref.html
 
-# svg-as-border-image
-== svg-as-border-image-1a.html svg-as-border-image-1-ref.html
-== svg-as-border-image-1b.html svg-as-border-image-1-ref.html
-== svg-as-border-image-1c.html svg-as-border-image-1-ref.html