From 6dc3270ec79c852865b65aabfda894e3d0cd00fa Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Wed, 12 Apr 2006 01:07:01 +0000 Subject: [PATCH] Make line boxes have the right width when justifying. Bug 309761, r+sr=roc git-svn-id: svn://10.0.0.236/trunk@194200 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsLineLayout.cpp | 4 +++- mozilla/layout/generic/nsLineLayout.h | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/mozilla/layout/generic/nsLineLayout.cpp b/mozilla/layout/generic/nsLineLayout.cpp index 8bede05d2f3..7f75e8c9fc7 100644 --- a/mozilla/layout/generic/nsLineLayout.cpp +++ b/mozilla/layout/generic/nsLineLayout.cpp @@ -2839,7 +2839,9 @@ nsLineLayout::HorizontalAlignFrames(nsRect& aLineBounds, if (numSpaces > 0) { FrameJustificationState state = { numSpaces, numLetters, remainingWidth, 0, 0, 0, 0, 0 }; - ApplyFrameJustification(psd, &state); + // Apply the justification, and make sure to update our linebox + // width to account for it. + aLineBounds.width += ApplyFrameJustification(psd, &state); } } } diff --git a/mozilla/layout/generic/nsLineLayout.h b/mozilla/layout/generic/nsLineLayout.h index f6e80e08d1d..2bc6f513eaf 100644 --- a/mozilla/layout/generic/nsLineLayout.h +++ b/mozilla/layout/generic/nsLineLayout.h @@ -527,7 +527,11 @@ protected: nscoord mWidthForSpacesProcessed; nscoord mWidthForLettersProcessed; }; - nscoord ApplyFrameJustification(PerSpanData* aPSD, FrameJustificationState* aState); + + // Apply justification. The return value is the amount by which the width of + // the span corresponding to aPSD got increased due to justification. + nscoord ApplyFrameJustification(PerSpanData* aPSD, + FrameJustificationState* aState); #ifdef DEBUG