Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsInlineFrame.cpp File Reference
#include "nsCOMPtr.h"
#include "nsInlineFrame.h"
#include "nsBlockFrame.h"
#include "nsHTMLAtoms.h"
#include "nsHTMLParts.h"
#include "nsStyleContext.h"
#include "nsIPresShell.h"
#include "nsPresContext.h"
#include "nsIRenderingContext.h"
#include "nsIFontMetrics.h"
#include "nsAbsoluteContainingBlock.h"
#include "nsLayoutAtoms.h"
#include "nsCSSAnonBoxes.h"
#include "nsReflowPath.h"
#include "nsAutoPtr.h"
#include "nsFrameManager.h"

Go to the source code of this file.

Functions

 NS_DEFINE_IID (kInlineFrameCID, NS_INLINE_FRAME_CID)
nsresult NS_NewInlineFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)
PRBool IsPaddingZero (nsStyleUnit aUnit, nsStyleCoord &aCoord)
PRBool IsMarginZero (nsStyleUnit aUnit, nsStyleCoord &aCoord)
static void SetContainsPercentAwareChild (nsIFrame *aFrame)
static void MarkPercentAwareFrame (nsPresContext *aPresContext, nsInlineFrame *aInline, nsIFrame *aFrame)
static void ReParentChildListStyle (nsPresContext *aPresContext, nsFrameList &aFrameList, nsIFrame *aParentFrame)
nsresult NS_NewFirstLineFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)
nsresult NS_NewPositionedInlineFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)

Function Documentation

PRBool IsMarginZero ( nsStyleUnit  aUnit,
nsStyleCoord aCoord 
) [inline]

Definition at line 126 of file nsInlineFrame.cpp.

{
    return (aUnit == eStyleUnit_Null ||
            aUnit == eStyleUnit_Auto ||
            (aUnit == eStyleUnit_Coord && aCoord.GetCoordValue() == 0) ||
            (aUnit == eStyleUnit_Percent && aCoord.GetPercentValue() == 0.0));
}

Here is the call graph for this function:

PRBool IsPaddingZero ( nsStyleUnit  aUnit,
nsStyleCoord aCoord 
) [inline]

Definition at line 118 of file nsInlineFrame.cpp.

{
    return (aUnit == eStyleUnit_Null ||
            (aUnit == eStyleUnit_Coord && aCoord.GetCoordValue() == 0) ||
            (aUnit == eStyleUnit_Percent && aCoord.GetPercentValue() == 0.0));
}

Here is the call graph for this function:

static void MarkPercentAwareFrame ( nsPresContext aPresContext,
nsInlineFrame aInline,
nsIFrame aFrame 
) [static]

Definition at line 730 of file nsInlineFrame.cpp.

{
  if (aFrame->GetStateBits() & NS_FRAME_REPLACED_ELEMENT) 
  { // aFrame is a replaced element, check it's style
    if (nsLineLayout::IsPercentageAwareReplacedElement(aPresContext, aFrame)) {
      SetContainsPercentAwareChild(aInline);
    }
  }
  else
  {
    if (aFrame->GetFirstChild(nsnull))
    { // aFrame is an inline container frame, check my frame state
      if (aFrame->GetStateBits() & NS_INLINE_FRAME_CONTAINS_PERCENT_AWARE_CHILD) {
        SetContainsPercentAwareChild(aInline); // if a child container is effected, so am I
      }
    }
    // else frame is a leaf that we don't care about
  }   
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_DEFINE_IID ( kInlineFrameCID  ,
NS_INLINE_FRAME_CID   
)
nsresult NS_NewFirstLineFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)

Definition at line 990 of file nsInlineFrame.cpp.

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

Here is the caller graph for this function:

nsresult NS_NewInlineFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)

Definition at line 71 of file nsInlineFrame.cpp.

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

Here is the caller graph for this function:

nsresult NS_NewPositionedInlineFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)

Definition at line 1162 of file nsInlineFrame.cpp.

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

Here is the caller graph for this function:

static void ReParentChildListStyle ( nsPresContext aPresContext,
nsFrameList aFrameList,
nsIFrame aParentFrame 
) [static]

Definition at line 976 of file nsInlineFrame.cpp.

{
  nsFrameManager *frameManager = aPresContext->FrameManager();

  for (nsIFrame* kid = aFrameList.FirstChild(); kid;
       kid = kid->GetNextSibling()) {
    NS_ASSERTION(kid->GetParent() == aParentFrame, "Bogus parentage");
    frameManager->ReParentStyleContext(kid);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void SetContainsPercentAwareChild ( nsIFrame aFrame) [static]

Definition at line 724 of file nsInlineFrame.cpp.

Here is the call graph for this function:

Here is the caller graph for this function: