res = GetBlockParent(startParent, getter_AddRefs(blockParentElement)); if (NS_FAILED(res)) return res;  while (blockParentElement)
res = nsTextEditor::GetBlockParent(startParent, getter_AddRefs(blockParentElement)); while ((NS_SUCCEEDED(res)) && blockParentElement)
nsHTMLEditor::RemoveParagraphStyleFromBlockContent(nsIDOMRange *aRange){  if (!aRange) { return NS_ERROR_NULL_POINTER; }  nsresult res;  nsCOMPtr<nsIDOMNode>startParent;  aRange->GetStartParent(getter_AddRefs(startParent));  nsCOMPtr<nsIDOMElement>blockParentElement;  res = GetBlockParent(startParent, getter_AddRefs(blockParentElement));  if (NS_FAILED(res)) return res;  while (blockParentElement)  {    nsAutoString blockParentTag;    blockParentElement->GetTagName(blockParentTag);    PRBool isSubordinateBlock;    IsSubordinateBlock(blockParentTag, isSubordinateBlock);    if (PR_FALSE==isSubordinateBlock) {      break;    }    else     {      // go through list backwards so deletes don't interfere with the iteration      nsCOMPtr<nsIDOMNodeList> childNodes;      res = blockParentElement->GetChildNodes(getter_AddRefs(childNodes));      if ((NS_SUCCEEDED(res)) && (childNodes))      {        nsCOMPtr<nsIDOMNode>grandParent;        blockParentElement->GetParentNode(getter_AddRefs(grandParent));        if (NS_FAILED(res)) return res;        if (!grandParent) return NS_ERROR_NULL_POINTER;        PRInt32 offsetInParent;        res = GetChildOffset(blockParentElement, grandParent, offsetInParent);        PRUint32 childCount;        childNodes->GetLength(&childCount);        PRInt32 i=childCount-1;        for ( ; ((NS_SUCCEEDED(res)) && (0<=i)); i--)        {          nsCOMPtr<nsIDOMNode> childNode;          res = childNodes->Item(i, getter_AddRefs(childNode));          if ((NS_SUCCEEDED(res)) && (childNode))          {            res = DeleteNode(childNode);            if (NS_SUCCEEDED(res))             {              res = InsertNode(childNode, grandParent, offsetInParent);              if (NS_FAILED(res)) return res;            }          }        }        if (NS_SUCCEEDED(res))         {          res = DeleteNode(blockParentElement);          if (NS_FAILED(res)) return res;        }      }    }    res = GetBlockParent(startParent, getter_AddRefs(blockParentElement));    if (NS_FAILED(res)) return res;  }  return res;}