Bug 236476: Change GetHTMLAttribute to GetParsedAttr. Also fixes bug 232706 by removing final uses of nsHTMLValue.

r=bz sr=jst


git-svn-id: svn://10.0.0.236/trunk@168269 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cvshook%sicking.cc
2005-01-25 00:02:58 +00:00
parent f0310c1ced
commit 12f074b44e
54 changed files with 407 additions and 1709 deletions

View File

@@ -661,36 +661,34 @@ NS_IMETHODIMP
nsFormControlFrame::GetMaxLength(PRInt32* aSize)
{
*aSize = -1;
nsresult result = NS_CONTENT_ATTR_NOT_THERE;
nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
if (content) {
nsHTMLValue value;
result = content->GetHTMLAttribute(nsHTMLAtoms::maxlength, value);
if (eHTMLUnit_Integer == value.GetUnit()) {
*aSize = value.GetIntValue();
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::maxlength);
if (attr && attr->Type() == nsAttrValue::eInteger) {
*aSize = attr->GetIntegerValue();
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
return result;
return NS_CONTENT_ATTR_NOT_THERE;
}
nsresult
nsFormControlFrame::GetSizeFromContent(PRInt32* aSize) const
{
*aSize = -1;
nsresult result = NS_CONTENT_ATTR_NOT_THERE;
nsGenericHTMLElement *content = nsGenericHTMLElement::FromContent(mContent);
if (content) {
nsHTMLValue value;
result = content->GetHTMLAttribute(nsHTMLAtoms::size, value);
if (eHTMLUnit_Integer == value.GetUnit()) {
*aSize = value.GetIntValue();
const nsAttrValue* attr = content->GetParsedAttr(nsHTMLAtoms::size);
if (attr && attr->Type() == nsAttrValue::eInteger) {
*aSize = attr->GetIntegerValue();
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
return result;
return NS_CONTENT_ATTR_NOT_THERE;
}
NS_IMETHODIMP_(PRInt32)