Bug 1121748 - patch 2 - Use the flex-item frame's final size when computing its logical position within the flex container. r=smontagu

This commit is contained in:
Jonathan Kew 2015-02-02 14:17:00 -08:00
Родитель 2df582470e
Коммит d92097e485
1 изменённых файлов: 5 добавлений и 4 удалений

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

@ -3676,8 +3676,12 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
//XXX Can we calculate the logical position more directly instead
// of this double conversion?
nsSize finalFlexedPhysicalSize =
aAxisTracker.PhysicalSizeFromLogicalSizes(item->GetMainSize(),
item->GetCrossSize());
LogicalPoint framePos(outerWM, physicalPosn,
containerWidth - item->Frame()->GetRect().width);
containerWidth - finalFlexedPhysicalSize.width -
item->GetBorderPadding().LeftRight());
// (Intentionally snapshotting this before ApplyRelativePositioning, to
// maybe use for setting the flex container's baseline.)
@ -3689,9 +3693,6 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
if (item->HadMeasuringReflow()) {
// We've already reflowed the child once. Was the size we gave it in
// that reflow the same as its final (post-flexing/stretching) size?
nsSize finalFlexedPhysicalSize =
aAxisTracker.PhysicalSizeFromLogicalSizes(item->GetMainSize(),
item->GetCrossSize());
if (item->Frame()->GetSize() == finalFlexedPhysicalSize) {
// It has the correct size --> no need to reflow! Just make sure it's
// at the right position.