Bug 456219. Fix clipping to padding-rect with rounded corners. r+sr=roc
authorZack Weinberg <zweinberg@mozilla.com>
Fri, 09 Jan 2009 13:28:32 +1300
changeset 23493 17b08b9bae0c09e83008001180815046080f3f04
parent 23492 6b858b6ab1627f387afd03dc7dd6759cd766564a
child 23494 320763cc1e6a57ffbaba24de5139d69137815817
push idunknown
push userunknown
push dateunknown
bugs456219
milestone1.9.2a1pre
Bug 456219. Fix clipping to padding-rect with rounded corners. r+sr=roc
layout/base/nsCSSRendering.cpp
layout/base/nsCSSRenderingBorders.cpp
layout/base/nsCSSRenderingBorders.h
layout/reftests/bugs/456219-1-mask-wArA.png
layout/reftests/bugs/456219-1-mask-wArB.png
layout/reftests/bugs/456219-1-mask-wArC.png
layout/reftests/bugs/456219-1-mask-wArD.png
layout/reftests/bugs/456219-1-mask-wArE.png
layout/reftests/bugs/456219-1-mask-wBrA.png
layout/reftests/bugs/456219-1-mask-wBrB.png
layout/reftests/bugs/456219-1-mask-wBrC.png
layout/reftests/bugs/456219-1-mask-wBrD.png
layout/reftests/bugs/456219-1-mask-wBrE.png
layout/reftests/bugs/456219-1-mask-wCrA.png
layout/reftests/bugs/456219-1-mask-wCrB.png
layout/reftests/bugs/456219-1-mask-wCrC.png
layout/reftests/bugs/456219-1-mask-wCrD.png
layout/reftests/bugs/456219-1-mask-wCrE.png
layout/reftests/bugs/456219-1-mask-wDrA.png
layout/reftests/bugs/456219-1-mask-wDrB.png
layout/reftests/bugs/456219-1-mask-wDrC.png
layout/reftests/bugs/456219-1-mask-wDrD.png
layout/reftests/bugs/456219-1-mask-wDrE.png
layout/reftests/bugs/456219-1-mask-wErA.png
layout/reftests/bugs/456219-1-mask-wErB.png
layout/reftests/bugs/456219-1-mask-wErC.png
layout/reftests/bugs/456219-1-mask-wErD.png
layout/reftests/bugs/456219-1-mask-wErE.png
layout/reftests/bugs/456219-1-ref.html
layout/reftests/bugs/456219-1a.html
layout/reftests/bugs/456219-1b.html
layout/reftests/bugs/456219-1c.html
layout/reftests/bugs/456219-2-mask.png
layout/reftests/bugs/456219-2-ref.html
layout/reftests/bugs/456219-2.html
layout/reftests/bugs/reftest.list
--- a/layout/base/nsCSSRendering.cpp
+++ b/layout/base/nsCSSRendering.cpp
@@ -273,24 +273,16 @@ static void DrawBorderImageSide(gfxConte
                                 nsIDeviceContext* aDeviceContext,
                                 imgIContainer* aImage,
                                 gfxRect& aDestRect,
                                 gfxSize aInterSize,
                                 gfxRect& aSourceRect,
                                 PRUint8 aHFillType,
                                 PRUint8 aVFillType);
 
