printf(": trim => %d\n", dw);
PRINTF(": trim => %d\n", dw);
nsTextFrame::TrimTrailingWhiteSpace(nsIPresContext* aPresContext,                                    nsIRenderingContext& aRC,                                    nscoord& aDeltaWidth){  nscoord dw = 0;  const nsStyleText* textStyle = (const nsStyleText*)    mStyleContext->GetStyleData(eStyleStruct_Text);  if (mContentLength &&      (NS_STYLE_WHITESPACE_PRE != textStyle->mWhiteSpace) &&      (NS_STYLE_WHITESPACE_MOZ_PRE_WRAP != textStyle->mWhiteSpace)) {    // Get the text fragments that make up our content    nsCOMPtr<nsITextContent> tc = do_QueryInterface(mContent);    if (tc) {      const nsTextFragment* frag;      tc->GetText(&frag);      PRInt32 lastCharIndex = mContentOffset + mContentLength - 1;      if (lastCharIndex < frag->GetLength()) {        PRUnichar ch = frag->CharAt(lastCharIndex);        if (XP_IS_SPACE(ch)) {          // Get font metrics for a space so we can adjust the width by the          // right amount.          const nsStyleFont* fontStyle = (const nsStyleFont*)            mStyleContext->GetStyleData(eStyleStruct_Font);          aRC.SetFont(fontStyle->mFont);          aRC.GetWidth(' ', dw);          // NOTE: Trailing whitespace includes word spacing!          PRIntn unit = textStyle->mWordSpacing.GetUnit();          if (eStyleUnit_Coord == unit) {            dw += textStyle->mWordSpacing.GetCoordValue();          }        }      }    }  }#ifdef NOISY_TRIM  ListTag(stdout);  printf(": trim => %d\n", dw);#endif  if (0 != dw) {    mState |= TEXT_TRIMMED_WS;  }  else {    mState &= ~TEXT_TRIMMED_WS;  }  aDeltaWidth = dw;  return NS_OK;}