diff --git a/accessible/src/base/nsAccessNode.cpp b/accessible/src/base/nsAccessNode.cpp index 5b04ba0f845..420a10fa176 100755 --- a/accessible/src/base/nsAccessNode.cpp +++ b/accessible/src/base/nsAccessNode.cpp @@ -368,16 +368,7 @@ nsIFrame* nsAccessNode::GetFrame() return nsnull; nsCOMPtr content(do_QueryInterface(mDOMNode)); - while (content) { - nsIFrame* frame = shell->GetPrimaryFrameFor(content); - if (frame) { - return frame; - } - nsCOMPtr tempContent = content->GetParent(); - content = tempContent; - } - - return nsnull; + return content ? shell->GetPrimaryFrameFor(content) : nsnull; } NS_IMETHODIMP