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
parent 6435612f41
commit 66fa2911ab

View File

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