Cleaned up attribute parsing so that illegal values are preserved as strings
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user