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