PRInt32 aMask, nsIStyleContext* aStyleContext,
PRInt32 aMask, nsStyleContext* aStyleContext,
static PRBool SetCoord(const nsCSSValue& aValue, nsStyleCoord& aCoord,                        const nsStyleCoord& aParentCoord,                       PRInt32 aMask, nsIStyleContext* aStyleContext,                       nsIPresContext* aPresContext, PRBool& aInherited){  PRBool  result = PR_TRUE;  if (aValue.GetUnit() == eCSSUnit_Null) {    result = PR_FALSE;  }  else if (((aMask & SETCOORD_LENGTH) != 0) &&            (aValue.GetUnit() == eCSSUnit_Char)) {    aCoord.SetIntValue(NSToIntFloor(aValue.GetFloatValue()), eStyleUnit_Chars);  }   else if (((aMask & SETCOORD_LENGTH) != 0) &&            aValue.IsLengthUnit()) {    aCoord.SetCoordValue(CalcLength(aValue, nsnull, aStyleContext, aPresContext, aInherited));  }   else if (((aMask & SETCOORD_PERCENT) != 0) &&            (aValue.GetUnit() == eCSSUnit_Percent)) {    aCoord.SetPercentValue(aValue.GetPercentValue());  }   else if (((aMask & SETCOORD_INTEGER) != 0) &&            (aValue.GetUnit() == eCSSUnit_Integer)) {    aCoord.SetIntValue(aValue.GetIntValue(), eStyleUnit_Integer);  }   else if (((aMask & SETCOORD_ENUMERATED) != 0) &&            (aValue.GetUnit() == eCSSUnit_Enumerated)) {    aCoord.SetIntValue(aValue.GetIntValue(), eStyleUnit_Enumerated);  }   else if (((aMask & SETCOORD_AUTO) != 0) &&            (aValue.GetUnit() == eCSSUnit_Auto)) {    aCoord.SetAutoValue();  }   else if (((aMask & SETCOORD_INHERIT) != 0) &&            (aValue.GetUnit() == eCSSUnit_Inherit)) {    nsStyleUnit unit = aParentCoord.GetUnit();    if ((eStyleUnit_Null == unit) ||  // parent has explicit computed value        (eStyleUnit_Factor == unit) ||        (eStyleUnit_Coord == unit) ||        (eStyleUnit_Integer == unit) ||        (eStyleUnit_Enumerated == unit) ||        (eStyleUnit_Normal == unit) ||        (eStyleUnit_Chars == unit)) {      aCoord = aParentCoord;  // just inherit value from parent      aInherited = PR_TRUE;    }    else {      aCoord.SetInheritValue(); // needs to be computed by client                                // Since this works just like being                                // specified and not inherited, that's                                // how it's treated.    }  }  else if (((aMask & SETCOORD_NORMAL) != 0) &&            (aValue.GetUnit() == eCSSUnit_Normal)) {    aCoord.SetNormalValue();  }  else if (((aMask & SETCOORD_FACTOR) != 0) &&            (aValue.GetUnit() == eCSSUnit_Number)) {    aCoord.SetFactorValue(aValue.GetFloatValue());  }  else {    result = PR_FALSE;  // didn't set anything  }  return result;}