mFrame = parent; mDepth--;
if (mAccessible) { nsCOMPtr<nsIAccessible> acc; nsresult rv = mAccessible->GetAccParent(getter_AddRefs(acc)); if (NS_SUCCEEDED(rv) && acc) { mAccessible = acc; acc->AccGetDOMNode(getter_AddRefs(mDOMNode)); return PR_TRUE; } }  nsCOMPtr<nsIDOMNode> parent; mDOMNode->GetParentNode(getter_AddRefs(parent));     if (!parent) { nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(mPresShell)); if (presShell) { nsCOMPtr<nsIPresShell> parentPresShell; nsCOMPtr<nsIContent> content; if (NS_SUCCEEDED(nsAccessible::GetParentPresShellAndContent(presShell, getter_AddRefs(parentPresShell), getter_AddRefs(content)))) { nsIFrame* frame; parentPresShell->GetPrimaryFrameFor(content, &frame); if (frame) { nsCOMPtr<nsIAccessible> accessible;  frame->GetAccessible(getter_AddRefs(accessible));  if (!accessible) accessible = do_QueryInterface(content); if (accessible) { nsCOMPtr<nsIWeakReference> wr = do_GetWeakReference(parentPresShell); accessible->AccGetDOMNode(getter_AddRefs(mDOMNode)); mAccessible = accessible; mPresShell = wr; return PR_TRUE; } } }  mAccessible = new nsRootAccessible(mPresShell); mAccessible->AccGetDOMNode(getter_AddRefs(mDOMNode)); return PR_TRUE; }  mAccessible = nsnull; mDOMNode = nsnull; return PR_FALSE; }  mDOMNode = parent; if (GetAccessible()) return PR_TRUE;
PRBool nsFrameTreeWalker::GetParent(){  //printf("Get parent\n");  if (!mFrame)    return PR_FALSE;  nsIFrame* parent = nsnull;  mFrame->GetParent(&parent);  // if no parent then we hit the root  // just return that top frame  if (!parent) {    mFrame = nsnull;    return PR_FALSE;  }  mFrame = parent;  mDepth--;    return GetParent();}