From 43532411b03d5e3158c11e063163bf0034d5fb98 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Mon, 20 Jan 2014 14:02:18 -0800 Subject: [PATCH] Bug 961354 part 1: Move nsCSSOffsetState constructor definition to .cpp file. r=mats --- layout/generic/nsHTMLReflowState.cpp | 17 +++++++++++++++++ layout/generic/nsHTMLReflowState.h | 15 +-------------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index 9f0284311f7..751e28d3023 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -127,6 +127,23 @@ FontSizeInflationListMarginAdjustment(const nsIFrame* aFrame) return 0; } +// NOTE: If we ever want to use nsCSSOffsetState for a flex item or a grid +// item, we need to make it take the containing-block height as well as the +// width, since flex items and grid items resolve vertical percent margins +// and padding against the containing-block height, rather than its width. +nsCSSOffsetState::nsCSSOffsetState(nsIFrame *aFrame, + nsRenderingContext *aRenderingContext, + nscoord aContainingBlockWidth) + : frame(aFrame) + , rendContext(aRenderingContext) + , mWritingMode(aFrame->GetWritingMode()) +{ + MOZ_ASSERT(!aFrame->IsFlexItem(), + "We're about to resolve vertical percent margin & padding " + "values against CB width, which is incorrect for flex items"); + InitOffsets(aContainingBlockWidth, aContainingBlockWidth, frame->GetType()); +} + // Initialize a reflow state for a child frame's reflow. Some state // is copied from the parent reflow state; the remaining state is // computed. diff --git a/layout/generic/nsHTMLReflowState.h b/layout/generic/nsHTMLReflowState.h index 0d6fb9577bc..844ddd83fbb 100644 --- a/layout/generic/nsHTMLReflowState.h +++ b/layout/generic/nsHTMLReflowState.h @@ -151,21 +151,8 @@ public: { } - // NOTE: If we ever want to use nsCSSOffsetState for a flex item or a grid - // item, we need to make it take the containing-block height as well as the - // width, since flex items and grid items resolve vertical percent margins - // and padding against the containing-block height, rather than its width. nsCSSOffsetState(nsIFrame *aFrame, nsRenderingContext *aRenderingContext, - nscoord aContainingBlockWidth) - : frame(aFrame) - , rendContext(aRenderingContext) - , mWritingMode(aFrame->GetWritingMode()) - { - MOZ_ASSERT(!aFrame->IsFlexItem(), - "We're about to resolve vertical percent margin & padding " - "values against CB width, which is incorrect for flex items"); - InitOffsets(aContainingBlockWidth, aContainingBlockWidth, frame->GetType()); - } + nscoord aContainingBlockWidth); #ifdef DEBUG // Reflow trace methods. Defined in nsFrame.cpp so they have access