diff --git a/mozilla/layout/svg/base/src/nsSVGPathGeometryFrame.cpp b/mozilla/layout/svg/base/src/nsSVGPathGeometryFrame.cpp index c131d0db61a..3dea77b3909 100644 --- a/mozilla/layout/svg/base/src/nsSVGPathGeometryFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGPathGeometryFrame.cpp @@ -411,13 +411,16 @@ nsSVGPathGeometryFrame::UpdateCoveredRegion() if (HasStroke()) { SetupCairoStrokeGeometry(&context); cairo_stroke_extents(ctx, &xmin, &ymin, &xmax, &ymax); - nsSVGUtils::UserToDeviceBBox(ctx, &xmin, &ymin, &xmax, &ymax); + if (!IsDegeneratePath(xmin, ymin, xmax, ymax)) { + nsSVGUtils::UserToDeviceBBox(ctx, &xmin, &ymin, &xmax, &ymax); + mRect = nsSVGUtils::ToBoundingPixelRect(xmin, ymin, xmax, ymax); + } } else { cairo_identity_matrix(ctx); cairo_fill_extents(ctx, &xmin, &ymin, &xmax, &ymax); + if (!IsDegeneratePath(xmin, ymin, xmax, ymax)) + mRect = nsSVGUtils::ToBoundingPixelRect(xmin, ymin, xmax, ymax); } - if (!IsDegeneratePath(xmin, ymin, xmax, ymax)) - mRect = nsSVGUtils::ToBoundingPixelRect(xmin, ymin, xmax, ymax); // Add in markers mRect = GetCoveredRegion(); diff --git a/mozilla/layout/svg/base/src/nsSVGPathGeometryFrame.h b/mozilla/layout/svg/base/src/nsSVGPathGeometryFrame.h index 3c5f1a50581..ed009d8f831 100644 --- a/mozilla/layout/svg/base/src/nsSVGPathGeometryFrame.h +++ b/mozilla/layout/svg/base/src/nsSVGPathGeometryFrame.h @@ -130,18 +130,17 @@ private: /* * Check for what cairo returns for the fill extents of a degenerate path * - * @param xmin the minimum x value in device units - * @param ymin the minimum y value in device units - * @param xmax the maximum x value in device units - * @param ymax the maximum y value in device units + * @param xmin the minimum x value in user units + * @param ymin the minimum y value in user units + * @param xmax the maximum x value in user units + * @param ymax the maximum y value in user units * * @return PR_TRUE if the path is degenerate */ static PRBool IsDegeneratePath(double xmin, double ymin, double xmax, double ymax) { - return (fabs(xmin - 32767) < 1 && fabs(ymin - 32767) < 1 && - fabs(xmax + 32768) < 1 && fabs(ymax + 32768) < 1); + return (xmin == 0 && ymin == 0 && xmax == 0 && ymax == 0); } nsSVGMarkerProperty *GetMarkerProperty();