[go: nahoru, domu]

Skip to content

Commit

Permalink
Backed out changeset ddfa5cc2ea30 (bug 1478178) for mochitest failure…
Browse files Browse the repository at this point in the history
…s on layout/base/tests/test_reftests_with_caret.html. CLOSED TREE
  • Loading branch information
nbeleuzu committed Aug 8, 2018
1 parent 8252a75 commit f388bf1
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 46 deletions.
6 changes: 0 additions & 6 deletions layout/generic/crashtests/1478178.html

This file was deleted.

1 change: 0 additions & 1 deletion layout/generic/crashtests/crashtests.list
Original file line number Diff line number Diff line change
Expand Up @@ -702,4 +702,3 @@ load 1461979-1.html
load 1467239.html
load 1472403.html
load 1474768.html
load 1478178.html
78 changes: 39 additions & 39 deletions layout/generic/nsLineLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

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));
}

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 (dw) {
pfd->mRecomputeOverflow = true;
}
}

if (dw) {
pfd->mRecomputeOverflow = true;
else {
if (nullptr != pfd->mSpan) {
dw = ApplyFrameJustification(pfd->mSpan, aState);
}
}
} else {
if (nullptr != pfd->mSpan) {
dw = ApplyFrameJustification(pfd->mSpan, aState);

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;
}
}
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;
}
Expand Down

0 comments on commit f388bf1

Please sign in to comment.