if (NS_SUCCEEDED(result)) result = parent->QueryInterface(NS_GET_IID(nsIDOMNode),(void **)aParent);
if (NS_SUCCEEDED(result)) { result = CallQueryInterface(parent, aParent); }
ParentOffset(nsIDOMNode *aNode, nsIDOMNode **aParent, PRInt32 *aChildOffset){  if (!aNode || !aParent || !aChildOffset)    return NS_ERROR_NULL_POINTER;  nsresult result = NS_OK;  nsCOMPtr<nsIContent> content;  result = aNode->QueryInterface(NS_GET_IID(nsIContent),getter_AddRefs(content));  if (NS_SUCCEEDED(result) && content)  {    nsCOMPtr<nsIContent> parent;    result = content->GetParent(*getter_AddRefs(parent));    if (NS_SUCCEEDED(result) && parent)    {      result = parent->IndexOf(content, *aChildOffset);      if (NS_SUCCEEDED(result))        result = parent->QueryInterface(NS_GET_IID(nsIDOMNode),(void **)aParent);    }  }  return result;}