nsCOMPtr<nsIDocument> doc(mDocument); if (!doc) { mNodeInfo->GetDocument(getter_AddRefs(doc)); } if (aResult.ParseColor(aValue, doc)) {
if (aResult.ParseColor(aValue, nsGenericHTMLContainerElement::GetOwnerDocument())) {
nsHTMLFontElement::StringToAttribute(nsIAtom* aAttribute,                              const nsAString& aValue,                              nsHTMLValue& aResult){  if ((aAttribute == nsHTMLAtoms::size) ||      (aAttribute == nsHTMLAtoms::pointSize) ||      (aAttribute == nsHTMLAtoms::fontWeight)) {    nsAutoString tmp(aValue);      //rickg: fixed flaw where ToInteger error code was not being checked.      //       This caused wrong default value for font size.    PRInt32 ec, v = tmp.ToInteger(&ec);    if(NS_SUCCEEDED(ec)){      tmp.CompressWhitespace(PR_TRUE, PR_FALSE);      PRUnichar ch = tmp.IsEmpty() ? 0 : tmp.First();      aResult.SetIntValue(v, ((ch == '+') || (ch == '-')) ?                          eHTMLUnit_Integer : eHTMLUnit_Enumerated);      return NS_CONTENT_ATTR_HAS_VALUE;    }  }  else if (aAttribute == nsHTMLAtoms::color) {    nsCOMPtr<nsIDocument> doc(mDocument);    if (!doc) {      mNodeInfo->GetDocument(getter_AddRefs(doc));    }    if (aResult.ParseColor(aValue, doc)) {      return NS_CONTENT_ATTR_HAS_VALUE;    }  }  return NS_CONTENT_ATTR_NOT_THERE;}