diff --git a/layout/reftests/svg/radialGradient-basic-03-ref.svg b/layout/reftests/svg/radialGradient-basic-03-ref.svg
index aabc31d420ce..954099afe7e6 100644
--- a/layout/reftests/svg/radialGradient-basic-03-ref.svg
+++ b/layout/reftests/svg/radialGradient-basic-03-ref.svg
@@ -25,10 +25,15 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/layout/reftests/svg/radialGradient-basic-03.svg b/layout/reftests/svg/radialGradient-basic-03.svg
index 8d2add380816..82905de3dd3c 100644
--- a/layout/reftests/svg/radialGradient-basic-03.svg
+++ b/layout/reftests/svg/radialGradient-basic-03.svg
@@ -25,10 +25,15 @@
+
+
+
+
+
\ No newline at end of file
diff --git a/layout/svg/base/src/nsSVGGradientFrame.cpp b/layout/svg/base/src/nsSVGGradientFrame.cpp
index 2ad461d3b61c..395f5bbd9d6f 100644
--- a/layout/svg/base/src/nsSVGGradientFrame.cpp
+++ b/layout/svg/base/src/nsSVGGradientFrame.cpp
@@ -587,14 +587,11 @@ nsSVGRadialGradientFrame::CreateGradient()
// The focal point (fFx and fFy) must be clamped to be *inside* - not on -
// the circumference of the gradient or we'll get rendering anomalies. We
// calculate the distance from the focal point to the gradient center and
- // make sure it is *less* than the gradient radius. 0.99 is used as the
- // factor of the radius because it's close enough to 1 that we won't get a
- // fringe at the edge of the gradient if we clamp, but not so close to 1
- // that rounding error will give us the same results as using fR itself.
- // Also note that .99 < 255/256/2 which is the limit of the fractional part
- // of cairo's 24.8 fixed point representation divided by 2 to ensure that
- // we get different cairo fractions
- double dMax = 0.99 * r;
+ // make sure it is *less* than the gradient radius.
+ // 1/128 is the limit of the fractional part of cairo's 24.8 fixed point
+ // representation divided by 2 to ensure that we get different cairo
+ // fractions
+ double dMax = NS_MAX(0.0, r - 1.0/128);
float dx = fx - cx;
float dy = fy - cy;
double d = sqrt((dx * dx) + (dy * dy));