зеркало из https://github.com/mozilla/gecko-dev.git
Bug 380625. (Not Part Of The Build). Fix cluster count for trimmed spaces.
This commit is contained in:
Родитель
eb8714ce2b
Коммит
fc987538d0
|
@ -5027,6 +5027,18 @@ nsTextFrame::Reflow(nsPresContext* aPresContext,
|
|||
// This is corrected for in nsLineLayout::TrimWhiteSpaceIn.
|
||||
PRInt32 numJustifiableCharacters =
|
||||
provider.ComputeJustifiableCharacters(offset, charsFit);
|
||||
// Currently canTrimTrailingWhitespace is always true here
|
||||
// because of the !textStyle->WhiteSpaceIsSignificant() test,
|
||||
// but that could change...
|
||||
if (canTrimTrailingWhitespace) {
|
||||
// Count trimmed spaces and add them to the cluster count
|
||||
PRUint32 charIndex = transformedCharsFit;
|
||||
while (charIndex > 0 && mTextRun->GetChar(charIndex - 1) == ' ') {
|
||||
++textMetrics.mClusterCount;
|
||||
--charIndex;
|
||||
}
|
||||
}
|
||||
|
||||
NS_ASSERTION(numJustifiableCharacters <= textMetrics.mClusterCount,
|
||||
"Justifiable characters combined???");
|
||||
lineLayout.SetTextJustificationWeights(numJustifiableCharacters,
|
||||
|
|
Загрузка…
Ссылка в новой задаче