const nsStyleDisplay* display; prevSibling->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&)display); if (display->IsFloating() || display->IsPositioned()) {  nsIFrame* placeholderFrame; aPresShell->GetPlaceholderFrameFor(prevSibling, &placeholderFrame); NS_ASSERTION(nsnull != placeholderFrame, "yikes"); prevSibling = placeholderFrame; }  break; } }
return prevSibling;
FindPreviousAnonymousSibling(nsIPresShell* aPresShell,                             nsIDocument*  aDocument,                             nsIContent*   aContainer,                             nsIContent*   aChild){  NS_PRECONDITION(aDocument, "null document from content element in FindPreviousAnonymousSibling");  nsIFrame* prevSibling = nsnull;  nsCOMPtr<nsIDOMNodeList> nodeList;    nsCOMPtr<nsIDOMDocumentXBL> xblDoc(do_QueryInterface(aDocument));  NS_ASSERTION(xblDoc, "null xblDoc for content element in FindPreviousAnonymousSibling");  if (xblDoc) {    nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aContainer));    xblDoc->GetAnonymousNodes(elt, getter_AddRefs(nodeList));  }  if (nodeList) {    PRUint32 ctr,listLength;    nsCOMPtr<nsIDOMNode> node;    nodeList->GetLength(&listLength);    if (listLength == 0)      return nsnull;    PRBool found = PR_FALSE;    for (ctr = listLength; ctr > 0; ctr--) {      nodeList->Item(ctr-1, getter_AddRefs(node));      nsCOMPtr<nsIContent> childContent(do_QueryInterface(node));      if (childContent.get() == aChild) {        found = PR_TRUE;        continue;      }      if (found) {        aPresShell->GetPrimaryFrameFor(childContent, &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;}