Checking in Fabian's <hidday@geocities.com> fix for bug 69196. Making image.border, .hspace, and .vspace default to 1 an not -1. r=sicking@bigfoot.com, sr=jst@netscape.com

git-svn-id: svn://10.0.0.236/trunk@113677 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jst%netscape.com 2002-02-05 04:37:10 +00:00
parent e5c226065e
commit cdb28fa8fb
2 changed files with 28 additions and 3 deletions

View File

@ -748,6 +748,31 @@ protected:
return SetHTMLAttribute(nsHTMLAtoms::_atom, value, PR_TRUE); \
}
/**
* A macro to implement the getter and the setter for a given pixel
* valued content property. The method uses the generic GetAttr and
* SetAttr methods
*/
#define NS_IMPL_PIXEL_ATTR(_class, _method, _atom) \
NS_IMETHODIMP \
_class::Get##_method(PRInt32* aValue) \
{ \
nsHTMLValue value; \
*aValue = -1; \
if (NS_CONTENT_ATTR_HAS_VALUE == \
GetHTMLAttribute(nsHTMLAtoms::_atom, value)) { \
if (value.GetUnit() == eHTMLUnit_Pixel) { \
*aValue = value.GetPixelValue(); \
} \
} \
return NS_OK; \
} \
NS_IMETHODIMP \
_class::Set##_method(PRInt32 aValue) \
{ \
nsHTMLValue value(aValue, eHTMLUnit_Pixel); \
return SetHTMLAttribute(nsHTMLAtoms::_atom, value, PR_TRUE); \
}
/**
* QueryInterface() implementation helper macros

View File

@ -271,12 +271,12 @@ nsHTMLImageElement::CloneNode(PRBool aDeep, nsIDOMNode** aReturn)
NS_IMPL_STRING_ATTR(nsHTMLImageElement, Name, name)
NS_IMPL_STRING_ATTR(nsHTMLImageElement, Align, align)
NS_IMPL_STRING_ATTR(nsHTMLImageElement, Alt, alt)
NS_IMPL_INT_ATTR(nsHTMLImageElement, Border, border)
NS_IMPL_INT_ATTR(nsHTMLImageElement, Hspace, hspace)
NS_IMPL_PIXEL_ATTR(nsHTMLImageElement, Border, border)
NS_IMPL_PIXEL_ATTR(nsHTMLImageElement, Hspace, hspace)
NS_IMPL_BOOL_ATTR(nsHTMLImageElement, IsMap, ismap)
NS_IMPL_STRING_ATTR(nsHTMLImageElement, LongDesc, longdesc)
NS_IMPL_STRING_ATTR(nsHTMLImageElement, UseMap, usemap)
NS_IMPL_INT_ATTR(nsHTMLImageElement, Vspace, vspace)
NS_IMPL_PIXEL_ATTR(nsHTMLImageElement, Vspace, vspace)
nsresult
nsHTMLImageElement::GetImageFrame(nsIImageFrame** aImageFrame)