Back to index

lightning-sunbird  0.9+nobinonly
Defines | Functions
nsLineLayout.cpp File Reference
#include "plarena.h"
#include "nsCOMPtr.h"
#include "nsLineLayout.h"
#include "nsBlockFrame.h"
#include "nsInlineFrame.h"
#include "nsStyleConsts.h"
#include "nsHTMLContainerFrame.h"
#include "nsSpaceManager.h"
#include "nsStyleContext.h"
#include "nsPresContext.h"
#include "nsIFontMetrics.h"
#include "nsIRenderingContext.h"
#include "nsLayoutAtoms.h"
#include "nsPlaceholderFrame.h"
#include "nsReflowPath.h"
#include "nsIDocument.h"
#include "nsIHTMLDocument.h"
#include "nsIContent.h"
#include "nsITextContent.h"
#include "nsIView.h"
#include "nsIViewManager.h"
#include "nsHTMLAtoms.h"
#include "nsTextFragment.h"
#include "nsBidiUtils.h"
#include "nsLayoutUtils.h"

Go to the source code of this file.

Defines

#define PL_ARENA_CONST_ALIGN_MASK   (sizeof(void*)-1)
#define FIX_BUG_50257
#define PLACED_LEFT   0x1
#define PLACED_RIGHT   0x2
#define HACK_MEW
#define VALIGN_OTHER   0
#define VALIGN_TOP   1
#define VALIGN_BOTTOM   2
#define VERTICAL_ALIGN_FRAMES_NO_MINIMUM   32767
#define VERTICAL_ALIGN_FRAMES_NO_MAXIMUM   -32768

Functions

static nscoord AccumulateImageSizes (nsPresContext &aPresContext, nsIFrame &aFrame)
static PRBool InUnconstrainedTableCell (const nsHTMLReflowState &aBlockReflowState)
PRBool HasPrevInFlow (nsIFrame *aFrame)
PRBool IsPercentageAwareFrame (nsPresContext *aPresContext, nsIFrame *aFrame)

Define Documentation

Definition at line 89 of file nsLineLayout.cpp.

Definition at line 94 of file nsLineLayout.cpp.

Definition at line 43 of file nsLineLayout.cpp.

#define PLACED_LEFT   0x1

Definition at line 91 of file nsLineLayout.cpp.

#define PLACED_RIGHT   0x2

Definition at line 92 of file nsLineLayout.cpp.

Definition at line 1546 of file nsLineLayout.cpp.

Definition at line 1544 of file nsLineLayout.cpp.

#define VALIGN_TOP   1

Definition at line 1545 of file nsLineLayout.cpp.

Definition at line 1910 of file nsLineLayout.cpp.

Definition at line 1909 of file nsLineLayout.cpp.


Function Documentation

static nscoord AccumulateImageSizes ( nsPresContext aPresContext,
nsIFrame aFrame 
) [static]

Definition at line 97 of file nsLineLayout.cpp.

{
  nscoord sizes = 0;

  // see if aFrame is an image frame first
  if (aFrame.GetType() == nsLayoutAtoms::imageFrame) {
    sizes += aFrame.GetSize().width;
  } else {
    // see if there are children to process
    // XXX: process alternate child lists?
    nsIFrame* child = aFrame.GetFirstChild(nsnull);
    while (child) {
      // recurse: note that we already know we are in a child frame, so no need to track further
      sizes += AccumulateImageSizes(aPresContext, *child);
      // now next sibling
      child = child->GetNextSibling();
    }
  }

  return sizes;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool HasPrevInFlow ( nsIFrame aFrame) [inline]

Definition at line 232 of file nsLineLayout.cpp.

{
  nsIFrame *prevInFlow = aFrame->GetPrevInFlow();
  return prevInFlow != nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool InUnconstrainedTableCell ( const nsHTMLReflowState aBlockReflowState) [static]

Definition at line 119 of file nsLineLayout.cpp.

{
  PRBool result = PR_FALSE;

  // get the parent reflow state
  const nsHTMLReflowState* parentReflowState = aBlockReflowState.parentReflowState;
  if (parentReflowState) {
    // check if the frame is a tablecell
    NS_ASSERTION(parentReflowState->mStyleDisplay, "null styleDisplay in parentReflowState unexpected");
    if (parentReflowState->mStyleDisplay &&
        parentReflowState->mStyleDisplay->mDisplay == NS_STYLE_DISPLAY_TABLE_CELL) {
      // see if width is unconstrained or percent
      NS_ASSERTION(parentReflowState->mStylePosition, "null stylePosition in parentReflowState unexpected");
      if(parentReflowState->mStylePosition) {
        switch(parentReflowState->mStylePosition->mWidth.GetUnit()) {
          case eStyleUnit_Auto :
          case eStyleUnit_Null :
            result = PR_TRUE;
            break;
          default:
            result = PR_FALSE;
            break;
        }
      }
    }
  }
  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool IsPercentageAwareFrame ( nsPresContext aPresContext,
nsIFrame aFrame 
)

Definition at line 1595 of file nsLineLayout.cpp.

{
  if (aFrame->GetStateBits() & NS_FRAME_REPLACED_ELEMENT) {
    if (nsLineLayout::IsPercentageAwareReplacedElement(aPresContext, aFrame)) {
      return PR_TRUE;
    }
  }
  else
  {
    nsIFrame *child = aFrame->GetFirstChild(nsnull);
    if (child)
    { // aFrame is an inline container frame, check my frame state
      if (aFrame->GetStateBits() & NS_INLINE_FRAME_CONTAINS_PERCENT_AWARE_CHILD) {
        return PR_TRUE;
      }
    }
    // else it's a frame we just don't care about
  }  
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function: