diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index 5481474d429..e8a845658f9 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -2132,11 +2132,11 @@ static PRUint32 GetSkippedDistance(const gfxSkipCharsIterator& aStart, void PropertyProvider::FindEndOfJustificationRange(gfxSkipCharsIterator* aIter) { - if (!(mFrame->GetStateBits() & TEXT_END_OF_LINE)) - return; + aIter->SetOriginalOffset(mStart.GetOriginalOffset() + mLength); // Ignore trailing cluster at end of line for justification purposes - aIter->SetOriginalOffset(mStart.GetOriginalOffset() + mLength); + if (!(mFrame->GetStateBits() & TEXT_END_OF_LINE)) + return; while (aIter->GetOriginalOffset() > mStart.GetOriginalOffset()) { aIter->AdvanceOriginal(-1); if (!aIter->IsOriginalCharSkipped() &&