Backed out changeset ddfa5cc2ea30 (bug 1478178) for mochitest failures on layout/base/tests/test_reftests_with_caret.html. CLOSED TREE

This commit is contained in:
Narcis Beleuzu 2018-08-08 06:48:29 +03:00
Родитель a61a3dece7
Коммит e2bdc2a3f4
3 изменённых файлов: 38 добавлений и 45 удалений

Просмотреть файл

@ -1,6 +0,0 @@
<p style="text-align-last: justify">
A
<wbr/>
&#x0C;
<!-- A -->
</p>

Просмотреть файл

@ -702,4 +702,3 @@ load 1461979-1.html
load 1467239.html
load 1472403.html
load 1474768.html
load 1478178.html

Просмотреть файл

@ -2906,51 +2906,51 @@ nsLineLayout::ApplyFrameJustification(PerSpanData* aPSD,
nscoord deltaICoord = 0;
for (PerFrameData* pfd = aPSD->mFirstFrame; pfd != nullptr; pfd = pfd->mNext) {
if (!pfd->ParticipatesInJustification()) {
continue;
}
// Don't reposition bullets (and other frames that occur out of X-order?)
if (!pfd->mIsBullet) {
nscoord dw = 0;
WritingMode lineWM = mRootSpan->mWritingMode;
const auto& assign = pfd->mJustificationAssignment;
bool isInlineText = pfd->mIsTextFrame &&
!pfd->mWritingMode.IsOrthogonalTo(lineWM);
nscoord dw = 0;
WritingMode lineWM = mRootSpan->mWritingMode;
const auto& assign = pfd->mJustificationAssignment;
bool isInlineText = pfd->mIsTextFrame &&
!pfd->mWritingMode.IsOrthogonalTo(lineWM);
if (isInlineText) {
if (aState.IsJustifiable()) {
// Set corresponding justification gaps here, so that the
// text frame knows how it should add gaps at its sides.
const auto& info = pfd->mJustificationInfo;
auto textFrame = static_cast<nsTextFrame*>(pfd->mFrame);
textFrame->AssignJustificationGaps(assign);
dw = aState.Consume(JustificationUtils::CountGaps(info, assign));
}
if (isInlineText) {
if (aState.IsJustifiable()) {
// Set corresponding justification gaps here, so that the
// text frame knows how it should add gaps at its sides.
const auto& info = pfd->mJustificationInfo;
auto textFrame = static_cast<nsTextFrame*>(pfd->mFrame);
textFrame->AssignJustificationGaps(assign);
dw = aState.Consume(JustificationUtils::CountGaps(info, assign));
if (dw) {
pfd->mRecomputeOverflow = true;
}
}
else {
if (nullptr != pfd->mSpan) {
dw = ApplyFrameJustification(pfd->mSpan, aState);
}
}
if (dw) {
pfd->mRecomputeOverflow = true;
pfd->mBounds.ISize(lineWM) += dw;
nscoord gapsAtEnd = 0;
if (!isInlineText && assign.TotalGaps()) {
// It is possible that we assign gaps to non-text frame or an
// orthogonal text frame. Apply the gaps as margin for them.
deltaICoord += aState.Consume(assign.mGapsAtStart);
gapsAtEnd = aState.Consume(assign.mGapsAtEnd);
dw += gapsAtEnd;
}
} else {
if (nullptr != pfd->mSpan) {
dw = ApplyFrameJustification(pfd->mSpan, aState);
}
}
pfd->mBounds.IStart(lineWM) += deltaICoord;
pfd->mBounds.ISize(lineWM) += dw;
nscoord gapsAtEnd = 0;
if (!isInlineText && assign.TotalGaps()) {
// It is possible that we assign gaps to non-text frame or an
// orthogonal text frame. Apply the gaps as margin for them.
deltaICoord += aState.Consume(assign.mGapsAtStart);
gapsAtEnd = aState.Consume(assign.mGapsAtEnd);
dw += gapsAtEnd;
// The gaps added to the end of the frame should also be
// excluded from the isize added to the annotation.
ApplyLineJustificationToAnnotations(pfd, deltaICoord, dw - gapsAtEnd);
deltaICoord += dw;
pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerSizeForSpan(aPSD));
}
pfd->mBounds.IStart(lineWM) += deltaICoord;
// The gaps added to the end of the frame should also be
// excluded from the isize added to the annotation.
ApplyLineJustificationToAnnotations(pfd, deltaICoord, dw - gapsAtEnd);
deltaICoord += dw;
pfd->mFrame->SetRect(lineWM, pfd->mBounds, ContainerSizeForSpan(aPSD));
}
return deltaICoord;
}