Bug 266183 - correct default values for gradient attributes.

Patch by scootermorris@comcast.net, r=tor
This commit is contained in:
tor%cs.brown.edu 2004-10-26 23:38:18 +00:00
Родитель 823c6fe68f
Коммит 0ab68306cf
2 изменённых файлов: 23 добавлений и 19 удалений

Просмотреть файл

@ -314,7 +314,7 @@ nsSVGLinearGradientElement::Init()
{
nsCOMPtr<nsISVGLength> 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<nsISVGLength> 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<nsISVGLength> 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<nsISVGLength> 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<nsISVGLength> 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<nsISVGLength> 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<nsISVGLength> 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<nsISVGLength> 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<nsISVGLength> 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);

Просмотреть файл

@ -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<nsIDOMSVGAnimatedLength> aLen;
aRgrad->GetCx(getter_AddRefs(aLen));
aRgrad->GetFx(getter_AddRefs(aLen));
nsCOMPtr<nsIDOMSVGLength> 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<nsIDOMSVGAnimatedLength> aLen;