Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsTableOuterFrame.cpp File Reference
#include "nsTableOuterFrame.h"
#include "nsTableFrame.h"
#include "nsHTMLReflowCommand.h"
#include "nsStyleContext.h"
#include "nsStyleConsts.h"
#include "nsPresContext.h"
#include "nsIRenderingContext.h"
#include "nsCSSRendering.h"
#include "nsIContent.h"
#include "nsVoidArray.h"
#include "prinrval.h"
#include "nsLayoutAtoms.h"
#include "nsHTMLParts.h"
#include "nsIPresShell.h"
#include "nsIServiceManager.h"
#include "nsIDOMNode.h"

Go to the source code of this file.

Defines

#define NS_TABLE_FRAME_CAPTION_LIST_INDEX   0
#define NO_SIDE   100

Functions

nsresult NS_NewTableCaptionFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)
static void FixAutoMargins (nscoord aAvailWidth, nscoord aChildWidth, nsHTMLReflowState &aReflowState)
static nscoord CalcAutoMargin (nscoord aAutoMargin, nscoord aOppositeMargin, nscoord aContainBlockSize, nscoord aFrameSize, float aPixelToTwips)
static void MoveFrameTo (nsIFrame *aFrame, nscoord aX, nscoord aY)
static nsSize GetContainingBlockSize (const nsHTMLReflowState &aOuterRS)
static PRBool IsPctHeight (nsIFrame *aFrame)
nsresult NS_NewTableOuterFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)

Define Documentation

#define NO_SIDE   100

Definition at line 61 of file nsTableOuterFrame.cpp.

Definition at line 60 of file nsTableOuterFrame.cpp.


Function Documentation

static nscoord CalcAutoMargin ( nscoord  aAutoMargin,
nscoord  aOppositeMargin,
nscoord  aContainBlockSize,
nscoord  aFrameSize,
float  aPixelToTwips 
) [static]

Definition at line 483 of file nsTableOuterFrame.cpp.

{
  nscoord margin;
  if (NS_AUTOMARGIN == aOppositeMargin) 
    margin = nsTableFrame::RoundToPixel((aContainBlockSize - aFrameSize) / 2, aPixelToTwips);
  else {
    margin = aContainBlockSize - aFrameSize - aOppositeMargin;
  }
  return PR_MAX(0, margin);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void FixAutoMargins ( nscoord  aAvailWidth,
nscoord  aChildWidth,
nsHTMLReflowState aReflowState 
) [static]

Definition at line 418 of file nsTableOuterFrame.cpp.

{
  // see if there are auto margins. they may have been set to 0 in mComputedMargin
  PRBool hasAutoMargin = eStyleUnit_Auto == aReflowState.mStyleMargin->mMargin.GetLeftUnit() ||
                         eStyleUnit_Auto == aReflowState.mStyleMargin->mMargin.GetRightUnit();
  if (hasAutoMargin) {
    nscoord width = aChildWidth;
    if (NS_UNCONSTRAINEDSIZE == width) {
      width = 0;
    }
    aReflowState.CalculateBlockSideMargins(aAvailWidth, width);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsSize GetContainingBlockSize ( const nsHTMLReflowState aOuterRS) [static]

Definition at line 511 of file nsTableOuterFrame.cpp.

{
  nsSize size(0,0);
  const nsHTMLReflowState* containRS =
    aOuterRS.mCBReflowState;

  if (containRS) {
    size.width = containRS->mComputedWidth;
    if (NS_UNCONSTRAINEDSIZE == size.width) {
      size.width = 0;
    }
    size.height = containRS->mComputedHeight;
    if (NS_UNCONSTRAINEDSIZE == size.height) {
      size.height = 0;
    }
  }
  return size;
}

Here is the caller graph for this function:

static PRBool IsPctHeight ( nsIFrame aFrame) [static]

Definition at line 1850 of file nsTableOuterFrame.cpp.

{
  if (aFrame) {
    const nsStylePosition* position = aFrame->GetStylePosition();
    if (eStyleUnit_Percent == position->mHeight.GetUnit()) {
      float percent = position->mHeight.GetPercentValue();
      if (percent > 0.0f) {
        return PR_TRUE;
      }
    }
  }
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void MoveFrameTo ( nsIFrame aFrame,
nscoord  aX,
nscoord  aY 
) [static]

Definition at line 499 of file nsTableOuterFrame.cpp.

{
  nsPoint pt = aFrame->GetPosition();
  if ((pt.x != aX) || (pt.y != aY)) {
    aFrame->SetPosition(nsPoint(aX, aY));
    nsTableFrame::RePositionViews(aFrame);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult NS_NewTableCaptionFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)

Definition at line 88 of file nsTableOuterFrame.cpp.

{
  NS_PRECONDITION(aNewFrame, "null OUT ptr");
  if (nsnull == aNewFrame) {
    return NS_ERROR_NULL_POINTER;
  }
  nsTableCaptionFrame* it = new (aPresShell) nsTableCaptionFrame;
  if (nsnull == it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
  *aNewFrame = it;
  return NS_OK;
}

Here is the caller graph for this function:

nsresult NS_NewTableOuterFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)
Parameters:
aPresShellthe presentation shell
aResultthe new object is returned in this out-param
Returns:
NS_OK if the frame was properly allocated, otherwise an error code

Definition at line 2174 of file nsTableOuterFrame.cpp.

{
  NS_PRECONDITION(aNewFrame, "null OUT ptr");
  if (nsnull == aNewFrame) {
    return NS_ERROR_NULL_POINTER;
  }
  nsTableOuterFrame* it = new (aPresShell) nsTableOuterFrame;
  if (nsnull == it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
  *aNewFrame = it;
  return NS_OK;
}

Here is the caller graph for this function: