if (!element)
PRBool setColor = (aColor.Length() > 0);  if (element)
nsHTMLEditor::SetBackgroundColor(const nsString& aColor){  NS_PRECONDITION(mDocWeak, "Missing Editor DOM Document");    // Find a selected or enclosing table element to set background on  // TODO: Handle case of > 1 table cell or row selected  nsCOMPtr<nsIDOMElement> element;  PRBool isSelected;  nsAutoString tagName;  nsresult res = GetSelectedOrParentTableElement(*getter_AddRefs(element), tagName, isSelected);  if (NS_FAILED(res)) return res;  if (!element)  {    // No table element -- set the background color on the body tag    res = nsEditor::GetBodyElement(getter_AddRefs(element));    if (NS_FAILED(res)) return res;    if (!element)       return NS_ERROR_NULL_POINTER;  }  // Use the editor method that goes through the transaction system  return SetAttribute(element, "bgcolor", aColor);}