-static void PaintBackgroundColor(nsPresContext* aPresContext,
-                                 nsIRenderingContext& aRenderingContext,
-                                 nsIFrame* aForFrame,
-                                 const nsRect& aBgClipArea,
-                                 const nsStyleBackground& aColor,
-                                 const nsStyleBorder& aBorder,
-                                 PRBool aCanPaintNonWhite);
-
 static nscolor MakeBevelColor(PRIntn whichSide, PRUint8 style,
                               nscolor aBackgroundColor,
                               nscolor aBorderColor);
 
 static gfxRect GetTextDecorationRectInternal(const gfxPoint& aPt,
                                              const gfxSize& aLineSize,
                                              const gfxFloat aAscent,
                                              const gfxFloat aOffset,
@@ -1242,18 +1234,17 @@ IsSolidBorderEdge(const nsStyleBorder& a
 }
 
 /**
  * Returns true if all border edges are either missing or opaque.
  */
 static PRBool
 IsSolidBorder(const nsStyleBorder& aBorder)
 {
-  if (aBorder.mBorderColors ||
-      nsLayoutUtils::HasNonZeroCorner(aBorder.mBorderRadius))
+  if (aBorder.mBorderColors)
     return PR_FALSE;
   for (PRUint32 i = 0; i < 4; ++i) {
     if (!IsSolidBorderEdge(aBorder, i))
       return PR_FALSE;
   }
   return PR_TRUE;
 }
 
@@ -1266,86 +1257,197 @@ nsCSSRendering::PaintBackgroundWithSC(ns
                                       const nsStyleBackground& aColor,
                                       const nsStyleBorder& aBorder,
                                       PRBool aUsePrintSettings,
                                       nsRect* aBGClipRect)
 {
   NS_PRECONDITION(aForFrame,
                   "Frame is expected to be provided to PaintBackground");
 
-  PRBool canDrawBackgroundImage = PR_TRUE;
-  PRBool canDrawBackgroundColor = PR_TRUE;
-
-  if (aUsePrintSettings) {
-    canDrawBackgroundImage = aPresContext->GetBackgroundImageDraw();
-    canDrawBackgroundColor = aPresContext->GetBackgroundColorDraw();
-  }
-
   // Check to see if we have an appearance defined.  If so, we let the theme
   // renderer draw the background and bail out.
+  // XXXzw this ignores aBGClipRect.
   const nsStyleDisplay* displayData = aForFrame->GetStyleDisplay();
   if (displayData->mAppearance) {
     nsITheme *theme = aPresContext->GetTheme();
-    if (theme && theme->ThemeSupportsWidget(aPresContext, aForFrame, displayData->mAppearance)) {
+    if (theme && theme->ThemeSupportsWidget(aPresContext, aForFrame,
+                                            displayData->mAppearance)) {
       nsRect dirty;
       dirty.IntersectRect(aDirtyRect, aBorderArea);
       theme->DrawWidgetBackground(&aRenderingContext, aForFrame, 
                                   displayData->mAppearance, aBorderArea, dirty);
       return;
     }
   }
 
-  // Same coordinate space as aBorderArea
-  nsRect bgClipArea;
-  if (aBGClipRect) {
-    bgClipArea = *aBGClipRect;
+  // Determine whether we are drawing background images and/or
+  // background colors.
+  PRBool drawBackgroundImage = PR_TRUE;
+  PRBool drawBackgroundColor = PR_TRUE;
+
+  if (aUsePrintSettings) {
+    drawBackgroundImage = aPresContext->GetBackgroundImageDraw();
+    drawBackgroundColor = aPresContext->GetBackgroundColorDraw();
+  }
+
+  if ((aColor.mBackgroundFlags & NS_STYLE_BG_IMAGE_NONE) ||
+      !aColor.mBackgroundImage) {
+    NS_ASSERTION((aColor.mBackgroundFlags & NS_STYLE_BG_IMAGE_NONE) &&
+                 !aColor.mBackgroundImage, "background flags/image mismatch");
+    drawBackgroundImage = PR_FALSE;
+  }
+
+  // If GetBackgroundColorDraw() is false, we are still expected to
+  // draw color in the background of any frame that's not completely
+  // transparent, but we are expected to use white instead of whatever
+  // color was specified.
+  nscolor bgColor;
+  if (drawBackgroundColor) {
+    bgColor = aColor.mBackgroundColor;
+    if (NS_GET_A(bgColor) == 0)
+      drawBackgroundColor = PR_FALSE;
+  } else {
+    bgColor = NS_RGB(255, 255, 255);
+    if (drawBackgroundImage || NS_GET_A(aColor.mBackgroundColor) > 0)
+      drawBackgroundColor = PR_TRUE;
   }
-  else {
-    // The background is rendered over the 'background-clip' area.
-    bgClipArea = aBorderArea;
-    // If the border is solid, then clip the background to the padding-box
-    // so that we don't draw unnecessary tiles.
-    if (aColor.mBackgroundClip != NS_STYLE_BG_CLIP_BORDER ||
-        IsSolidBorder(aBorder)) {
-      nsMargin border = aForFrame->GetUsedBorder();
-      aForFrame->ApplySkipSides(border);
-      bgClipArea.Deflate(border);
+
+  // 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;
+
+  // Compute the outermost boundary of the area that might be painted.
+  gfxContext *ctx = aRenderingContext.ThebesContext();
+  nscoord appUnitsPerPixel = aPresContext->AppUnitsPerDevPixel();
+
+  // Same coordinate space as aBorderArea & aBGClipRect
+  nsRect bgArea;
+  gfxCornerSizes bgRadii;
+  PRBool haveRoundedCorners;
+  PRBool radiiAreOuter = PR_TRUE;
+  {
+    nscoord radii[8];
+    haveRoundedCorners =
+      GetBorderRadiusTwips(aBorder.mBorderRadius, aForFrame->GetSize().width,
+                           radii);
+    if (haveRoundedCorners)
+      ComputePixelRadii(radii, aBorderArea, aForFrame->GetSkipSides(),
+                        appUnitsPerPixel, &bgRadii);
+  }
+  
+  // The background is rendered over the 'background-clip' area,
+  // which is normally equal to the border area but may be reduced
+  // to the padding area by CSS.  Also, if the border is solid, we
+  // don't need to draw outside the padding area.  In either case,
+  // if the borders are rounded, make sure we use the same inner
+  // radii as the border code will.
+  bgArea = aBorderArea;
+  if (aColor.mBackgroundClip != NS_STYLE_BG_CLIP_BORDER ||
+      IsSolidBorder(aBorder)) {
+    nsMargin border = aForFrame->GetUsedBorder();
+    aForFrame->ApplySkipSides(border);
+    bgArea.Deflate(border);
+    if (haveRoundedCorners) {
+      gfxCornerSizes outerRadii = bgRadii;
+      gfxFloat borderSizes[4] = {
+        border.top / appUnitsPerPixel, border.right / appUnitsPerPixel,
+        border.bottom / appUnitsPerPixel, border.left / appUnitsPerPixel
+      };
+      nsCSSBorderRenderer::ComputeInnerRadii(outerRadii, borderSizes,
+                                             &bgRadii);
+      radiiAreOuter = PR_FALSE;
     }
   }
 
-  gfxContext *ctx = aRenderingContext.ThebesContext();
+  // The 'bgClipArea' (used only by the image tiling logic, far below)
+  // is the caller-provided aBGClipRect if any, or else the bgArea
+  // computed above.  (Arguably it should be the intersection, but
+  // that breaks the table painter -- in particular, honoring the
+  // bgArea when we have aBGClipRect breaks reftests/bugs/403429-1[ab].)
+  // The dirtyRect is the intersection of that rectangle with the
+  // caller-provided aDirtyRect.  If the dirtyRect is empty there is
+  // nothing to draw.
 
-  // The actual dirty rect is the intersection of the 'background-clip'
-  // area and the dirty rect we were given
+  nsRect bgClipArea;
+  if (aBGClipRect)
+    bgClipArea = *aBGClipRect;
+  else
+    bgClipArea = bgArea;
+
   nsRect dirtyRect;
-  if (!dirtyRect.IntersectRect(bgClipArea, aDirtyRect)) {
-    // Nothing to paint
+  dirtyRect.IntersectRect(bgClipArea, aDirtyRect);
+
+  if (dirtyRect.IsEmpty())
+    return;
+
+  // Compute the Thebes equivalent of the dirtyRect.
+  gfxRect dirtyRectGfx(RectToGfxRect(dirtyRect, appUnitsPerPixel));
+  dirtyRectGfx.Round();
+  dirtyRectGfx.Condition();
+  if (dirtyRectGfx.IsEmpty()) {
+    NS_WARNING("converted dirty rect should not be empty");
     return;
   }
 
-  // if there is no background image or background images are turned off, try a color.
-  if (!aColor.mBackgroundImage || !canDrawBackgroundImage) {
-    PaintBackgroundColor(aPresContext, aRenderingContext, aForFrame, bgClipArea,
-                         aColor, aBorder, canDrawBackgroundColor);
+  // If we have rounded corners, clip all subsequent drawing to the
+  // rounded rectangle defined by bgArea and bgRadii (we don't know
+  // whether the rounded corners intrude on the dirtyRect or not).
+  // Do not do this if we have a caller-provided clip rect --
+  // as above with bgArea, arguably a bug, but table painting seems
+  // to depend on it.
+
+  gfxContextAutoSaveRestore autoSR;
+  if (haveRoundedCorners && !aBGClipRect) {
+    gfxRect bgAreaGfx(RectToGfxRect(bgArea, appUnitsPerPixel));
+    bgAreaGfx.Round();
+    bgAreaGfx.Condition();
+    if (bgAreaGfx.IsEmpty()) {
+      NS_WARNING("converted background area should not be empty");
+      return;
+    }
+
+    autoSR.SetContext(ctx);
+    ctx->NewPath();
+    ctx->RoundedRectangle(bgAreaGfx, bgRadii, radiiAreOuter);
+    ctx->Clip();
+  }
+
+  // If we might be using a background color, go ahead and set it now.
+  if (drawBackgroundColor)
+    ctx->SetColor(gfxRGBA(bgColor));
+
+  // 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) {
+    ctx->NewPath();
+    ctx->Rectangle(dirtyRectGfx);
+    ctx->Fill();
     return;
   }
 
-  // We have a background image
-
   // Lookup the image
   imgIRequest *req = aPresContext->LoadImage(aColor.mBackgroundImage,
                                              aForFrame);
 
   PRUint32 status = imgIRequest::STATUS_ERROR;
   if (req)
     req->GetImageStatus(&status);
 
-  if (!req || !(status & imgIRequest::STATUS_FRAME_COMPLETE) || !(status & imgIRequest::STATUS_SIZE_AVAILABLE)) {
-    PaintBackgroundColor(aPresContext, aRenderingContext, aForFrame, bgClipArea,
-                         aColor, aBorder, canDrawBackgroundColor);
+  // While waiting for the image, draw a color, if any.
+  if (!req ||
+      !(status & imgIRequest::STATUS_FRAME_COMPLETE) ||
+      !(status & imgIRequest::STATUS_SIZE_AVAILABLE)) {
+    if (drawBackgroundColor) {
+      ctx->NewPath();
+      ctx->Rectangle(dirtyRectGfx);
+      ctx->Fill();
+    }
     return;
   }
 
   nsCOMPtr<imgIContainer> image;
   req->GetImage(getter_AddRefs(image));
 
   nsSize imageSize;
   image->GetWidth(&imageSize.width);
@@ -1398,56 +1500,60 @@ nsCSSRendering::PaintBackgroundWithSC(ns
       nsMargin padding = geometryFrame->GetUsedPadding();
       geometryFrame->ApplySkipSides(padding);
       bgOriginRect.Deflate(padding);
       NS_ASSERTION(aColor.mBackgroundOrigin == NS_STYLE_BG_ORIGIN_CONTENT,
                    "unknown background-origin value");
     }
   }
 
-  PRBool  needBackgroundColor = NS_GET_A(aColor.mBackgroundColor) > 0;
   PRIntn  repeat = aColor.mBackgroundRepeat;
-
   switch (repeat) {
     case NS_STYLE_BG_REPEAT_X:
       break;
     case NS_STYLE_BG_REPEAT_Y:
       break;
     case NS_STYLE_BG_REPEAT_XY:
-      if (needBackgroundColor) {
-        // If the image is completely opaque, we do not need to paint the
-        // background color
+      if (drawBackgroundColor) {
+        // If the image is completely opaque, we may not need to paint
+        // the background color.
         nsCOMPtr<gfxIImageFrame> gfxImgFrame;
         image->GetCurrentFrame(getter_AddRefs(gfxImgFrame));
         if (gfxImgFrame) {
-          gfxImgFrame->GetNeedsBackground(&needBackgroundColor);
-
-          /* check for tiling of a image where frame smaller than container */
-          nsSize iSize;
-          image->GetWidth(&iSize.width);
-          image->GetHeight(&iSize.height);
-          nsRect iframeRect;
-          gfxImgFrame->GetRect(iframeRect);
-          if (iSize.width != iframeRect.width ||
-              iSize.height != iframeRect.height) {
-            needBackgroundColor = PR_TRUE;
+          gfxImgFrame->GetNeedsBackground(&drawBackgroundColor);
+          if (!drawBackgroundColor) {
+            // If the current frame is smaller than its container, we
+            // need to paint the background color even if the frame
+            // itself is opaque.
+            nsSize iSize;
+            image->GetWidth(&iSize.width);
+            image->GetHeight(&iSize.height);
+            nsRect iframeRect;
+            gfxImgFrame->GetRect(iframeRect);
+            if (iSize.width != iframeRect.width ||
+                iSize.height != iframeRect.height) {
+              drawBackgroundColor = PR_TRUE;
+            }
           }
         }
       }
       break;
     case NS_STYLE_BG_REPEAT_OFF:
     default:
-      NS_ASSERTION(repeat == NS_STYLE_BG_REPEAT_OFF, "unknown background-repeat value");
+      NS_ASSERTION(repeat == NS_STYLE_BG_REPEAT_OFF,
+                   "unknown background-repeat value");
       break;
   }
 
-  // The background color is rendered over the 'background-clip' area
-  if (needBackgroundColor) {
-    PaintBackgroundColor(aPresContext, aRenderingContext, aForFrame, bgClipArea,
-                         aColor, aBorder, canDrawBackgroundColor);
+  // The background color is rendered over the entire dirty area,
+  // even if the image isn't.
+  if (drawBackgroundColor) {
+    ctx->NewPath();
+    ctx->Rectangle(dirtyRectGfx);
+    ctx->Fill();
   }
 
   // Compute the anchor point.
   //
   // relative to aBorderArea.TopLeft() (which is where the top-left
   // of aForFrame's border-box will be rendered)
   nsPoint imageTopLeft, anchor;
   if (NS_STYLE_BG_ATTACHMENT_FIXED == aColor.mBackgroundAttachment) {
@@ -1494,54 +1600,30 @@ nsCSSRendering::PaintBackgroundWithSC(ns
     anchor += offset;
   } else {
     ComputeBackgroundAnchorPoint(aColor, bgOriginRect.Size(), imageSize,
                                  &imageTopLeft, &anchor);
     imageTopLeft += bgOriginRect.TopLeft();
     anchor += bgOriginRect.TopLeft();
   }
 
-  ctx->Save();
-
-  nscoord borderRadii[8];
-  PRBool haveRadius = GetBorderRadiusTwips(aBorder.mBorderRadius,
-                                           aForFrame->GetSize().width,
-                                           borderRadii);
-  if (haveRadius) {
-    nscoord appUnitsPerPixel = aPresContext->DevPixelsToAppUnits(1);
-    gfxCornerSizes radii;
-    ComputePixelRadii(borderRadii, bgClipArea,
-                      aForFrame ? aForFrame->GetSkipSides() : 0,
-                      appUnitsPerPixel, &radii);
-
-    gfxRect oRect(RectToGfxRect(bgClipArea, appUnitsPerPixel));
-    oRect.Round();
-    oRect.Condition();
-
-    ctx->NewPath();
-    ctx->RoundedRectangle(oRect, radii);
-    ctx->Clip();
-  }
-
   nsRect destArea(imageTopLeft + aBorderArea.TopLeft(), imageSize);
   nsRect fillArea = destArea;
   if (repeat & NS_STYLE_BG_REPEAT_X) {
     fillArea.x = bgClipArea.x;
     fillArea.width = bgClipArea.width;
   }
   if (repeat & NS_STYLE_BG_REPEAT_Y) {
     fillArea.y = bgClipArea.y;
     fillArea.height = bgClipArea.height;
   }
   fillArea.IntersectRect(fillArea, bgClipArea);
 
   nsLayoutUtils::DrawImage(&aRenderingContext, image,
       destArea, fillArea, anchor + aBorderArea.TopLeft(), dirtyRect);
-
-  ctx->Restore();
 }
 
 static void
 DrawBorderImage(nsPresContext* aPresContext,
                 nsIRenderingContext& aRenderingContext,
                 nsIFrame* aForFrame, const nsRect& aBorderArea,
                 const nsStyleBorder& aBorderStyle)
 {
@@ -1925,88 +2007,16 @@ DrawBorderImageSide(gfxContext *aThebesC
   aThebesContext->SetPattern(pattern);
   aThebesContext->NewPath();
   aThebesContext->Rectangle(gfxRect(renderOffset, rectSize));
   aThebesContext->SetOperator(gfxContext::OPERATOR_ADD);
   aThebesContext->Fill();
   aThebesContext->Restore();
 }
 
-static void
-PaintBackgroundColor(nsPresContext* aPresContext,
-                     nsIRenderingContext& aRenderingContext,
-                     nsIFrame* aForFrame,
-                     const nsRect& aBgClipArea,
-                     const nsStyleBackground& aColor,
-                     const nsStyleBorder& aBorder,
-                     PRBool aCanPaintNonWhite)
-{
-  // If we're only allowed to paint white, then don't bail out on transparent
-  // color if we're not completely transparent.  See the corresponding check
-  // for whether we're allowed to paint background images in
-  // PaintBackgroundWithSC before the first call to PaintBackgroundColor.
-  if (NS_GET_A(aColor.mBackgroundColor) == 0 &&
-      (aCanPaintNonWhite || aColor.IsTransparent())) {
-    // nothing to paint
-    return;
-  }
-
-  nscolor color = aColor.mBackgroundColor;
-  if (!aCanPaintNonWhite) {
-    color = NS_RGB(255, 255, 255);
-  }
-  aRenderingContext.SetColor(color);
-
-  if (!nsLayoutUtils::HasNonZeroCorner(aBorder.mBorderRadius)) {
-    aRenderingContext.FillRect(aBgClipArea);
-    return;
-  }
-
-  gfxContext *ctx = aRenderingContext.ThebesContext();
-
-  // needed for our border thickness
-  nscoord appUnitsPerPixel = aPresContext->AppUnitsPerDevPixel();
-
-  nscoord borderRadii[8];
-  GetBorderRadiusTwips(aBorder.mBorderRadius, aForFrame->GetSize().width,
-                       borderRadii);
-
-  // the bgClipArea is the outside
-  gfxRect oRect(RectToGfxRect(aBgClipArea, appUnitsPerPixel));
-  oRect.Round();
-  oRect.Condition();
-  if (oRect.IsEmpty())
-    return;
-
-  // convert the radii
-  gfxCornerSizes radii;
-  ComputePixelRadii(borderRadii, aBgClipArea,
-                    aForFrame ? aForFrame->GetSkipSides() : 0,
-                    appUnitsPerPixel, &radii);
-
-  // Add 1.0 to any border radii; if we don't, the border and background
-  // curves will combine to have fringing at the rounded corners.  Since
-  // alpha is used for coverage, we have problems because the border and
-  // background should have identical coverage, and the border should
-  // overlay the background exactly.  The way to avoid this is by using
-  // a supersampling scheme, but we don't have the mechanism in place to do
-  // this.  So, this will do for now.
-  for (int i = 0; i < 4; i++) {
-    if (radii[i].width > 0.0)
-      radii[i].width += 1.0;
-    if (radii[i].height > 0.0)
-      radii[i].height += 1.0;
-  }
-
-  ctx->NewPath();
-  ctx->RoundedRectangle(oRect, radii);
-  ctx->Fill();
-}
-
-
 // Begin table border-collapsing section
 // These functions were written to not disrupt the normal ones and yet satisfy some additional requirements
 // At some point, all functions should be unified to include the additional functionality that these provide
 
 static nscoord
 RoundIntToPixel(nscoord aValue, 
                 nscoord aTwipsPerPixel,
                 PRBool  aRoundDown = PR_FALSE)
--- a/layout/base/nsCSSRenderingBorders.cpp
+++ b/layout/base/nsCSSRenderingBorders.cpp
@@ -95,20 +95,16 @@
  *         |- DrawDashedSide || DrawBorderSides with one side
  */
 
 static void ComputeBorderCornerDimensions(const gfxRect& aOuterRect,
                                           const gfxRect& aInnerRect,
                                           const gfxCornerSizes& aRadii,
                                           gfxCornerSizes *aDimsResult);
 
-static void ComputeInnerRadii(const gfxCornerSizes& radii,
-                              const gfxFloat *borderSizes,
-                              gfxCornerSizes *innerRadii);
-
 // given a side index, get the previous and next side index
 #define NEXT_SIDE(_s) (((_s) + 1) & 3)
 #define PREV_SIDE(_s) (((_s) + 3) & 3)
 
 // from the given base color and the background color, turn
 // color into a color for the given border pattern style
 static gfxRGBA MakeBorderColor(const gfxRGBA& aColor,
                                const gfxRGBA& aBackgroundColor,
@@ -196,20 +192,20 @@ nsCSSBorderRenderer::nsCSSBorderRenderer
   mInnerRect.Inset(mBorderWidths[0], mBorderWidths[1], mBorderWidths[2], mBorderWidths[3]);
 
   ComputeBorderCornerDimensions(mOuterRect, mInnerRect, mBorderRadii, &mBorderCornerDimensions);
 
   mOneUnitBorder = CheckFourFloatsEqual(mBorderWidths, 1.0);
   mNoBorderRadius = AllCornersZeroSize(mBorderRadii);
 }
 
-void
-ComputeInnerRadii(const gfxCornerSizes& aRadii,
-                  const gfxFloat *aBorderSizes,
-                  gfxCornerSizes *aInnerRadiiRet)
+/* static */ void
+nsCSSBorderRenderer::ComputeInnerRadii(const gfxCornerSizes& aRadii,
+                                       const gfxFloat *aBorderSizes,
+                                       gfxCornerSizes *aInnerRadiiRet)
 {
   gfxCornerSizes& iRadii = *aInnerRadiiRet;
 
   iRadii[C_TL].width = PR_MAX(0.0, aRadii[C_TL].width - aBorderSizes[NS_SIDE_LEFT]);
   iRadii[C_TL].height = PR_MAX(0.0, aRadii[C_TL].height - aBorderSizes[NS_SIDE_TOP]);
 
   iRadii[C_TR].width = PR_MAX(0.0, aRadii[C_TR].width - aBorderSizes[NS_SIDE_RIGHT]);
   iRadii[C_TR].height = PR_MAX(0.0, aRadii[C_TR].height - aBorderSizes[NS_SIDE_TOP]);
--- a/layout/base/nsCSSRenderingBorders.h
+++ b/layout/base/nsCSSRenderingBorders.h
@@ -195,16 +195,21 @@ struct nsCSSBorderRenderer {
   // function used by the above to handle -moz-border-colors
   void DrawBorderSidesCompositeColors(PRIntn aSides, const nsBorderColors *compositeColors);
 
   // draw the given dashed side
   void DrawDashedSide (PRUint8 aSide);
 
   // draw the entire border
   void DrawBorders ();
+
+  // utility function used for background painting as well as borders
+  static void ComputeInnerRadii(const gfxCornerSizes& aRadii,
+                                const gfxFloat *aBorderSizes,
+                                gfxCornerSizes *aInnerRadiiRet);
 };
 
 #ifdef DEBUG_NEW_BORDERS
 #include <stdarg.h>
 
 static inline void S(const gfxPoint& p) {
   fprintf (stderr, "[%f,%f]", p.x, p.y);
 }
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f067dd69e673989e910540402b5091ee7ee1cfc5
GIT binary patch
literal 195
zc%17D@N?(olHy`uVBq!ia0vp^Q6S933?yBTt(*v?cmjMvT>t<7&(OfY*uV%B$lTa`
z6i6|b1o;I6>0f0>?g6P}PZ!4!kK=EzEfj5V;9<F#+2C%P5oNJiL6gyIkJ=07X14kq
znFT^WUEk>REWfo|>qE-RhI<>tUd%afU=hCc{nF;UzrM}#ZvD1o(mW9Ox4QoB?iHK2
moet);&fC3T=v_-f_??rsTDtlFgnt69WAJqKb6Mw<&;$TRMoe1(
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..96770b9666a65fc6e9b33b83e29d7b6fd4dfe5da
GIT binary patch
literal 282
zc%17D@N?(olHy`uVBq!ia0vp^Q6S933?yBTt(*v?I0Jk_T>t<7&(HwmFr42mc^*hH
zl?3?(Gcc4*K5GHw?elbT4DslEJI#>qumX?k+MK6yl9Mi%6p9*t)re`@>%FukSWJ2=
z)1&=cgV_H~c&NG2m(9MT<JytX8m=WX=iN!uuX$_m`;+5;tIy6GtP{T-nr^(Gb+eDA
z2yfl_V5u4Ao7bA{dt%nPYKOA0?D1gX<;-X27w=d8uR6i*))}J=o#iVwpIER_e?4zY
zzU};dCugp=4LAGopqc+){-5i=1>PrC=P$PH-_u~zw5Qpobx)fO$KFnx?may=e0%%f
daX#Doh;^r+g4&an3jHAedAj<!taD0e0s!cHbKC#`
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e1e6d7926f670d4b6eee2c0d761242721fd3c763
GIT binary patch
literal 376
zc$@)v0f+vHP)<h;3K|Lk000e1NJLTq003G5003G70{{R3MaHR-0000CP)t-s|Ns90
zfB*r20RR91X|aRF00003bW%=J0002`cEsKQ009_DL_t(Y$L*Fu4uUWcMVqiToQ5TO
z1veuLNw|QC9>By?c%NQ^d$3_Asht5zTl?9n3A3Sjp)<cE{9mQGa?{gT#;B#Tfm~Iu
zg&)YPM!VNrpVNKjWq|2CZ|Fl#-H7uDQ<H3CCFx|FsZpfHDdP5(nPw?7%ma3I@mS87
z+wB!E3j6H5kHQ=DIJWVy^yT+jcaY_nH!H{K^*+l*c+f@~)gq@3c_xB((k-Z#c^Qx8
z!FFOXs`X1y5zCPlnm0w5M|O5d6Z4#<w6RPP`aMo`jJdFlZ~Pzmul--h2as<dpFzHa
zd<^*>@=4^Y*)#3K$hV=-CvxGWS8@d94$3K%YcK~ta`U>LvuY1=8Ra<2eRxku+$-J;
WTRdi*>a`vK0000<MNUMnLSTY1VW&<2
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..18aef7d91066b327aff0ef200507fc8dfdf9d940
GIT binary patch
literal 444
zc$@*e0Ym<YP)<h;3K|Lk000e1NJLTq003G5003G90{{R3%7$Dq0000FP)t-s|Ns90
zfB*r20sj8}0001b$TEWf000DZQchC<00029lV+L#00CG@L_t(o!|j(#jsqbKM7{6@
zJmLb8<_I|eoz(r$lm(xL2?i>fMHcN%N9u>WWQcKz^q~M?W@Z2oWfqEuwedUSbJjNS
zbm7C^BY=QCT*t6khy*;uVSa#t?FZXB23pS40FaB{lpn*?q1!yIMeUNqt8K;co_bKK
z!7EI5tz<vn9Zp%hRP}2aj?O7gHILou;2q^G9i0&P$G(-K^VBtYY?fm32W*LUrIY-W
zlD-qB^oi(FNRbk|Un?okB0DVTqX<8`eRZNhX<1y*ngytB(-!M0*$`f6ksaYt9t4f@
zSOrqjt&)_YT=al8Gc#F7;x77|>Fa#|3%%WaxX#9P%?~>Aez&J?67H5FZ@@csyK*--
zHx+Ob2RY4flM*+DkrSTYnCX$5Ov$O2o2a>Iopb`6%OD+$;6}J3(s_}tj&qEp8zr5t
m$enS~BKpU5uO0o&{l5Um%9GDy#4Nc00000<MNUMnLSTYq(#Ey`
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..38023b1a619032c90d6f8677030706860529906b
GIT binary patch
literal 450
zc$@*k0X_bSP)<h;3K|Lk000e1NJLTq003G5003G70{{R3MaHR-0000CP)t-s|Ns90
zfB*r20RR91X|aRF00003bW%=J0002`cEsKQ00Cl2L_t(YiS1Ugjl(buG@v^0G%k%y
z!FOXoD`WrzS?Ndc5*p!qH7*`V;E0rBk&3VV>e<9Ok;fA)k?y);Zcp~;T5~%k^B)UW
z67#Et`;c+ETl`sIn&PQ@6EGeyO)7({?nH~CQ84+6|7!dzS{mN(W{8C5&iSrE6R{ef
zqj#-{qf22NKgUXc_>46{uXC}JuP(JJ+YvmN@^ZoRzaO)ACi;FqR2m@?H)m_e>1O`D
zm{N(nsjM#=PrMSJ<lHpgg)C^ZX%8USv_gE#bOvT2i^!ZUo)Oo`5r$c!tQ^TGcx>>E
z@$p^0Y6B}A&Tv}uqP4N$4a_Omoa6(KNtAE#o~4I&yRy}P{O|Dd_k!Lddhht0oS!Rn
z4$-+q=N#P&c#punL-!QkYt#o&-#~o^^(EBDP~U@n67^Nohf&`~eICvQG)K_fL30Yu
sH8cm&+=O!$&1E>p(cFjM3GH{q3lxA;-Ut`y{r~^~07*qoM6N<$g1_|4q5uE@
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6c88fdfa841db4e29a1ed6e67d1c9fad65a6fc51
GIT binary patch
literal 203
zc%17D@N?(olHy`uVBq!ia0vp^c_7Th3?z4(p34AIJOMr-t_%$f|NsAIY+wWm)Y`Zm
z15(T-L4LtN`d8VJdq67N)5S5w<M`X_hP({{0?iNESQJ>7+$oag6f0;jRoTNTzkQEn
znG?U5lhd#D^BcwXvFP14Zx&`=m6+6a&LAj<*Vt8r<@kY9g%#Xa7yp^V+3K_~K;w`2
vswMhiSyr=uKFIU3yZZCQ`}}u~WjcI&7VKNM<KRg<ptTI1u6{1-oD!M<x7bF$
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..6b25085d400d218b9b694949de027698398d0fb6
GIT binary patch
literal 257
zc%17D@N?(olHy`uVBq!ia0vp^c_7Th3?z4(p34AIoB=)|t_%$f|Ns97@)Z8Etp-v|
zB|(0{3=CzH&sqR^OFdm2Lp+YZy{^c2*nr3F;qpySMU;2<pN#i)Z4ULns63^mU1ZI2
z8Ht&zZd6Ro`E~T*d5<W*bHRODl9z70IP<&P`@BYI+m+as*tTW+0#h=|3Rbjz*M8F$
z#xH;Dg`|0M(MAb>arWeIg^!;qNuND_?A7DH{{<N49<RHnq6P+W((A9PC8o7DiY<$k
yXifBMQ<PH6k=dVU)_zcSS(VJshm{ZH#pD&H-Y9z2R<{A@U<OZDKbLh*2~7YcqGb^P
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..a5f0e3c0957a763e31936227a0d4a56e7b829ad6
GIT binary patch
literal 378
zc$@)x0fqjFP)<h;3K|Lk000e1NJLTq003?P003?R0{{R3yEV>e0000CP)t-s0Du7h
z|NjAi0RR91eLP0S00003bW%=J0002`cEsKQ00A0FL_t(Y$L-fK3WG2d2H-~>i}WO=
zT{=py;36)9SMUJR_Gli#CHKhU)?yQ*Rb$?7DHNBy!NCvm3<lmGN_6F|q)D}H_ckW|
zOrJEb;5Fi%>^g`6(`tbf4OlLX_M%7WKxz!;E~A6N(uslS(7CE!SE1`$&G#yFx71A)
zW()=z3kFFjlpHn+D-JI)rJT_bVHi`!Vz7cGk2RTXUYlf6t=YkVGaLRzP4aVOCS?wl
zq;7?9Zi(67*<fU2H9@Oo-?T?zWARt)$~JXE#`5UVqeqY1;uh0keO$po$BjrhT;W)T
z106<z-xCH5F6jeA9vGHz%;EytPOL>c7z$yWgh3QXSa;LY7qL0Hp}-BJIt=;vdca*Q
Y-Zxw*k7EJ-x&QzG07*qoM6N<$f`0{@VE_OC
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b9f73723a6eaedc3f601df84cb1ebef0182efc5b
GIT binary patch
literal 477
zc$@*<0V4j1P)<h;3K|Lk000e1NJLTq003?P003?T0{{R3G<7@30000FP)t-s0Du7h
z|NjAi0sj8}000183Q$-8000DZQchC<00029lV+L#00DVPL_t(o!|m8ja>6hS1z-*1
z3wXu{=%Pp905<6UXQ~qju@wL5wcS}uhObfxq}C%ZD{wB7wY`+o`$(w=)$3bH;Vzv-
z*JsOdq+U6$y8)B%bYa9YOjkF-O89Y1GsW7?F}ksIQ&X0clBwM}DcRb68j`Wy(U6So
zj)r7y_inhmXmajw!Nlm6-p)4WYfv(e`5KhWW9CY`WA!6rR?m|BO4Ngr8q;Z1`%Sye
ziJRVF3g%l+^72|tUCririb?p)E>@o(*D9~aN!M#98fI7inbdWm9E^hc!gi|cP&yts
zZn!jX<y+}7_i3t6lqpVMUU`A8a6EKeb!q6razl5PA6NA$wcK*cEw|iqzjy2Z^nW?@
zoMk)Lq31~S-1-OSWZStM+yl_P1KxA);9iC9ap>NN?y2xzjPBv+-Vf&t;S0+(&>RKM
zZP1(u&86TR49(r(oX_*zJ=D1(oMXbdDVo#5xiFkVdw<7r?>(Jwsb0=*$n}2!B%Jvt
T=Nr~l00000NkvXXu0mjfi%RFn
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..d1224fd9a7b33e97b5a9eca491bd7dd5dbe6169c
GIT binary patch
literal 492
zc$@+30Tcd-P)<h;3K|Lk000e1NJLTq003?P003?R0{{R3yEV>e0000CP)t-s|Ns90
zfB*r20RR91X|aRF00003bW%=J0002`cEsKQ00E3iL_t(Y$L&`!Zo@DPG+=ZL{2C1%
zf_$M1t0jP+&^#bOUeW*f6Z(f2Zw*v97A1<3&P6-5C`X;eqeO~4cU?5^7b5THu40}x
z8!PCE*v3g?gNq>DG<Z)K*}1*3*eW;bt$ntU=qkZuj**oCFA5~#cX-#}Tia{qx9}?b
z>R7XQhZ3W)O({q#l##SX8A)rDk@Qdn?FK&cw`=)$u9nwH#$!LW2<}-#F3&LM{qp!!
z-)1=WSp<92B{Pa(XPsS}yvSlbB_2~$O}MftI?3uSExDqi0@H<kjCqMOQ=bl%NO`R<
zt2lT&^D))aS;9dNF>GN*f>wdY02-0mXzb3E!E%&e0k0Z#8|Y%zrG?dfu;@#R0E@O{
zek1s}#iIK@t*bBp;0pesWbYUCx84eTf<JuOt%d<x&3=<=wKv!paZ5$b7`Aad0O06=
zLkEs4IOyPrgu@k&WjN5G6o4WE$`2@9u;hVa3Cb)e(6F?Fq7ceSEJUG%h2j^>W+=F^
iREHuT{~pwSEIt9I!)_gQ*$sXG0000<MNUMnLSTaL3D+h7
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..ae00e2fa1a06edcdf65e32a8eb55d812de702aeb
GIT binary patch
literal 199
zc%17D@N?(olHy`uVBq!ia0vp^c|aV%#0(@`T~}-cQak}ZA+G=b|7U1mU~FIn3S@3<
zJ_@9mOM?7@f%LDkBlmz*x~Gd{h{y4_*B0_N1n{_C%%0Gad0|b1riWXD;BJ=cnr60-
zvJbBcI$gS@taZQj;fCYZvI1#g3xd<Qw+N-bP@Q#s`knPF{mXlAM`uVKKLQ5!55#{<
p^6m0#Jo&ie!q1ID?cP&t#CPBK^S52ydH`r8gQu&X%Q~loCICsCOfUcd
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..c1218af8db0a0e6edf3ef127efc056c887fe45ce
GIT binary patch
literal 254
zc%17D@N?(olHy`uVBq!ia0vp^c|aV%#0(@`T~}-cQk(%kA+G=b|7U0bav08Umpl)o
zm`Z~Df*BafCZDwc@)mizIEHu}e|yc4>#%`<%f)_0*P?!rkC~TxI9Jt(#2(r!?fgMA
z_{7wkbB$CM<jM<mbDd@A*?lhf8yCajWeN9qkDmy+b@9W3ElhWkf*C739@&Uzt~$O}
zFpG5>PrAgEhp%s_A7Q#KvV2=k)70v&Rc~vPVj_#?)bme$ygB)JpX~m||6j9jF>JV)
z=zRRxR9-9TiDogiI=3CRhaQ;55pSPUcvAa3`-x_Y2Op%l^g({`boFyt=akR{0F``X
AaR2}S
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..914dc604b99ee252a05025cbdfa98ad200131e9d
GIT binary patch
literal 358
zc$@)d0h#`ZP)<h;3K|Lk000e1NJLTq003?P002+|0{{R3g+-{f0000CP)t-s|Ns90
zfB*r20RR91X|aRF00003bW%=J0002`cEsKQ009O`L_t(Y$L*Fo4udcZh9jYlh|@5p
zy+Ri^Lo0ECO634tqxZ=rxCaYcD~dxxUX4L)t?+{6kJ!c{{>>O#G4$ZrFfeP`8+;Ql
z3r`SQCFg@}1femI#|*CK=va*CoDvw8pdAI~aGC4jZi=}GAx%{9qB<^BtMp-Mf?)y?
zKyH%e2z_RKWmN1GO{K!*w*Y3KD{51)*3Tw{c;aqf@=b@!lTa)`4srLUPZ&E>Lfk!O
zyd><?uv4iMu>LWq{_l{n1A5Op+~FGdN7sS8_S>fkIi$AFK60dHPhuF8W1JR%lyqF=
zlIW0fMG74$k+isem*vL_L1#y56(E-ga{Ztem(<Gh0rK8$#$fe^*8l(j07*qoM6N<$
Eg7uS@hX4Qo
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..706a11febbbb094208fff797a178063c8241aaea
GIT binary patch
literal 350
zc%17D@N?(olHy`uVBq!ia0vp^c|aV%$P6S8J-w6)q}T#{LR=ZZU}^f!^FWHRB*-tA
z!Qt7BG$5PJ)5S5wqW9^QgSjmZJgpD=Ww$(R2$Qi))oe`eo8rW&*?37K)!T#BlW(4H
zgu53P2m6}%3bz||=P%SO*t7b)aYml#eWg7v8qr6Vb4;Ig<xN6~>(0o7uT1;;68hJ4
z%XK{xIDfA2^0k~7%AI%n0>yVk7)mp#8;2D?$T^b7CG+KmPUGBZZ9l^I3b#fDt}d`j
z2##MN|4aGZt|-RVqc2L{v#oyEF?r`T_suhXZgrVCAN$&|_-V)7r}ucK&EFxrvHr-n
z`HBDC*9RpB->#p3@q@($lXog@DpOUKsBBg_q;gT^fy#TGe<{5wb5d5P>`FPAawFw=
u&bKXGmlk<stMt|BN?!Nab(g<Ze}z9sy`$dBKjnI$VDfbJb6Mw<&;$Syzm+!t
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..706a11febbbb094208fff797a178063c8241aaea
GIT binary patch
literal 350
zc%17D@N?(olHy`uVBq!ia0vp^c|aV%$P6S8J-w6)q}T#{LR=ZZU}^f!^FWHRB*-tA
z!Qt7BG$5PJ)5S5wqW9^QgSjmZJgpD=Ww$(R2$Qi))oe`eo8rW&*?37K)!T#BlW(4H
zgu53P2m6}%3bz||=P%SO*t7b)aYml#eWg7v8qr6Vb4;Ig<xN6~>(0o7uT1;;68hJ4
z%XK{xIDfA2^0k~7%AI%n0>yVk7)mp#8;2D?$T^b7CG+KmPUGBZZ9l^I3b#fDt}d`j
z2##MN|4aGZt|-RVqc2L{v#oyEF?r`T_suhXZgrVCAN$&|_-V)7r}ucK&EFxrvHr-n
z`HBDC*9RpB->#p3@q@($lXog@DpOUKsBBg_q;gT^fy#TGe<{5wb5d5P>`FPAawFw=
u&bKXGmlk<stMt|BN?!Nab(g<Ze}z9sy`$dBKjnI$VDfbJb6Mw<&;$Syzm+!t
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0055025143279009fa647fdc03658bb8be264fb6
GIT binary patch
literal 210
zc%17D@N?(olHy`uVBq!ia0vp^@gU5^3?x4*eNF>XJOMr-uK)l4XJ}wxY+wWmWNvIe
z3Z$4zg8YJk^sllb_kdK9r;B5VhxglS3k4et1Y9mIWoXN~5Wr$BxP*i21dnc@(<~2p
z!;cj=j3s5ti{@MWZe04YG@VtU%!qOFElDFc&NDMiWqz^F3@|yO@A&>s9fP)<xdj+}
yakf-BBG<vTB|ubVwUOR#?~;>mZsy6ao|Y$QpT|^lz2Z91b_P#ZKbLh*2~7Z>ZADE0
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cc67a180ae175897b72f11207669b37e049dfacd
GIT binary patch
literal 281
zc%17D@N?(olHy`uVBq!ia0vp^@gU5^3?x4*eNF>XoB=)|uK)l4XJ`O&7|w5(JP)Lp
zN`m}?85qhYpS1w;_IkQFhIn|ty|$b8kb^+W!~5q7<XM(+btU+zE48by+MzZlK8bUu
z7ZW$<8$(VZmF*AfZn;}9ERS3-`izO;?UK;DVis$EbDchs=HSI}ciZ|2jrSV5?r(V`
zCF_zA8-MWrG^b|?jyLU9Mf>E~{;!?#XM4~e{TF9eNqO!HSrM?%sdasVjLwn!4!0UL
zqda8Ri?RKhAS=SRX~N48o)(|qJ$&yOdR{B{F5&Rmm9NOScim?;F8QEid3rbfjdtHW
bzI-XWd~CeE<$Y6-?-)E?{an^LB{Ts5Mg(j8
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..65d4e4a0c21121445c659eeb8df9139763779587
GIT binary patch
literal 421
zc$@*H0b2fvP)<h;3K|Lk000e1NJLTq003VA003VC0{{R3^CI(R0000CP)t-s|Ns90
zfB*r20RR91X|aRF00003bW%=J0002`cEsKQ00BiwL_t(Y$L*HQZNwlDg<r(kay1;i
zn<DbUVUcLT1z1WI=_4i31bz6zEs=A;u!bEDD@Dr19Ov^eKgjb20Dy6e+|S46QI7iI
z;cRzsJ=$s3;t(o8m%&uq`JP>31Gpsn*xG5lcoWH0zG=U!&8g(|7-A1H2!I}dmcT5>
zPSJw|ETAMiZ#`f-Ns+z}CK;^IB+a&!SG&f&5KWrHE9Yj<h}G+trY;C{z5=OYi@@*N
zo|<P7OyiJ(SOnMDQ)L!m>4EuKz}FVMkmTD5PH=)h1<(JS{|cfN!2&IV8QOKgWFSqr
z6~n{m(|Lq<fZ{3u1E|lokeKuXq0KiW#X)oeSODlIEfq+90T`O-D(m3LdL)loIaM>=
zhq432S`Vh8^i!=MvFQ28ql*gU&F62-LA>re11`NSqq~=MH<|wKBW+8+(0F^Vu=J`W
P00000NkvXXu0mjfX1u(v
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..796afda68e6b522cf31dfc02ebfaf8664226148d
GIT binary patch
literal 421
zc$@*H0b2fvP)<h;3K|Lk000e1NJLTq003VA003VB0{{R3w1SDY00006P)t-s00000
z005<Dxz7Lq00DGTPE!Ct=GbNc00B)&L_t(IPu<ipj@2*_0MO_BC_hC6DO0Q<dxIPy
zf{U0NP*QpUaV~Qcj_^wgq)%Zx+3gT?xQOOi(O6@72EtvqtLqKiDsJ#l;!8TeUX{Hc
zU@6!@ESNwp7~oQ3A+??M$J7uV$x6DdVR2+G|L2AQsi7mZSUArlB;5f?e_}Ury$in(
zjr_zFtHm`TWHxiXipXp`i=V9_fr-&tiyIilT3p9u-wFb~Jys;WJr_uNPpKjsJk{8)
z^Q9r`d~R5EzCFj+zrcU6{;<-2#<RN~ygSjq#QTO_@5717<B8E@dWN|no6Wf*nJxQ)
z&A660B&%twAnKO`yKXG#NG``q3`scNXrMi-UWe}qj0VIE78ACQV76c>2dy?tC3h4t
zl&;G%E+HeN(jfU0uC@E)YdqBMU&39u)rNmDU0%!`A2}wHw+Oe2V~YI-Cd5IqJtafn
P00000NkvXXu0mjf!*a2r
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..e557851e5bc396713c1d8f574594d17a895d493e
GIT binary patch
literal 476
zc$@*;0VDp2P)<h;3K|Lk000e1NJLTq003VA003VB0{{R3w1SDY00006P)t-s00000
z005<Dxz7Lq00DGTPE!Ct=GbNc00D$aL_t(I%cYb(Zrm^sMju6j%Yv|3s&K*FKxGOe
zAnc3i2wSG4f8cX*bCNwq3d5U%GosW5unIzNis5|Ua0Y<W*R7)8BmCBX)8M3V2XGbm
zxg8q3>;JZn6W?PEfVso6J0-SuhyX|>9>8cFyJS6`Qz$@C$Uss^64)+U72;Ntq^)p&
z`vN8~VE$qoSg>#poWWG4?o0$K9@FUVG+cMdR47DI)nFxXR*9KeZe3s@iAOUelHV#z
z<hWH9$YR?Bfh@LJ2$Xd*$5B*I#Zl@GE(#6D%dl<YZ4a*sD-$2X(24i&f*Zj1v;8L=
zB>WlRcp6G~P;fl&;m3e*gghJ#q~UcUwH?ew`cqj5qgk1lH&}6_rv*Q{-I&7m4k}h2
zg~L>gSFoUc3{1cUc~u@*dvS>fEWMtE8Aw?yNI;lHTLxSdZ3XaN6g0rt3Rs!S)&MV4
zxt@V26TCbCvrNIm2{_9Xc&?ZxQ()^aPP!?$+S{k@kmGha?483#I_xT}Y_Wghl1~l8
S1JOkQ0000<MNUMnLSTY@TE(yc
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..b871ced5a6a981574f5fff60f4fa810a4418c7a7
GIT binary patch
literal 201
zc%17D@N?(olHy`uVBq!ia0vp^DL@>>#0(^j|42&#DV_kI5ZC|z|1&f&Fg7p(1u{1_
z9|cm(B|(0{K>AnNk$WIfPZ!4!5AV0v6oncL1e`BQs2t9`Fh}W%!DexXf}8giFXL-G
zaB$fw=CtJb9e)o5{hT+K!A601MvMZtn<9If;_cez=WJ4&CR~ZsXi)@%|DD^<t8jbF
qUCLz`$ydGD%w^%4rGciKTJ-n>0&c!IpM4!@DTAl0pUXO@geCyQT12G)
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..1db05a62f93147174b10800623888d7c79d7a36c
GIT binary patch
literal 286
zc$@(q0pb3MP)<h;3K|Lk000e1NJLTq003kF003G70{{R3GyEGG00009P)t-s|Ns90
zfB*mh0MEA>&j0`b0(4SNQvd*Vlg&5)006>CL_t(Y$L-cJ3WGotgyA0{MZAZF-e(rs
z%F<(aiS2C`!k#k4hJgBBsuY3jv>(dD!Wn?6=$P^VfG+EtxB)Qfn)*;SBm(rZvIC<e
zjw#amdf7?3qzI&|kQJblA)~a_1J2S*J9kSuX<;-aX=Sj4q`7_puE#}^DTBffh)lUj
zO`0@m@`v)hKWz4-mm?*=#YixFws!5{$XwgZ$XXlF$l}ztwAZFJvf-Q^z&ShCjy6yG
kv>g1k@nNC(tHxPEPf$5X)dNlE?f?J)07*qoM6N<$f(Vs-IsgCw
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..2094c425eab96e38edbd706024a6e72e0083b0ca
GIT binary patch
literal 417
zc$@*D0bc%zP)<h;3K|Lk000e1NJLTq003kF003G70{{R3GyEGG0000CP)t-s|Ns90
zfB*r20RR91X|aRF00003bW%=J0002`cEsKQ00BWsL_t(Y$L*G}ZNo4WL=O;B3Yx~H
z<0+om2;c%KG=PCjk!@0F3GJbVT>_{0BrTJa+XRTOlJO++NWgbrlBD4pNb=WJS=~2V
zz0aAPxYt+yWGRSC9~~+68A$+l+jY2tkB{U>TRgy;7rShTPU&|by>oNqv$J_i6wKYQ
zwQ1^Yksfe&Kpjky4uv(_V2lRFd!m4sv^2;OCv}v^k<@dZjZ6g@U{>EE9ZV0%k@9lP
z_C*J(%aOD&J|Lk<0$xj#9B_Y{08j$Gz>_@5KO?{UZw$L+Nu-ft&JwASmfliqsuDKk
zTb<X8mX>wKbFqXi8e<@5Z_z&im@LVw&VpIp2Y}x;-~yayYm8bhwoEM_o2k}YY_nQZ
zG+%3N_4)1SVaGtL>eI;^8=cpD=gq~W*WJlsf7;leP##P*%}MA7Y2I_YU$W|I00000
LNkvXXu0mjfgQK+v
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cc9e57d6ebfaf7e092eaee7c51dd21dcba2a3d5b
GIT binary patch
literal 421
zc$@*H0b2fvP)<h;3K|Lk000e1NJLTq003kF003G60{{R3bX;M|00006P)t-s00000
z005<Dxz7Lq00DGTPE!Ct=GbNc00B)&L_t(Ijm^}tjodI0h2f8)u&03VDpYXrsRV}3
ztWs3MmcY_f%9Y^InH`Wz=?+e9m<jb0#LPVL%|Q6Y{in9R!b@rN1H4y=_4KvUm%6>w
zZSltaJ=80^2VU*q2nS-x5XE|!;N}J%H%L+q7Hh}}q)?E}wFn1x83a2HYptSW6kDZj
zCU8{RCn8N*P7Iyqkx^)(r-9TdMW$9XV_-2fx`kryG$?WtL{zNCM#1)p_LItP>!hr<
zCjC!TPCD|Hw)r2>|Fr(H+GAFlAyH=K@?!b&V!>*=y!&dqcw)7mez9A-my*reeYV)l
zr#}^Q_wK4#w03fYV$wVxN+9Xo5gE0zlYv1i?VFL<+Bm#R1hu*EOelP>vtZV9BkQ@_
zSMGFRc|s_hzbsbCUHkJ$zw}Izd*E|lE+Icpn~#&o1AR()gL`?F)Ti5TNb*9ORg#kB
P00000NkvXXu0mjfUVp@e
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..497ae2dd3af8cb42f7d6666bb3264f1198b5b944
GIT binary patch
literal 532
zc$@(g0_**WP)<h;3K|Lk000e1NJLTq003kF003G70{{R3GyEGG0000CP)t-s|Ns90
zfB*r20RR91X|aRF00003bW%=J0002`cEsKQ00Fc~L_t(Y$L*H8jl(buh7Gt5JdH~u
zQwS<zz$3&12*_$)LL;PiqvC)wd=m8{MLO4BacmO%lgOVkC93O^_2+4oKF_UdtUpyW
zhVClcHwA+&MDK(gs@kiaqJ4z^Jeo;U89F$n3=(GR$h+5G<qdwyf<jhzUs$Xk_9V`#
z2Uj16Gmx_*Wpjt4nlfFf6)APuLkOd2b}3K@qwxyg^1u*AlP{73jZ~U9n*_b7G?4Tt
z0#-tjgkCY?C2a90{vo-pNm@gE0F$KYreLBt*QNvS7T}zW;SGqM8v?RHbW1?CNQOWl
z9n)5MNa)6wAdyKVA=ObLkm@gFlZX>ZSRN~qusr|d?-HBIE)jQ8A&Xo)y~?#?E{Ra_
zbF5yzf4m#0_=TmD_X6Lip1{u1Y}e;K$4`ntta!QvFP0}X#>h?y=Nr5jnYbZkI57!R
zat{eLr*eFbvKQ(Md_>tO*P}eXY2$;I_b8`wb=Mzt@h99ZQ(rYTqMrmEFg4u0b_{A+
zk7Hy(Ia4z@HDWvZgkqT3HL*SEN(s)GJ6tc5sI0j-v{#4Ao5P3O#`O*5!>xwjgnj^D
WT8-MxM<JO20000<MNUMnLSTX*2jVsW
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/456219-1-ref.html
@@ -0,0 +1,80 @@
+<!doctype html>
+<html><head>
+<title>background-clip interaction with border-radius</title>
+<style>
+/* If you fix bug #466572, you can substantially simplify this test
+   case. */
+
+table { table-layout: fixed; width: 550px }
+td { width: 110px; height: 110px; text-align: center }
+div.i {
+   z-index: 0;
+   width: 70px;
+   height: 70px;
+   border-style: solid;
+   border-color: transparent;
+   background-color: green;
+}
+.rA div.i { -moz-border-radius: 10px; }
+.rB div.i { -moz-border-radius: 20px; }
+.rC div.i { -moz-border-radius: 30px; }
+.rD div.i { -moz-border-radius: 40px; }
+.rE div.i { -moz-border-radius: 50px; }
+
+.wA div.i { border-width: 10px 10px 10px 10px; }
+.wB div.i { border-width: 20px 20px 20px 20px; }
+.wC div.i { border-width: 5px 20px 5px 20px; }
+.wD div.i { border-width: 20px 20px 5px 5px; }
+.wE div.i { border-width: 5px 10px 15px 20px; }
+
+div.o {
+  display: inline-block;
+  position: relative;
+}
+img {
+  position: absolute; top: 0; left: 0;
+  z-index: 1;
+}
+</style>
+</head><body>
+<table>
+<tr class="wA">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wArA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wArB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wArC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wArD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wArE.png"></div></td>
+</tr>
+<tr class="wB">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrE.png"></div></td>
+</tr>
+<tr class="wC">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrE.png"></div></td>
+</tr>
+<tr class="wD">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrE.png"></div></td>
+</tr>
+<tr class="wE">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wErA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wErB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wErC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wErD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wErE.png"></div></td>
+</tr>
+</table>
+
+<p>Inside each green shape, there should be no white.</p>
+
+</body></html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/456219-1a.html
@@ -0,0 +1,81 @@
+<!doctype html>
+<html><head>
+<title>background-clip interaction with border-radius</title>
+<style>
+/* If you fix bug #466572, you can substantially simplify this test
+   case. */
+
+table { table-layout: fixed; width: 550px }
+td { width: 110px; height: 110px; text-align: center }
+div.i {
+   z-index: 0;
+   width: 70px;
+   height: 70px;
+   border-style: solid;
+   border-color: green;
+   -moz-background-clip: padding;
+   background-color: green;
+}
+.rA div.i { -moz-border-radius: 10px; }
+.rB div.i { -moz-border-radius: 20px; }
+.rC div.i { -moz-border-radius: 30px; }
+.rD div.i { -moz-border-radius: 40px; }
+.rE div.i { -moz-border-radius: 50px; }
+
+.wA div.i { border-width: 10px 10px 10px 10px; }
+.wB div.i { border-width: 20px 20px 20px 20px; }
+.wC div.i { border-width: 5px 20px 5px 20px; }
+.wD div.i { border-width: 20px 20px 5px 5px; }
+.wE div.i { border-width: 5px 10px 15px 20px; }
+
+div.o {
+  display: inline-block;
+  position: relative;
+}
+img {
+  position: absolute; top: 0; left: 0;
+  z-index: 1;
+}
+</style>
+</head><body>
+<table>
+<tr class="wA">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wArA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wArB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wArC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wArD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wArE.png"></div></td>
+</tr>
+<tr class="wB">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrE.png"></div></td>
+</tr>
+<tr class="wC">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrE.png"></div></td>
+</tr>
+<tr class="wD">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrE.png"></div></td>
+</tr>
+<tr class="wE">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wErA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wErB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wErC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wErD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wErE.png"></div></td>
+</tr>
+</table>
+
+<p>Inside each green shape, there should be no white.</p>
+
+</body></html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/456219-1b.html
@@ -0,0 +1,81 @@
+<!doctype html>
+<html><head>
+<title>background-clip interaction with border-radius</title>
+<style>
+/* If you fix bug #466572, you can substantially simplify this test
+   case. */
+
+table { table-layout: fixed; width: 550px }
+td { width: 110px; height: 110px; text-align: center }
+div.i {
+   z-index: 0;
+   width: 70px;
+   height: 70px;
+   border-style: solid;
+   border-color: green;
+   -moz-background-clip: padding;
+   background-image: url("data:image/gif;base64,R0lGODdhAQABAPAAAACAAAAAACwAAAAAAQABAAACAkQBADs=");
+}
+.rA div.i { -moz-border-radius: 10px; }
+.rB div.i { -moz-border-radius: 20px; }
+.rC div.i { -moz-border-radius: 30px; }
+.rD div.i { -moz-border-radius: 40px; }
+.rE div.i { -moz-border-radius: 50px; }
+
+.wA div.i { border-width: 10px 10px 10px 10px; }
+.wB div.i { border-width: 20px 20px 20px 20px; }
+.wC div.i { border-width: 5px 20px 5px 20px; }
+.wD div.i { border-width: 20px 20px 5px 5px; }
+.wE div.i { border-width: 5px 10px 15px 20px; }
+
+div.o {
+  display: inline-block;
+  position: relative;
+}
+img {
+  position: absolute; top: 0; left: 0;
+  z-index: 1;
+}
+</style>
+</head><body>
+<table>
+<tr class="wA">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wArA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wArB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wArC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wArD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wArE.png"></div></td>
+</tr>
+<tr class="wB">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrE.png"></div></td>
+</tr>
+<tr class="wC">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrE.png"></div></td>
+</tr>
+<tr class="wD">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrE.png"></div></td>
+</tr>
+<tr class="wE">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wErA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wErB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wErC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wErD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wErE.png"></div></td>
+</tr>
+</table>
+
+<p>Inside each green shape, there should be no white.</p>
+
+</body></html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/456219-1c.html
@@ -0,0 +1,81 @@
+<!doctype html>
+<html><head>
+<title>background-clip interaction with border-radius</title>
+<style>
+/* If you fix bug #466572, you can substantially simplify this test
+   case. */
+
+table { table-layout: fixed; width: 550px }
+td { width: 110px; height: 110px; text-align: center }
+div.i {
+   z-index: 0;
+   width: 70px;
+   height: 70px;
+   border-style: solid;
+   border-color: green;
+   -moz-background-clip: padding;
+   background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFoAAABaAQMAAAACZtNBAAAAA1BMVEUAgACc+aWRAAAAEklEQVQYGWNgGAWjYBSMgsECAASSAAFZGYSDAAAAAElFTkSuQmCC");
+}
+.rA div.i { -moz-border-radius: 10px; }
+.rB div.i { -moz-border-radius: 20px; }
+.rC div.i { -moz-border-radius: 30px; }
+.rD div.i { -moz-border-radius: 40px; }
+.rE div.i { -moz-border-radius: 50px; }
+
+.wA div.i { border-width: 10px 10px 10px 10px; }
+.wB div.i { border-width: 20px 20px 20px 20px; }
+.wC div.i { border-width: 5px 20px 5px 20px; }
+.wD div.i { border-width: 20px 20px 5px 5px; }
+.wE div.i { border-width: 5px 10px 15px 20px; }
+
+div.o {
+  display: inline-block;
+  position: relative;
+}
+img {
+  position: absolute; top: 0; left: 0;
+  z-index: 1;
+}
+
+</style>
+</head><body>
+<table>
+<tr class="wA">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wArA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wArB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wArC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wArD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wArE.png"></div></td>
+</tr>
+<tr class="wB">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wBrE.png"></div></td>
+</tr>
+<tr class="wC">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wCrE.png"></div></td>
+</tr>
+<tr class="wD">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wDrE.png"></div></td>
+</tr>
+<tr class="wE">
+  <td class="rA"><div class="o"><div class="i"></div><img src="456219-1-mask-wErA.png"></div></td>
+  <td class="rB"><div class="o"><div class="i"></div><img src="456219-1-mask-wErB.png"></div></td>
+  <td class="rC"><div class="o"><div class="i"></div><img src="456219-1-mask-wErC.png"></div></td>
+  <td class="rD"><div class="o"><div class="i"></div><img src="456219-1-mask-wErD.png"></div></td>
+  <td class="rE"><div class="o"><div class="i"></div><img src="456219-1-mask-wErE.png"></div></td>
+</tr>
+</table>
+
+<p>Inside each green shape, there should be no white.</p>
+</body></html>
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..cf513235ab5238db97d80f302cdcd010b49f4a71
GIT binary patch
literal 151
zc%17D@N?(olHy`uVBq!ia0vp^nIO!>3?yCNJY5N-I0Jk_Tp9j@0FZZl_xa^Oim4>X
zFPMR$Z1PzPAkW&<#WBR=cydQp!U4W8D+84W6Os~&5)LfwWz=w9cSl2lb#a17Pg9@)
qm)k)g=L*}FjO~xI)gNcZGc&L}<2t>uE^{8x7zR&QKbLh*2~7YUjWE#w
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/456219-2-ref.html
@@ -0,0 +1,31 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title></title>
+<style type="text/css">
+/* If you fix bug #466572, you can remove the IMG
+   and related styling from this test case.  */
+body { background: white; color: black; margin: 0 }
+div {
+  background: aqua;
+  color: black;
+  height: 75px;
+  width: 75px;
+  padding: 15px;
+  border: 20px solid;
+  -moz-border-radius: 25px;
+  border-color: transparent;
+  -moz-background-clip: padding;
+}
+img {
+  position: absolute;
+  top: 20px;
+  left: 20px;
+}
+</style>
+</head>
+<body>
+<div></div>
+<img src="456219-2-mask.png">
+</body>
+</html>
new file mode 100644
--- /dev/null
+++ b/layout/reftests/bugs/456219-2.html
@@ -0,0 +1,30 @@
+<!DOCTYPE html>
+<html>
+<head>
+<title></title>
+<style type="text/css">
+/* If you fix bug #466572, you can remove the IMG
+   and related styling from this test case.  */
+body { background: white; color: black; margin: 0 }
+div {
+  background: aqua;
+  color: black;
+  height: 75px;
+  width: 75px;
+  padding: 15px;
+  border: 20px solid;
+  -moz-border-radius: 25px;
+  border-color: white;
+}
+img {
+  position: absolute;
+  top: 20px;
+  left: 20px;
+}
+</style>
+</head>
+<body>
+<div></div>
+<img src="456219-2-mask.png">
+</body>
+</html>
--- a/layout/reftests/bugs/reftest.list
+++ b/layout/reftests/bugs/reftest.list
@@ -964,17 +964,21 @@ random == 445004-1.html 445004-1-ref.htm
 == 451168-1.html 451168-1-ref.html
 == 452964-1.html 452964-1-ref.html
 == 454361.html about:blank
 == 455105-1.html 455105-ref.html
 == 455105-2.html 455105-ref.html
 == 455171-5.html 455171-5-ref.html
 == 455280-1.xhtml 455280-1-ref.xhtml
 == 455826-1.html 455826-1-ref.html
-fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 456147.xul 456147-ref.html # bug 456147, but not caused by it
+fails-if(MOZ_WIDGET_TOOLKIT=="cocoa") == 456147.xul 456147-ref.html # bug 458047
+== 456219-1a.html 456219-1-ref.html
+== 456219-1b.html 456219-1-ref.html
+== 456219-1c.html 456219-1-ref.html
+== 456219-2.html 456219-2-ref.html
 == 456330-1.gif 456330-1-ref.png
 == 456484-1.html 456484-1-ref.html
 == 457398-1.html 457398-1-ref.html
 == 457398-2.html 457398-2-ref.html
 == 458296-1a.html 458296-1-ref.html
 == 458296-1b.html 458296-1-ref.html
 == 458296-1c.html 458296-1-ref.html
 == 458296-1d.html 458296-1-ref.html