nsCOMPtr<nsIDocument> doc(mDocument); if (!doc) { mNodeInfo->GetDocument(getter_AddRefs(doc)); } if (aResult.ParseColor(aValue, doc)) {
if (aResult.ParseColor(aValue, nsGenericHTMLContainerElement::GetOwnerDocument())) {
nsHTMLBodyElement::StringToAttribute(nsIAtom* aAttribute,                                     const nsAString& aValue,                                     nsHTMLValue& aResult){  if ((aAttribute == nsHTMLAtoms::bgcolor) ||      (aAttribute == nsHTMLAtoms::text) ||      (aAttribute == nsHTMLAtoms::link) ||      (aAttribute == nsHTMLAtoms::alink) ||      (aAttribute == nsHTMLAtoms::vlink)) {    nsCOMPtr<nsIDocument> doc(mDocument);    if (!doc) {      mNodeInfo->GetDocument(getter_AddRefs(doc));    }    if (aResult.ParseColor(aValue, doc)) {      return NS_CONTENT_ATTR_HAS_VALUE;    }  }  else if ((aAttribute == nsHTMLAtoms::marginwidth) ||           (aAttribute == nsHTMLAtoms::marginheight) ||           (aAttribute == nsHTMLAtoms::topmargin) ||           (aAttribute == nsHTMLAtoms::bottommargin) ||           (aAttribute == nsHTMLAtoms::leftmargin) ||           (aAttribute == nsHTMLAtoms::rightmargin)) {    if (aResult.ParseIntWithBounds(aValue, eHTMLUnit_Pixel, 0)) {      return NS_CONTENT_ATTR_HAS_VALUE;    }  }  return NS_CONTENT_ATTR_NOT_THERE;}