Bug 1008969 - part 2, Add a basic nsGridContainerFrame::Reflow() method. r=dholbert

This commit is contained in:
Mats Palmgren 2014-05-13 00:47:54 +00:00
parent b1b351e310
commit ab4c3ccbd2
2 changed files with 30 additions and 0 deletions

View File

@ -35,6 +35,32 @@ NS_NewGridContainerFrame(nsIPresShell* aPresShell,
// nsGridContainerFrame Method Implementations
// ===========================================
void
nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus)
{
DO_GLOBAL_REFLOW_COUNT("nsGridContainerFrame");
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
if (IsFrameTreeTooDeep(aReflowState, aDesiredSize, aStatus)) {
return;
}
nsMargin bp = aReflowState.ComputedPhysicalBorderPadding();
ApplySkipSides(bp);
nscoord contentHeight = GetEffectiveComputedHeight(aReflowState);
if (contentHeight == NS_AUTOHEIGHT) {
contentHeight = 0;
}
aDesiredSize.Width() = aReflowState.ComputedWidth() + bp.LeftRight();
aDesiredSize.Height() = contentHeight + bp.TopBottom();
aDesiredSize.SetOverflowAreasToDesiredBounds();
aStatus = NS_FRAME_COMPLETE;
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aDesiredSize);
}
nsIAtom*
nsGridContainerFrame::GetType() const
{

View File

@ -26,6 +26,10 @@ public:
NS_DECL_QUERYFRAME
// nsIFrame overrides
void Reflow(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus) MOZ_OVERRIDE;
virtual nsIAtom* GetType() const MOZ_OVERRIDE;
#ifdef DEBUG_FRAME_DUMP