Bug 1646639 - Don't recursively apply the line's start-offset and text-indent to children of a first-line frame. r=dholbert

But do apply any adjustment needed for text-align to the first-line frame itself.

Differential Revision: https://phabricator.services.mozilla.com/D82725
This commit is contained in:
Jonathan Kew 2020-07-11 21:26:02 +00:00
parent 10b6298357
commit 953fcef392
3 changed files with 11 additions and 4 deletions

View File

@ -1486,6 +1486,9 @@ nscoord nsBidiPresUtils::ReorderFrames(nsIFrame* aFirstFrameOnLine,
// aNumFramesOnLine to -1 makes InitLogicalArrayFromLine look at all of
// them.
aNumFramesOnLine = -1;
// As the line frame itself has been adjusted at its inline-start position
// by the caller, we do not want to apply this to its children.
aStart = 0;
}
BidiLineData bld(aFirstFrameOnLine, aNumFramesOnLine);

View File

@ -3186,6 +3186,14 @@ void nsLineLayout::TextAlignLine(nsLineBox* aLine, bool aIsLastLine) {
lineWM, mContainerSize,
psd->mIStart + mTextIndent + dx);
if (dx) {
if (startFrame->mFrame->IsLineFrame()) {
// If startFrame is a ::first-line frame, the mIStart and mTextIndent
// offsets will already have been applied to its position. But we still
// need to apply the text-align adjustment |dx| to its position.
startFrame->mBounds.IStart(lineWM) += dx;
startFrame->mFrame->SetRect(lineWM, startFrame->mBounds,
ContainerSizeForSpan(psd));
}
aLine->IndentBy(dx, ContainerSize());
}
} else if (dx) {

View File

@ -1,4 +0,0 @@
[floating-first-letter-05d0.html]
type: reftest
expected: FAIL
bug: https://bugzilla.mozilla.org/show_bug.cgi?id=1495674