currentElement = parent; } } while(parent);
currentElement = parent; } } while(parent); }
PRBool nsHTMLEditor::IsElementInBody(nsIDOMElement* aElement){  if ( aElement )  {    nsIDOMElement* bodyElement = nsnull;    nsresult res = nsEditor::GetBodyElement(&bodyElement);    if (NS_FAILED(res)) return res;    if (!bodyElement) return NS_ERROR_NULL_POINTER;    nsCOMPtr<nsIDOMNode> parent;    nsCOMPtr<nsIDOMNode> currentElement = do_QueryInterface(aElement);    if (currentElement)    {      do {        currentElement->GetParentNode(getter_AddRefs(parent));        if (parent)        {          if (parent == bodyElement)            return PR_TRUE;          currentElement = parent;        }      } while(parent);    }    }  return PR_FALSE;}