if (NS_FAILED(cN->GetParent(*getter_AddRefs(parent))) || !parent)
if (NS_FAILED(cN->GetParent(*getter_AddRefs(parent))))
nsresult nsContentIterator::PrevNode(nsCOMPtr<nsIContent> *ioNextNode){  if (!ioNextNode)    return NS_ERROR_NULL_POINTER;     if (mPre)  // if we are a Pre-order iterator, use pre-order  {    nsCOMPtr<nsIContent> cN = *ioNextNode;    nsCOMPtr<nsIContent> cSibling;    nsCOMPtr<nsIContent> parent;    PRInt32              indx;      // get prev sibling if there is one    if (NS_FAILED(cN->GetParent(*getter_AddRefs(parent))) || !parent)      return NS_ERROR_FAILURE;    if (!parent || NS_FAILED(parent->IndexOf(cN, indx)))    {      // a little noise to catch some iterator usage bugs.      NS_NOTREACHED("nsContentIterator::PrevNode() : no parent found");      return NS_ERROR_FAILURE;    }    if (indx && NS_SUCCEEDED(parent->ChildAt(--indx,*getter_AddRefs(cSibling))) && cSibling)    {      // prev node is siblings "deep right" child      *ioNextNode = GetDeepLastChild(cSibling);       return NS_OK;    }      // else it's the parent    *ioNextNode = parent;  }  else  // post-order  {    nsCOMPtr<nsIContent> cN = *ioNextNode;    nsCOMPtr<nsIContent> cLastChild;    PRInt32 numChildren;      cN->ChildCount(numChildren);      // if it has children then prev node is last child    if (numChildren)    {      if (NS_FAILED(cN->ChildAt(--numChildren,*getter_AddRefs(cLastChild))))        return NS_ERROR_FAILURE;      if (!cLastChild)        return NS_ERROR_FAILURE;      *ioNextNode = cLastChild;      return NS_OK;    }      // else prev sibling is previous    return GetPrevSibling(cN, ioNextNode);  }  return NS_OK;}