else if (!pfd->mIsTextFrame) {
else if (!pfd->GetFlag(PFD_ISTEXTFRAME)) {
nsLineLayout::TrimTrailingWhiteSpaceIn(PerSpanData* psd,                                       nscoord* aDeltaWidth){// XXX what about NS_STYLE_DIRECTION_RTL?  if (NS_STYLE_DIRECTION_RTL == psd->mDirection) {    *aDeltaWidth = 0;    return PR_TRUE;  }  PerFrameData* pfd = psd->mFirstFrame;  if (!pfd) {    *aDeltaWidth = 0;    return PR_FALSE;  }  pfd = pfd->Last();  while (nsnull != pfd) {#ifdef REALLY_NOISY_TRIM    nsFrame::ListTag(stdout, (psd == mRootSpan                              ? mBlockReflowState->frame                              : psd->mFrame->mFrame));    printf(": attempting trim of ");    nsFrame::ListTag(stdout, pfd->mFrame);    printf("\n");#endif    PerSpanData* childSpan = pfd->mSpan;    if (childSpan) {      // Maybe the child span has the trailing white-space in it?      if (TrimTrailingWhiteSpaceIn(childSpan, aDeltaWidth)) {        nscoord deltaWidth = *aDeltaWidth;        if (deltaWidth) {          // Adjust the child spans frame size          pfd->mBounds.width -= deltaWidth;          if (psd != mRootSpan) {            // When the child span is not a direct child of the block            // we need to update the child spans frame rectangle            // because it most likely will not be done again. Spans            // that are direct children of the block will be updated            // later, however, because the VerticalAlignFrames method            // will be run after this method.            nsRect r;            nsIFrame* f = pfd->mFrame;            f->GetRect(r);            r.width -= deltaWidth;            f->SetRect(mPresContext, r);          }          // Adjust the right edge of the span that contains the child span          psd->mX -= deltaWidth;          // Slide any frames that follow the child span over by the          // right amount. The only thing that can follow the child          // span is empty stuff, so we are just making things          // sensible (keeping the combined area honest).          while (pfd->mNext) {            pfd = pfd->mNext;            pfd->mBounds.x -= deltaWidth;          }        }        return PR_TRUE;      }    }    else if (!pfd->mIsTextFrame) {      // If we hit a frame on the end that's not text, then there is      // no trailing whitespace to trim. Stop the search.      *aDeltaWidth = 0;      return PR_TRUE;    }    else if (pfd->mIsNonEmptyTextFrame) {      nscoord deltaWidth = 0;      pfd->mFrame->TrimTrailingWhiteSpace(mPresContext,                                          *mBlockReflowState->rendContext,                                          deltaWidth);#ifdef NOISY_TRIM      nsFrame::ListTag(stdout, (psd == mRootSpan                                ? mBlockReflowState->frame                                : psd->mFrame->mFrame));      printf(": trim of ");      nsFrame::ListTag(stdout, pfd->mFrame);      printf(" returned %d\n", deltaWidth);#endif      if (deltaWidth) {        pfd->mBounds.width -= deltaWidth;        pfd->mCombinedArea.width -= deltaWidth;        if (0 == pfd->mBounds.width) {          pfd->mMaxElementSize.width = 0;          pfd->mMaxElementSize.height = 0;        }        // See if the text frame has already been placed in its parent        if (psd != mRootSpan) {          // The frame was already placed during psd's          // reflow. Update the frames rectangle now.          pfd->mFrame->SetRect(mPresContext, pfd->mBounds);        }        // Adjust containing span's right edge        psd->mX -= deltaWidth;        // Slide any frames that follow the text frame over by the        // right amount. The only thing that can follow the text        // frame is empty stuff, so we are just making things        // sensible (keeping the combined area honest).        while (pfd->mNext) {          pfd = pfd->mNext;          pfd->mBounds.x -= deltaWidth;        }      }      // Pass up to caller so they can shrink their span      *aDeltaWidth = deltaWidth;      return PR_TRUE;    }    pfd = pfd->mPrev;  }  *aDeltaWidth = 0;  return PR_FALSE;}