Bug 1133945 - Fix behavior of vertical-align with a specified length, relative to dominant centered baseline in vertical mode. r=smontagu

This commit is contained in:
Jonathan Kew 2015-03-26 12:34:57 +00:00
parent 2fad07bfc9
commit cbbd8efccc

View File

@ -2173,7 +2173,14 @@ nsLineLayout::VerticalAlignFrames(PerSpanData* psd)
// inverted relative to block direction.
nscoord revisedBaselineBCoord = baselineBCoord - offset *
lineWM.FlowRelativeToLineRelativeFactor();
pfd->mBounds.BStart(lineWM) = revisedBaselineBCoord - pfd->mAscent;
if (lineWM.IsVertical() && !lineWM.IsSideways()) {
// If we're using a dominant center baseline, we align with the center
// of the frame being placed (bug 1133945).
pfd->mBounds.BStart(lineWM) =
revisedBaselineBCoord - pfd->mBounds.BSize(lineWM)/2;
} else {
pfd->mBounds.BStart(lineWM) = revisedBaselineBCoord - pfd->mAscent;
}
pfd->mBlockDirAlign = VALIGN_OTHER;
}