aLastCharIsJustifiable = PR_TRUE; } else if (IsJustifiableCharacter(ch, IsChineseJapaneseLangGroup())) { aLastCharIsJustifiable = PR_TRUE;
nsTextFrame::TrimTrailingWhiteSpace(nsPresContext* aPresContext,                                    nsIRenderingContext& aRC,                                    nscoord& aDeltaWidth,                                    PRBool& aLastCharIsJustifiable){  aLastCharIsJustifiable = PR_FALSE;  mState |= TEXT_IS_END_OF_LINE;  // in some situation (for instance, in wrapping mode, last space will not   // be added to total width if it exceed maxwidth), this flag will be set   // and we shouldn't trim non-added space  if (mState & TEXT_TRIMMED_WS) {    aDeltaWidth = 0;    return NS_OK;  }  nscoord dw = 0;  const nsStyleText* textStyle = GetStyleText();  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->Text();      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.          SetFontFromStyle(&aRC, mStyleContext);          aRC.GetWidth(' ', dw);          // NOTE: Trailing whitespace includes word and letter spacing!          nsStyleUnit unit;          unit = textStyle->mWordSpacing.GetUnit();          if (eStyleUnit_Coord == unit) {            dw += textStyle->mWordSpacing.GetCoordValue();          }          unit = textStyle->mLetterSpacing.GetUnit();          if (eStyleUnit_Coord == unit) {            dw += textStyle->mLetterSpacing.GetCoordValue();          }          aLastCharIsJustifiable = PR_TRUE;        } else if (IsJustifiableCharacter(ch, IsChineseJapaneseLangGroup())) {          aLastCharIsJustifiable = PR_TRUE;        }      }    }  }#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;}