Cleaned up attribute parsing so that illegal values are preserved as strings

This commit is contained in:
peterl@netscape.com
1999-07-24 19:55:35 +00:00
parent f7e3aff50a
commit 83ae953e4a
61 changed files with 617 additions and 681 deletions
@@ -497,20 +497,23 @@ nsHTMLTableRowElement::StringToAttribute(nsIAtom* aAttribute,
*/
/* attributes that resolve to integers with default=0*/
if (aAttribute == nsHTMLAtoms::choff) {
nsGenericHTMLElement::ParseValue(aValue, 0, aResult, eHTMLUnit_Integer);
return NS_CONTENT_ATTR_HAS_VALUE;
if (nsGenericHTMLElement::ParseValue(aValue, 0, aResult, eHTMLUnit_Integer)) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
/* attributes that resolve to integers or percents */
else if (aAttribute == nsHTMLAtoms::height) {
nsGenericHTMLElement::ParseValueOrPercent(aValue, aResult, eHTMLUnit_Pixel);
return NS_CONTENT_ATTR_HAS_VALUE;
if (nsGenericHTMLElement::ParseValueOrPercent(aValue, aResult, eHTMLUnit_Pixel)) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
/* attributes that resolve to integers or percents or proportions */
else if (aAttribute == nsHTMLAtoms::width) {
nsGenericHTMLElement::ParseValueOrPercentOrProportional(aValue, aResult, eHTMLUnit_Pixel);
return NS_CONTENT_ATTR_HAS_VALUE;
if (nsGenericHTMLElement::ParseValueOrPercentOrProportional(aValue, aResult, eHTMLUnit_Pixel)) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
/* other attributes */
@@ -519,13 +522,10 @@ nsHTMLTableRowElement::StringToAttribute(nsIAtom* aAttribute,
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
else if (aAttribute == nsHTMLAtoms::background) {
aResult.SetStringValue(aValue);
return NS_CONTENT_ATTR_HAS_VALUE;
}
else if (aAttribute == nsHTMLAtoms::bgcolor) {
nsGenericHTMLElement::ParseColor(aValue, mInner.mDocument, aResult);
return NS_CONTENT_ATTR_HAS_VALUE;
if (nsGenericHTMLElement::ParseColor(aValue, mInner.mDocument, aResult)) {
return NS_CONTENT_ATTR_HAS_VALUE;
}
}
else if (aAttribute == nsHTMLAtoms::valign) {
if (nsGenericHTMLElement::ParseTableVAlignValue(aValue, aResult)) {