bug 970710 - ensure GetTrimmedOffsets is called with consistent parameters from PropertyProvider::InitializeForMeasure and SetupJustificationSpacing. r=roc

This commit is contained in:
Jonathan Kew 2014-02-13 08:38:48 +00:00
parent 0621f133e7
commit a51fad7aea

View File

@ -2890,7 +2890,7 @@ public:
const gfxSkipCharsIterator& GetEndHint() { return mTempIterator; }
protected:
void SetupJustificationSpacing();
void SetupJustificationSpacing(bool aPostReflow);
void InitFontGroupAndFontMetrics() {
float inflation = (mWhichTextRun == nsTextFrame::eInflated)
@ -3274,7 +3274,7 @@ PropertyProvider::InitializeForDisplay(bool aTrimAfter)
mFrame->GetTrimmedOffsets(mFrag, aTrimAfter);
mStart.SetOriginalOffset(trimmed.mStart);
mLength = trimmed.mLength;
SetupJustificationSpacing();
SetupJustificationSpacing(true);
}
void
@ -3284,7 +3284,7 @@ PropertyProvider::InitializeForMeasure()
mFrame->GetTrimmedOffsets(mFrag, true, false);
mStart.SetOriginalOffset(trimmed.mStart);
mLength = trimmed.mLength;
SetupJustificationSpacing();
SetupJustificationSpacing(false);
}
@ -3326,7 +3326,7 @@ PropertyProvider::FindJustificationRange(gfxSkipCharsIterator* aStart,
}
void
PropertyProvider::SetupJustificationSpacing()
PropertyProvider::SetupJustificationSpacing(bool aPostReflow)
{
NS_PRECONDITION(mLength != INT32_MAX, "Can't call this with undefined length");
@ -3338,7 +3338,7 @@ PropertyProvider::SetupJustificationSpacing()
// called with false for aTrimAfter, we still shouldn't be assigning
// justification space to any trailing whitespace.
nsTextFrame::TrimmedOffsets trimmed =
mFrame->GetTrimmedOffsets(mFrag, true);
mFrame->GetTrimmedOffsets(mFrag, true, aPostReflow);
end.AdvanceOriginal(trimmed.mLength);
gfxSkipCharsIterator realEnd(end);
FindJustificationRange(&start, &end);