return prevSibling;
return nsnull;
FindPreviousSibling(nsIPresShell* aPresShell,                    nsIContent*   aContainer,                    PRInt32       aIndexInContainer){  nsIFrame* prevSibling = nsnull;      // Walk the   // Note: not all content objects are associated with a frame (e.g., if their  // 'display' type is 'hidden') so keep looking until we find a previous frame  for (PRInt32 i = aIndexInContainer - 1; i >= 0; i--) {    nsCOMPtr<nsIContent> precedingContent;    aContainer->ChildAt(i, *getter_AddRefs(precedingContent));    aPresShell->GetPrimaryFrameFor(precedingContent, &prevSibling);    if (nsnull != prevSibling) {      // The frame may have a next-in-flow. Get the last-in-flow      nsIFrame* nextInFlow;      do {        prevSibling->GetNextInFlow(&nextInFlow);        if (nsnull != nextInFlow) {          prevSibling = nextInFlow;        }      } while (nsnull != nextInFlow);      // Did we really get the *right* frame?      const nsStyleDisplay* display;      prevSibling->GetStyleData(eStyleStruct_Display,                                (const nsStyleStruct*&)display);      if (display->IsFloating() || display->IsPositioned()) {        // Nope. Get the place-holder instead        nsIFrame* placeholderFrame;        aPresShell->GetPlaceholderFrameFor(prevSibling, &placeholderFrame);        NS_ASSERTION(nsnull != placeholderFrame, "yikes");        prevSibling = placeholderFrame;      }      break;    }  }  return prevSibling;}