Bug 961354 part 1: Move nsCSSOffsetState constructor definition to .cpp file. r=mats

This commit is contained in:
Daniel Holbert 2014-01-20 14:02:18 -08:00
parent 9de6cfafa6
commit 43532411b0
2 changed files with 18 additions and 14 deletions

View File

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

View File

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