示例#1
0
nscoord
nsSplittableFrame::GetEffectiveComputedHeight(const nsHTMLReflowState& aReflowState,
        nscoord aConsumedHeight) const
{
    nscoord height = aReflowState.ComputedHeight();
    if (height == NS_INTRINSICSIZE) {
        return NS_INTRINSICSIZE;
    }

    if (aConsumedHeight == NS_INTRINSICSIZE) {
        aConsumedHeight = GetConsumedHeight();
    }

    height -= aConsumedHeight;

    if (aConsumedHeight != 0 && aConsumedHeight != NS_INTRINSICSIZE) {
        // We just subtracted our top-border padding, since it was included in the
        // first frame's height. Add it back to get the content height.
        height += aReflowState.mComputedBorderPadding.top;
    }

    // We may have stretched the frame beyond its computed height. Oh well.
    height = std::max(0, height);

    return height;
}
示例#2
0
nscoord
nsSplittableFrame::GetEffectiveComputedHeight(const nsHTMLReflowState& aReflowState,
                                              nscoord aConsumedHeight) const
{
  nscoord height = aReflowState.ComputedHeight();
  if (height == NS_INTRINSICSIZE) {
    return NS_INTRINSICSIZE;
  }

  if (aConsumedHeight == NS_INTRINSICSIZE) {
    aConsumedHeight = GetConsumedHeight();
  }

  height -= aConsumedHeight;

  // We may have stretched the frame beyond its computed height. Oh well.
  return std::max(0, height);
}