aParentFrame = GetRealFrame(aParentFrame);
static void LocateAnonymousFrame(nsIPresContext* aPresContext,                                 nsIFrame*       aParentFrame,                                 nsIContent*     aTargetContent,                                 nsIFrame**      aResult){  // Check ourselves.  *aResult = nsnull;  nsCOMPtr<nsIContent> content;  aParentFrame->GetContent(getter_AddRefs(content));  if (content.get() == aTargetContent) {    // We must take into account if the parent is a scrollframe. If it is, we    // need to bypass the scrolling mechanics and get at the true frame.    nsCOMPtr<nsIScrollableFrame> scrollFrame ( do_QueryInterface(aParentFrame) );    if ( scrollFrame )      scrollFrame->GetScrolledFrame ( aPresContext, *aResult );    else      *aResult = aParentFrame;    return;  }  // Check our kids.  nsIFrame* currFrame;  aParentFrame->FirstChild(aPresContext, nsnull, &currFrame);  while (currFrame) {    LocateAnonymousFrame(aPresContext, currFrame, aTargetContent, aResult);    if (*aResult)      return;    currFrame->GetNextSibling(&currFrame);  }  nsCOMPtr<nsIMenuFrame> menuFrame(do_QueryInterface(aParentFrame));  if (menuFrame) {    nsIFrame* popupChild;    menuFrame->GetMenuChild(&popupChild);    if (popupChild) {      LocateAnonymousFrame(aPresContext, popupChild, aTargetContent, aResult);      if (*aResult)        return;    }  }}