diff --git a/content/svg/content/src/nsSVGGradientElement.cpp b/content/svg/content/src/nsSVGGradientElement.cpp index 3d7f5920800..6d395c55642 100644 --- a/content/svg/content/src/nsSVGGradientElement.cpp +++ b/content/svg/content/src/nsSVGGradientElement.cpp @@ -314,7 +314,7 @@ nsSVGLinearGradientElement::Init() { nsCOMPtr length; rv = NS_NewSVGLength(getter_AddRefs(length), - 0.0f); + 0.0,nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE); NS_ENSURE_SUCCESS(rv,rv); rv = NS_NewSVGAnimatedLength(getter_AddRefs(mX1), length); NS_ENSURE_SUCCESS(rv,rv); @@ -326,7 +326,7 @@ nsSVGLinearGradientElement::Init() { nsCOMPtr length; rv = NS_NewSVGLength(getter_AddRefs(length), - 0.0f); + 0.0,nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE); NS_ENSURE_SUCCESS(rv,rv); rv = NS_NewSVGAnimatedLength(getter_AddRefs(mY1), length); NS_ENSURE_SUCCESS(rv,rv); @@ -338,7 +338,7 @@ nsSVGLinearGradientElement::Init() { nsCOMPtr length; rv = NS_NewSVGLength(getter_AddRefs(length), - 1.0f); + 100.0,nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE); NS_ENSURE_SUCCESS(rv,rv); rv = NS_NewSVGAnimatedLength(getter_AddRefs(mX2), length); NS_ENSURE_SUCCESS(rv,rv); @@ -350,7 +350,7 @@ nsSVGLinearGradientElement::Init() { nsCOMPtr length; rv = NS_NewSVGLength(getter_AddRefs(length), - 0.0f); + 0.0,nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE); NS_ENSURE_SUCCESS(rv,rv); rv = NS_NewSVGAnimatedLength(getter_AddRefs(mY2), length); NS_ENSURE_SUCCESS(rv,rv); @@ -487,7 +487,7 @@ nsSVGRadialGradientElement::Init() { nsCOMPtr length; rv = NS_NewSVGLength(getter_AddRefs(length), - 0.0f); + 50.0,nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE); NS_ENSURE_SUCCESS(rv,rv); rv = NS_NewSVGAnimatedLength(getter_AddRefs(mCx), length); NS_ENSURE_SUCCESS(rv,rv); @@ -499,7 +499,7 @@ nsSVGRadialGradientElement::Init() { nsCOMPtr length; rv = NS_NewSVGLength(getter_AddRefs(length), - 0.0f); + 50.0,nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE); NS_ENSURE_SUCCESS(rv,rv); rv = NS_NewSVGAnimatedLength(getter_AddRefs(mCy), length); NS_ENSURE_SUCCESS(rv,rv); @@ -511,7 +511,7 @@ nsSVGRadialGradientElement::Init() { nsCOMPtr length; rv = NS_NewSVGLength(getter_AddRefs(length), - 0.0f); + 50.0,nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE); NS_ENSURE_SUCCESS(rv,rv); rv = NS_NewSVGAnimatedLength(getter_AddRefs(mR), length); NS_ENSURE_SUCCESS(rv,rv); @@ -523,7 +523,7 @@ nsSVGRadialGradientElement::Init() { nsCOMPtr length; rv = NS_NewSVGLength(getter_AddRefs(length), - 0.0f); + 50.0,nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE); NS_ENSURE_SUCCESS(rv,rv); rv = NS_NewSVGAnimatedLength(getter_AddRefs(mFx), length); NS_ENSURE_SUCCESS(rv,rv); @@ -535,7 +535,7 @@ nsSVGRadialGradientElement::Init() { nsCOMPtr length; rv = NS_NewSVGLength(getter_AddRefs(length), - 0.0f); + 50.0,nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE); NS_ENSURE_SUCCESS(rv,rv); rv = NS_NewSVGAnimatedLength(getter_AddRefs(mFy), length); NS_ENSURE_SUCCESS(rv,rv); diff --git a/layout/svg/base/src/nsSVGGradientFrame.cpp b/layout/svg/base/src/nsSVGGradientFrame.cpp index 0ba344ee475..8c5dde9e233 100644 --- a/layout/svg/base/src/nsSVGGradientFrame.cpp +++ b/layout/svg/base/src/nsSVGGradientFrame.cpp @@ -372,7 +372,7 @@ nsSVGGradientFrame::checkURITarget(const nsAString& attrStr) { aGrad->HasAttribute(attrStr, &attr); if (attr) { // Yes, just return - return false; + return PR_FALSE; } return checkURITarget(); } @@ -381,12 +381,12 @@ PRBool nsSVGGradientFrame::checkURITarget(void) { // Have we already figured out the next Gradient? if (mNextGrad != nsnull) { - return true; + return PR_TRUE; } // Do we have URI? if (mNextGradStr.Length() == 0) { - return false; // No, return the default + return PR_FALSE; // No, return the default } // Get the Gradient @@ -395,9 +395,9 @@ nsSVGGradientFrame::checkURITarget(void) { // Note that we are using *our* frame tree for this call, otherwise we're going to have // to get the PresShell in each call if (GetSVGGradient(&mNextGrad, aGradStr, mContent, GetPresContext()->PresShell()) == NS_OK) { - return true; + return PR_TRUE; } - return false; + return PR_FALSE; } // ------------------------------------------------------------------------- @@ -679,12 +679,14 @@ nsSVGRadialGradientFrame::GetFx(float *aFx) aRNgrad->GetFx(aFx); return NS_OK; } - // There are no gradients in the list with our type -- fall through - // and return our default value + // There are no gradients in the list with our type -- the spec + // states that if there is no explicit fx value, we return the cx value + // see http://www.w3.org/TR/SVG11/pservers.html#RadialGradients + return GetCx(aFx); } // No, return the values nsCOMPtr aLen; - aRgrad->GetCx(getter_AddRefs(aLen)); + aRgrad->GetFx(getter_AddRefs(aLen)); nsCOMPtr sLen; aLen->GetBaseVal(getter_AddRefs(sLen)); sLen->GetValue(aFx); @@ -708,8 +710,10 @@ nsSVGRadialGradientFrame::GetFy(float *aFy) aRNgrad->GetFy(aFy); return NS_OK; } - // There are no gradients in the list with our type -- fall through - // and return our default value + // There are no gradients in the list with our type -- the spec + // states that if there is no explicit fy value, we return the cy value + // see http://www.w3.org/TR/SVG11/pservers.html#RadialGradients + return GetCy(aFy); } // No, return the values nsCOMPtr aLen;