From 5f02c3cba18da90122ddf3e842fb780cbb21a4b2 Mon Sep 17 00:00:00 2001 From: Xidorn Quan Date: Fri, 22 Apr 2016 09:18:41 +1000 Subject: [PATCH] Bug 1097499 part 12 - Handle spacing sensibly for text-combine-upright. r=jfkthame MozReview-Commit-ID: DSBMUcccfNi --HG-- extra : source : f03b556d12d5c28f7d8e3af3d7977470784eea76 --- layout/generic/nsTextFrame.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index 9a536ebb1b66..e19dde823ce8 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -3077,6 +3077,16 @@ static void FindClusterEnd(gfxTextRun* aTextRun, int32_t aOriginalEnd, void PropertyProvider::ComputeJustification(Range aRange) { + // Horizontal-in-vertical frame is orthogonal to the line, so it + // doesn't actually include any justification opportunity inside. + // Note: although the spec says such frame should be treated as a + // U+FFFC, which indicates it is justifiable on its sides, we don't + // do that because it is difficult to implement, and doesn't make + // any difference in common use cases. + if (mFrame->StyleContext()->IsTextCombined()) { + return; + } + bool isCJ = IsChineseOrJapanese(mFrame); nsSkipCharsRunIterator run( mStart, nsSkipCharsRunIterator::LENGTH_INCLUDES_SKIPPED, aRange.Length()); @@ -3170,6 +3180,10 @@ PropertyProvider::GetSpacingInternal(Range aRange, Spacing* aSpacing, aSpacing[index].mAfter = 0.0; } + if (mFrame->StyleContext()->IsTextCombined()) { + return; + } + // Find our offset into the original+transformed string gfxSkipCharsIterator start(mStart); start.SetSkippedOffset(aRange.start);