Bug 1669734 - Factor out the logic of computing auto margins for abspos frames to its own method r=dholbert,emilio

Differential Revision: https://phabricator.services.mozilla.com/D107872
This commit is contained in:
Sean Feng
2021-03-15 15:45:17 +00:00
parent 5f30e7e1df
commit db613a561c
2 changed files with 98 additions and 55 deletions

View File

@@ -853,6 +853,26 @@ struct ReflowInput : public SizeComputationInput {
aContainerSize);
}
// Resolve any block-axis 'auto' margins (if any) for an absolutely positioned
// frame. aMargin and aOffsets are both outparams (though we only touch
// aOffsets if the position is overconstrained)
static void ComputeAbsPosBlockAutoMargin(nscoord aAvailMarginSpace,
WritingMode aContainingBlockWM,
bool aIsMarginBStartAuto,
bool aIsMarginBEndAuto,
LogicalMargin& aMargin,
LogicalMargin& aOffsets);
// Resolve any inline-axis 'auto' margins (if any) for an absolutely
// positioned frame. aMargin and aOffsets are both outparams (though we only
// touch aOffsets if the position is overconstrained)
static void ComputeAbsPosInlineAutoMargin(nscoord aAvailMarginSpace,
WritingMode aContainingBlockWM,
bool aIsMarginIStartAuto,
bool aIsMarginIEndAuto,
LogicalMargin& aMargin,
LogicalMargin& aOffsets);
#ifdef DEBUG
// Reflow trace methods. Defined in nsFrame.cpp so they have access
// to the display-reflow infrastructure.