nextFrame->GetRect(rect); if (!rect.width)
if (!nextFrame->GetRect().width)
DrillDownToEndOfLine(nsIFrame* aFrame, PRInt32 aLineNo, PRInt32 aLineFrameCount,                     nsRect& aUsedRect,                     nsIPresContext* aPresContext, nsPeekOffsetStruct* aPos){  if (!aFrame)    return NS_ERROR_UNEXPECTED;  nsresult rv = NS_ERROR_FAILURE;  PRBool found = PR_FALSE;  nsCOMPtr<nsIAtom> frameType;  nsRect rect;  while (!found)  // this loop searches for a valid point to leave the peek offset struct.  {    nsIFrame *nextFrame = aFrame;    nsIFrame *currentFrame = aFrame;    PRInt32 i;    for (i=1; i<aLineFrameCount && nextFrame; i++) //already have 1st frame    {		  currentFrame = nextFrame;      // If we do GetNextSibling, we don't go far enough      // (is aLineFrameCount too small?)      // If we do GetNextInFlow, we hit a null.      currentFrame->GetNextSibling(&nextFrame);    }    if (!nextFrame) //premature leaving of loop.    {      nextFrame = currentFrame; //back it up. lets show a warning      NS_WARNING("lineFrame Count lied to us from nsILineIterator!\n");    }    nextFrame->GetRect(rect);    if (!rect.width) //this can happen with BR frames and or empty placeholder frames.    {      //if we do hit an empty frame then back up the current frame to the frame before it if there is one.      nextFrame = currentFrame;     }          nsPoint offsetPoint; //used for offset of result frame    nsIView * view; //used for call of get offset from view    nextFrame->GetOffsetFromView(aPresContext, offsetPoint, &view);    offsetPoint.x += 2* aUsedRect.width; //2* just to be sure we are off the edge    // This doesn't seem very efficient since GetPosition    // has to do a binary search.    nsCOMPtr<nsIPresContext> context;    rv = aPos->mTracker->GetPresContext(getter_AddRefs(context));    if (NS_FAILED(rv)) return rv;    PRInt32 endoffset;    rv = nextFrame->GetContentAndOffsetsFromPoint(context,                                                  offsetPoint,                                                  getter_AddRefs(aPos->mResultContent),                                                  aPos->mContentOffset,                                                  endoffset,                                                  aPos->mPreferLeft);    if (NS_SUCCEEDED(rv))      return PR_TRUE;#ifdef DEBUG_paragraph    NS_ASSERTION(PR_FALSE, "Looping around in PeekOffset\n");#endif    aLineFrameCount--;    if (aLineFrameCount == 0)      break;//just fail out  }  return rv;}