nsAutoString href(aValue); href.StripWhitespace(); aResult.SetStringValue(href);
aResult.SetStringValue(aValue);
nsHTMLTableElement::StringToAttribute(nsIAtom* aAttribute,                                      const nsString& aValue,                                      nsHTMLValue& aResult){  /* ignore summary, just a string */  /* attributes that resolve to pixels, with min=0 */  if ((aAttribute == nsHTMLAtoms::cellspacing) ||      (aAttribute == nsHTMLAtoms::cellpadding)) {    nsGenericHTMLElement::ParseValue(aValue, 0, aResult, eHTMLUnit_Pixel);    return NS_CONTENT_ATTR_HAS_VALUE;  }  /* attributes that are either empty, or integers, with min=0 */  else if (aAttribute == nsHTMLAtoms::cols) {    nsAutoString tmp(aValue);    tmp.StripWhitespace();    if (0 == tmp.Length()) {      // Just set COLS, same as COLS=number of columns      aResult.SetEmptyValue();    }    else     {      nsGenericHTMLElement::ParseValue(aValue, 0, aResult, eHTMLUnit_Integer);    }        return NS_CONTENT_ATTR_HAS_VALUE;  }  /* attributes that are either empty, or pixels */  else if (aAttribute == nsHTMLAtoms::border) {    nsAutoString tmp(aValue);    tmp.StripWhitespace();    if (0 == tmp.Length()) {      // Just enable the border; same as border=1      aResult.SetEmptyValue();    }    else     {      nsGenericHTMLElement::ParseValue(aValue, 0, aResult, eHTMLUnit_Pixel);    }        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;  }  /* 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;  }  /* other attributes */  else if (aAttribute == nsHTMLAtoms::align) {    if (nsGenericHTMLElement::ParseTableHAlignValue(aValue, aResult)) {      return NS_CONTENT_ATTR_HAS_VALUE;    }  }  else if (aAttribute == nsHTMLAtoms::background) {    nsAutoString href(aValue);    href.StripWhitespace();    aResult.SetStringValue(href);    return NS_CONTENT_ATTR_HAS_VALUE;  }  else if (aAttribute == nsHTMLAtoms::bgcolor) {    nsGenericHTMLElement::ParseColor(aValue, aResult);    return NS_CONTENT_ATTR_HAS_VALUE;  }  else if (aAttribute == nsHTMLAtoms::frame) {    nsGenericHTMLElement::ParseEnumValue(aValue, kFrameTable, aResult);    return NS_CONTENT_ATTR_HAS_VALUE;  }  else if (aAttribute == nsHTMLAtoms::layout) {    nsGenericHTMLElement::ParseEnumValue(aValue, kLayoutTable, aResult);    return NS_CONTENT_ATTR_HAS_VALUE;  }  else if (aAttribute == nsHTMLAtoms::rules) {    nsGenericHTMLElement::ParseEnumValue(aValue, kRulesTable, aResult);    return NS_CONTENT_ATTR_HAS_VALUE;  }  return NS_CONTENT_ATTR_NOT_THERE;}