diff --git a/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp b/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp index c47ccc8b37e..4e8988f0886 100644 --- a/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp +++ b/mozilla/layout/generic/nsAbsoluteContainingBlock.cpp @@ -456,15 +456,17 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.left) { kidReflowState.mComputedOffsets.left = aContainingBlockWidth - - kidReflowState.mComputedOffsets.right - kidReflowState.mComputedMargin.right - - kidReflowState.mComputedBorderPadding.right - kidDesiredSize.width - - kidReflowState.mComputedMargin.left - kidReflowState.mComputedBorderPadding.left; + kidReflowState.mComputedOffsets.right - + kidReflowState.mComputedMargin.right - + kidDesiredSize.width - + kidReflowState.mComputedMargin.left; } if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.top) { kidReflowState.mComputedOffsets.top = aContainingBlockHeight - - kidReflowState.mComputedOffsets.bottom - kidReflowState.mComputedMargin.bottom - - kidReflowState.mComputedBorderPadding.bottom - kidDesiredSize.height - - kidReflowState.mComputedMargin.top - kidReflowState.mComputedBorderPadding.top; + kidReflowState.mComputedOffsets.bottom - + kidReflowState.mComputedMargin.bottom - + kidDesiredSize.height - + kidReflowState.mComputedMargin.top; } } diff --git a/mozilla/layout/generic/nsViewportFrame.cpp b/mozilla/layout/generic/nsViewportFrame.cpp index a8b3977787f..f1fdcf962b1 100644 --- a/mozilla/layout/generic/nsViewportFrame.cpp +++ b/mozilla/layout/generic/nsViewportFrame.cpp @@ -375,32 +375,28 @@ ViewportFrame::ReflowFixedFrame(nsIPresContext* aPresContext, // Do the reflow rv = aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus); - if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.left) - kidReflowState.mComputedOffsets.left = aReflowState.mComputedWidth - - kidReflowState.mComputedOffsets.right - - kidReflowState.mComputedMargin.right - - kidReflowState.mComputedBorderPadding.right - - kidDesiredSize.width - - kidReflowState.mComputedBorderPadding.left - - kidReflowState.mComputedMargin.left; - if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.top) - kidReflowState.mComputedOffsets.top = aReflowState.mComputedHeight - - kidReflowState.mComputedOffsets.bottom - - kidReflowState.mComputedMargin.bottom - - kidReflowState.mComputedBorderPadding.bottom - - kidDesiredSize.height - - kidReflowState.mComputedBorderPadding.top - - kidReflowState.mComputedMargin.top; - // XXX If the child had a fixed height, then make sure it respected it... if (NS_AUTOHEIGHT != kidReflowState.mComputedHeight) { if (kidDesiredSize.height < kidReflowState.mComputedHeight) { - kidDesiredSize.height = kidReflowState.mComputedHeight; - kidDesiredSize.height += kidReflowState.mComputedBorderPadding.top + - kidReflowState.mComputedBorderPadding.bottom; + kidDesiredSize.height = kidReflowState.mComputedHeight + + kidReflowState.mComputedBorderPadding.top + + kidReflowState.mComputedBorderPadding.bottom; } } + if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.left) + kidReflowState.mComputedOffsets.left = aReflowState.mComputedWidth - + kidReflowState.mComputedOffsets.right - + kidReflowState.mComputedMargin.right - + kidDesiredSize.width - + kidReflowState.mComputedMargin.left; + if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.top) + kidReflowState.mComputedOffsets.top = aReflowState.mComputedHeight - + kidReflowState.mComputedOffsets.bottom - + kidReflowState.mComputedMargin.bottom - + kidDesiredSize.height - + kidReflowState.mComputedMargin.top; + // Position the child nsRect rect(kidReflowState.mComputedOffsets.left + kidReflowState.mComputedMargin.left, kidReflowState.mComputedOffsets.top + kidReflowState.mComputedMargin.top, diff --git a/mozilla/layout/html/base/src/nsAbsoluteContainingBlock.cpp b/mozilla/layout/html/base/src/nsAbsoluteContainingBlock.cpp index c47ccc8b37e..4e8988f0886 100644 --- a/mozilla/layout/html/base/src/nsAbsoluteContainingBlock.cpp +++ b/mozilla/layout/html/base/src/nsAbsoluteContainingBlock.cpp @@ -456,15 +456,17 @@ nsAbsoluteContainingBlock::ReflowAbsoluteFrame(nsIFrame* aDelegat if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.left) { kidReflowState.mComputedOffsets.left = aContainingBlockWidth - - kidReflowState.mComputedOffsets.right - kidReflowState.mComputedMargin.right - - kidReflowState.mComputedBorderPadding.right - kidDesiredSize.width - - kidReflowState.mComputedMargin.left - kidReflowState.mComputedBorderPadding.left; + kidReflowState.mComputedOffsets.right - + kidReflowState.mComputedMargin.right - + kidDesiredSize.width - + kidReflowState.mComputedMargin.left; } if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.top) { kidReflowState.mComputedOffsets.top = aContainingBlockHeight - - kidReflowState.mComputedOffsets.bottom - kidReflowState.mComputedMargin.bottom - - kidReflowState.mComputedBorderPadding.bottom - kidDesiredSize.height - - kidReflowState.mComputedMargin.top - kidReflowState.mComputedBorderPadding.top; + kidReflowState.mComputedOffsets.bottom - + kidReflowState.mComputedMargin.bottom - + kidDesiredSize.height - + kidReflowState.mComputedMargin.top; } } diff --git a/mozilla/layout/html/base/src/nsViewportFrame.cpp b/mozilla/layout/html/base/src/nsViewportFrame.cpp index a8b3977787f..f1fdcf962b1 100644 --- a/mozilla/layout/html/base/src/nsViewportFrame.cpp +++ b/mozilla/layout/html/base/src/nsViewportFrame.cpp @@ -375,32 +375,28 @@ ViewportFrame::ReflowFixedFrame(nsIPresContext* aPresContext, // Do the reflow rv = aKidFrame->Reflow(aPresContext, kidDesiredSize, kidReflowState, aStatus); - if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.left) - kidReflowState.mComputedOffsets.left = aReflowState.mComputedWidth - - kidReflowState.mComputedOffsets.right - - kidReflowState.mComputedMargin.right - - kidReflowState.mComputedBorderPadding.right - - kidDesiredSize.width - - kidReflowState.mComputedBorderPadding.left - - kidReflowState.mComputedMargin.left; - if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.top) - kidReflowState.mComputedOffsets.top = aReflowState.mComputedHeight - - kidReflowState.mComputedOffsets.bottom - - kidReflowState.mComputedMargin.bottom - - kidReflowState.mComputedBorderPadding.bottom - - kidDesiredSize.height - - kidReflowState.mComputedBorderPadding.top - - kidReflowState.mComputedMargin.top; - // XXX If the child had a fixed height, then make sure it respected it... if (NS_AUTOHEIGHT != kidReflowState.mComputedHeight) { if (kidDesiredSize.height < kidReflowState.mComputedHeight) { - kidDesiredSize.height = kidReflowState.mComputedHeight; - kidDesiredSize.height += kidReflowState.mComputedBorderPadding.top + - kidReflowState.mComputedBorderPadding.bottom; + kidDesiredSize.height = kidReflowState.mComputedHeight + + kidReflowState.mComputedBorderPadding.top + + kidReflowState.mComputedBorderPadding.bottom; } } + if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.left) + kidReflowState.mComputedOffsets.left = aReflowState.mComputedWidth - + kidReflowState.mComputedOffsets.right - + kidReflowState.mComputedMargin.right - + kidDesiredSize.width - + kidReflowState.mComputedMargin.left; + if (NS_AUTOOFFSET == kidReflowState.mComputedOffsets.top) + kidReflowState.mComputedOffsets.top = aReflowState.mComputedHeight - + kidReflowState.mComputedOffsets.bottom - + kidReflowState.mComputedMargin.bottom - + kidDesiredSize.height - + kidReflowState.mComputedMargin.top; + // Position the child nsRect rect(kidReflowState.mComputedOffsets.left + kidReflowState.mComputedMargin.left, kidReflowState.mComputedOffsets.top + kidReflowState.mComputedMargin.top,