if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))) || !parent)
if (NS_FAILED(aNode->GetParent(getter_AddRefs(parent))) || !parent)
nsresult nsGeneratedContentIterator::GetNextSibling(nsCOMPtr<nsIContent> aNode, nsCOMPtr<nsIContent> *aSibling){  if (!aNode)     return NS_ERROR_NULL_POINTER;  if (!aSibling)     return NS_ERROR_NULL_POINTER;    nsCOMPtr<nsIContent> sib;  nsCOMPtr<nsIContent> parent;  PRInt32              indx;    if (NS_FAILED(aNode->GetParent(*getter_AddRefs(parent))) || !parent)    return NS_ERROR_FAILURE;  if (NS_FAILED(parent->IndexOf(aNode, indx)))    return NS_ERROR_FAILURE;  if (NS_SUCCEEDED(parent->ChildAt(++indx, *getter_AddRefs(sib))) && sib)  {    *aSibling = sib;  }  else //CHECK AFTER CONTEXT ON PARENT  {#if DO_AFTER    //CHECK FOR AFTERESTUFF    nsresult result = NS_ERROR_FAILURE;    if (mPresShell)      result = mPresShell->GetGeneratedContentIterator(parent,nsIPresShell::After,getter_AddRefs(mGenIter));    if (NS_SUCCEEDED(result) && mGenIter)    { //ok we have a generated iter all bets are off      mGenIter->First();      mIterType = nsIPresShell::After;      *aSibling = parent;        return result;    }#endif        if (parent != mCommonParent)    {      return GetNextSibling(parent, aSibling);    }    else    {      *aSibling = nsCOMPtr<nsIContent>();    }  }    return NS_OK;}