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
Родитель 22e25a5834
Коммит 043f9f8399
2 изменённых файлов: 30 добавлений и 0 удалений

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

@ -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
{

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

@ -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