Back to index

lightning-sunbird  0.9+nobinonly
Classes | Defines | Functions | Variables
nsCSSFrameConstructor.cpp File Reference
#include "nsCSSFrameConstructor.h"
#include "nsCRT.h"
#include "nsIAtom.h"
#include "nsIURL.h"
#include "nsISupportsArray.h"
#include "nsHashtable.h"
#include "nsIStyledContent.h"
#include "nsIHTMLDocument.h"
#include "nsIStyleRule.h"
#include "nsIFrame.h"
#include "nsHTMLAtoms.h"
#include "nsPresContext.h"
#include "nsILinkHandler.h"
#include "nsIDocument.h"
#include "nsTableFrame.h"
#include "nsTableColGroupFrame.h"
#include "nsTableColFrame.h"
#include "nsIDOMHTMLDocument.h"
#include "nsIDOMHTMLTableColElement.h"
#include "nsIDOMHTMLTableCaptionElem.h"
#include "nsTableCellFrame.h"
#include "nsHTMLParts.h"
#include "nsIPresShell.h"
#include "nsStyleSet.h"
#include "nsIViewManager.h"
#include "nsIScrollableView.h"
#include "nsStyleConsts.h"
#include "nsTableOuterFrame.h"
#include "nsIDOMXULElement.h"
#include "nsHTMLContainerFrame.h"
#include "nsINameSpaceManager.h"
#include "nsLayoutAtoms.h"
#include "nsIDOMHTMLSelectElement.h"
#include "nsIDOMHTMLLegendElement.h"
#include "nsIComboboxControlFrame.h"
#include "nsIListControlFrame.h"
#include "nsISelectControlFrame.h"
#include "nsIRadioControlFrame.h"
#include "nsICheckboxControlFrame.h"
#include "nsIDOMCharacterData.h"
#include "nsIDOMHTMLImageElement.h"
#include "nsITextContent.h"
#include "nsPlaceholderFrame.h"
#include "nsTableRowGroupFrame.h"
#include "nsStyleChangeList.h"
#include "nsIFormControl.h"
#include "nsCSSAnonBoxes.h"
#include "nsCSSPseudoElements.h"
#include "nsIDeviceContext.h"
#include "nsTextFragment.h"
#include "nsIAnonymousContentCreator.h"
#include "nsFrameManager.h"
#include "nsLegendFrame.h"
#include "nsIContentIterator.h"
#include "nsBoxLayoutState.h"
#include "nsIBindingManager.h"
#include "nsXBLBinding.h"
#include "nsITheme.h"
#include "nsContentCID.h"
#include "nsContentUtils.h"
#include "nsIDocShell.h"
#include "nsIDocShellTreeItem.h"
#include "nsObjectFrame.h"
#include "nsRuleNode.h"
#include "nsIDOMMutationEvent.h"
#include "nsChildIterator.h"
#include "nsCSSRendering.h"
#include "nsISelectElement.h"
#include "nsLayoutErrors.h"
#include "nsLayoutUtils.h"
#include "nsAutoPtr.h"
#include "nsXULAtoms.h"
#include "nsBoxFrame.h"
#include "nsIBoxLayout.h"
#include "nsIDOMWindowInternal.h"
#include "nsIMenuFrame.h"
#include "nsBox.h"
#include "nsInlineFrame.h"
#include "nsBlockFrame.h"
#include "nsIScrollableFrame.h"
#include "nsIXBLService.h"
#include "nsIStyleRuleSupplier.h"
#include "nsIDOMElement.h"
#include "nsIDOMNodeList.h"
#include "nsIDOMDocument.h"
#include "nsIDOMDocumentXBL.h"
#include "nsIScrollable.h"
#include "nsINodeInfo.h"
#include "prenv.h"
#include "nsWidgetsCID.h"
#include "nsNodeInfoManager.h"
#include "nsContentCreatorFunctions.h"

Go to the source code of this file.

Classes

struct  nsFrameItems
struct  nsAbsoluteItems
struct  nsPseudoFrameData
struct  nsPseudoFrames
class  nsFrameConstructorSaveState
class  nsFrameConstructorInsertionState
class  nsFrameConstructorState
struct  nsTableCreator
struct  nsAutoEnqueueBinding

Defines

#define UNSET_DISPLAY   255

Functions

static NS_DEFINE_CID (kEventQueueServiceCID, NS_EVENTQUEUESERVICE_CID)
nsresult NS_NewHTMLCanvasFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)
nsresult NS_NewHTMLScrollFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame, PRBool aIsRoot)
nsresult NS_NewXULScrollFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame, PRBool aIsRoot)
nsresult NS_NewSliderFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)
nsresult NS_NewScrollbarFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)
nsresult NS_NewScrollbarButtonFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)
nsresult NS_NewNativeScrollbarFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)
static nsresult DeletingFrameSubtree (nsPresContext *aPresContext, nsFrameManager *aFrameManager, nsIFrame *aFrame)
 Called when a frame is about to be deleted.
static nsIFrameGetFieldSetAreaFrame (nsIFrame *aFieldsetFrame)
static PRBool IsFrameSpecial (nsIFrame *aFrame)
static void GetSpecialSibling (nsFrameManager *aFrameManager, nsIFrame *aFrame, nsIFrame **aResult)
static nsIFrameGetLastSpecialSibling (nsFrameManager *aFrameManager, nsIFrame *aFrame)
static nsIFrameGetNifOrSpecialSibling (nsFrameManager *aFrameManager, nsIFrame *aFrame)
static void SetFrameIsSpecial (nsIFrame *aFrame, nsIFrame *aSpecialSibling)
static nsIFrameGetIBContainingBlockFor (nsIFrame *aFrame)
static PRBool IsInlineFrame (nsIFrame *aFrame)
static PRBool IsInlineFrame2 (nsIFrame *aFrame)
static PRBool IsBlockFrame (nsIFrame *aFrame)
static nsIFrameFindFirstBlock (nsIFrame *aKid, nsIFrame **aPrevKid)
static nsIFrameFindLastBlock (nsIFrame *aKid)
void MarkIBSpecialPrevSibling (nsPresContext *aPresContext, nsIFrame *aAnonymousFrame, nsIFrame *aSpecialParent)
static void DoCleanupFrameReferences (nsPresContext *aPresContext, nsFrameManager *aFrameManager, nsIFrame *aFrameIn)
static void CleanupFrameReferences (nsPresContext *aPresContext, nsFrameManager *aFrameManager, nsIFrame *aFrameList)
static nsIFrameAdjustAbsoluteContainingBlock (nsPresContext *aPresContext, nsIFrame *aContainingBlockIn)
static PRBool IsBorderCollapse (nsIFrame *aFrame)
static void AdjustFloatParentPtrs (nsIFrame *aFrame, nsFrameConstructorState &aState, nsFrameConstructorState &aOuterState)
 Utility method, called from MoveChildrenTo(), that recursively descends down the frame hierarchy looking for floating frames that need parent pointer adjustments to account for the containment block changes that could occur as the result of the reparenting done in MoveChildrenTo().
static void MoveChildrenTo (nsFrameManager *aFrameManager, nsStyleContext *aNewParentSC, nsIFrame *aNewParent, nsIFrame *aFrameList, nsFrameConstructorState *aState, nsFrameConstructorState *aOuterState)
 Moves frames to a new parent, updating the style context and propagating relevant frame state bits.
static PRBool GetCaptionAdjustedParent (nsIFrame *aParentFrame, const nsIFrame *aChildFrame, nsIFrame **aAdjParentFrame)
 If the parent frame is a |tableFrame| and the child is a |captionFrame|, then we want to insert the frames beneath the |tableFrame|'s parent frame.
static void GetChildListNameFor (nsIFrame *aParentFrame, nsIFrame *aChildFrame, nsIAtom **aListName)
static PRBool IsOnlyWhitespace (nsIContent *aContent)
static PRBool IsTableRelated (PRUint8 aDisplay, PRBool aIncludeSpecial)
static PRBool IsTableRelated (nsIAtom *aParentType, PRBool aIncludeSpecial)
static nsIFrameAdjustCaptionParentFrame (nsIFrame *aParentFrame)
static nsresult ProcessPseudoFrame (nsPresContext *aPresContext, nsPseudoFrameData &aPseudoData, nsIFrame *&aParent)
static nsresult ProcessPseudoRowGroupFrame (nsPresContext *aPresContext, nsPseudoFrameData &aPseudoData, nsIFrame *&aParent)
static nsresult ProcessPseudoTableFrame (nsPresContext *aPresContext, nsPseudoFrames &aPseudoFrames, nsIFrame *&aParent)
static nsresult ProcessPseudoCellFrame (nsPresContext *aPresContext, nsPseudoFrames &aPseudoFrames, nsIFrame *&aParent)
static nsresult ProcessPseudoFrames (nsFrameConstructorState &aState, nsIAtom *aHighestType, nsIFrame *&aHighestFrame)
static nsresult ProcessPseudoFrames (nsFrameConstructorState &aState, nsFrameItems &aItems)
static nsresult ProcessPseudoFrames (nsFrameConstructorState &aState, nsIAtom *aHighestType)
static PRBool IsSpecialContent (nsIContent *aContent, nsIAtom *aTag, PRInt32 aNameSpaceID, nsStyleContext *aStyleContext)
static PRBool MustGeneratePseudoParent (nsIContent *aContent, nsStyleContext *aStyleContext)
static PRBool NeedFrameFor (nsIFrame *aParentFrame, nsIContent *aChildContent)
static PRBool CheckOverflow (nsPresContext *aPresContext, const nsStyleDisplay *aDisplay)
static PRBool IsXULDisplayType (const nsStyleDisplay *aDisplay)
PRBool IsRootBoxFrame (nsIFrame *aFrame)
static nsIFrameAdjustAppendParentForAfterContent (nsPresContext *aPresContext, nsIContent *aContainer, nsIFrame *aParentFrame, nsIFrame **aAfterFrame)
 This function will check whether aContainer has :after generated content.
static nsIFrameFindPreviousAnonymousSibling (nsIPresShell *aPresShell, nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild)
 Find the ``rightmost'' frame for the anonymous content immediately preceding aChild, following continuation if necessary.
static nsIFrameFindNextAnonymousSibling (nsIPresShell *aPresShell, nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild)
 Find the frame for the anonymous content immediately following aChild.
PRBool ShouldIgnoreSelectChild (nsIContent *aContainer)
static nsIFrameGetAdjustedParentFrame (nsIFrame *aParentFrame, nsIAtom *aParentFrameType, nsIContent *aParentContent, PRInt32 aChildIndex)
static nsresult DoDeletingFrameSubtree (nsPresContext *aPresContext, nsFrameManager *aFrameManager, nsVoidArray &aDestroyQueue, nsIFrame *aRemovedFrame, nsIFrame *aFrame)
 Called when a frame subtree is about to be deleted.
static void DoApplyRenderingChangeToTree (nsPresContext *aPresContext, nsIFrame *aFrame, nsIViewManager *aViewManager, nsFrameManager *aFrameManager, nsChangeHint aChange)
static void UpdateViewsForTree (nsPresContext *aPresContext, nsIFrame *aFrame, nsIViewManager *aViewManager, nsFrameManager *aFrameManager, nsRect &aBoundsRect, nsChangeHint aChange)
static void ApplyRenderingChangeToTree (nsPresContext *aPresContext, nsIFrame *aFrame, nsIViewManager *aViewManager, nsChangeHint aChange)
static PRBool HasDisplayableChildren (nsIFrame *aContainerFrame)
static void ReparentFrame (nsFrameManager *aFrameManager, nsIFrame *aNewParentFrame, nsIFrame *aFrame)
static PRInt32 FirstLetterCount (const nsTextFragment *aFragment)
static PRBool NeedFirstLetterContinuation (nsIContent *aContent)
static PRBool IsFirstLetterContent (nsIContent *aContent)
 CollectRestyles (nsISupports *aContent, nsCSSFrameConstructor::RestyleData &aData, void *aRestyleArrayPtr)
 HandleRestyleEvent (PLEvent *aEvent)
 DestroyRestyleEvent (PLEvent *aEvent)

Variables

static PRBool gGotXBLFormPrefs = PR_FALSE
static PRBool gUseXBLForms = PR_FALSE

Define Documentation

#define UNSET_DISPLAY   255

Definition at line 8371 of file nsCSSFrameConstructor.cpp.


Function Documentation

static nsIFrame* AdjustAbsoluteContainingBlock ( nsPresContext aPresContext,
nsIFrame aContainingBlockIn 
) [static]

Definition at line 1243 of file nsCSSFrameConstructor.cpp.

{
  if (!aContainingBlockIn) {
    return nsnull;
  }

  // Always use the container's first in flow.
  return aContainingBlockIn->GetFirstInFlow();
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsIFrame* AdjustAppendParentForAfterContent ( nsPresContext aPresContext,
nsIContent aContainer,
nsIFrame aParentFrame,
nsIFrame **  aAfterFrame 
) [static]

This function will check whether aContainer has :after generated content.

If so, appending to it should actually insert. The return value is the parent to use for newly-appended content. *aAfterFrame points to the :after frame before which appended content should go, if there is one.

Definition at line 8159 of file nsCSSFrameConstructor.cpp.

{
  // See if the parent has an :after pseudo-element.  Check for the presence
  // of style first, since nsLayoutUtils::GetAfterFrame is sorta expensive.
  nsStyleContext* parentStyle = aParentFrame->GetStyleContext();
  if (nsLayoutUtils::HasPseudoStyle(aContainer, parentStyle,
                                    nsCSSPseudoElements::after,
                                    aPresContext)) {
    nsIFrame* afterFrame = nsLayoutUtils::GetAfterFrame(aParentFrame);
    if (afterFrame) {
      *aAfterFrame = afterFrame;
      return afterFrame->GetParent();
    }
  }

  *aAfterFrame = nsnull;
  return aParentFrame;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsIFrame* AdjustCaptionParentFrame ( nsIFrame aParentFrame) [static]

Definition at line 2481 of file nsCSSFrameConstructor.cpp.

{
  if (nsLayoutAtoms::tableFrame == aParentFrame->GetType()) {
    return aParentFrame->GetParent();;
  }
  return aParentFrame;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void AdjustFloatParentPtrs ( nsIFrame aFrame,
nsFrameConstructorState aState,
nsFrameConstructorState aOuterState 
) [static]

Utility method, called from MoveChildrenTo(), that recursively descends down the frame hierarchy looking for floating frames that need parent pointer adjustments to account for the containment block changes that could occur as the result of the reparenting done in MoveChildrenTo().

Definition at line 1598 of file nsCSSFrameConstructor.cpp.

{
  NS_PRECONDITION(aFrame, "must have frame to work with");

  nsIFrame *outOfFlowFrame = nsPlaceholderFrame::GetRealFrameFor(aFrame);
  if (outOfFlowFrame != aFrame) {
    if (outOfFlowFrame->GetStyleDisplay()->IsFloating()) {
      // Update the parent pointer for outOfFlowFrame since its
      // containing block has changed as the result of reparenting
      // and move it from the outer state to the inner, bug 307277.
      
      nsIFrame *parent = aState.mFloatedItems.containingBlock;
      NS_ASSERTION(parent, "Should have float containing block here!");
      NS_ASSERTION(outOfFlowFrame->GetParent() == aOuterState.mFloatedItems.containingBlock,
                   "expected the float to be a child of the outer CB");

      if (aOuterState.mFloatedItems.RemoveChild(outOfFlowFrame)) {
        aState.mFloatedItems.AddChild(outOfFlowFrame);
      } else {
        NS_NOTREACHED("float wasn't in the outer state float list");
      }

      outOfFlowFrame->SetParent(parent);
      if (outOfFlowFrame->GetStateBits() &
          (NS_FRAME_HAS_VIEW | NS_FRAME_HAS_CHILD_WITH_VIEW)) {
        // We don't need to walk up the tree, since each level of
        // recursion of the SplitToContainingBlock will propagate the bit.
        parent->AddStateBits(NS_FRAME_HAS_CHILD_WITH_VIEW);
      }
    }

    // All out-of-flows are automatically float containing blocks, so we're
    // done here.
    return;
  }

  if (aFrame->IsFloatContainingBlock()) {
    // No need to recurse further; floats whose placeholders are
    // inside a block already have the right parent.
    return;
  }

  // Dive down into children to see if any of their
  // placeholders need adjusting.
  nsIFrame *childFrame = aFrame->GetFirstChild(nsnull);
  while (childFrame) {
    // XXX_kin: Do we need to prevent descent into anonymous content here?

    AdjustFloatParentPtrs(childFrame, aState, aOuterState);
    childFrame = childFrame->GetNextSibling();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void ApplyRenderingChangeToTree ( nsPresContext aPresContext,
nsIFrame aFrame,
nsIViewManager aViewManager,
nsChangeHint  aChange 
) [static]

Definition at line 10281 of file nsCSSFrameConstructor.cpp.

{
  nsIPresShell *shell = aPresContext->PresShell();
  PRBool isPaintingSuppressed = PR_FALSE;
  shell->IsPaintingSuppressed(&isPaintingSuppressed);
  if (isPaintingSuppressed) {
    // Don't allow synchronous rendering changes when painting is turned off.
    aChange = NS_SubtractHint(aChange, nsChangeHint_RepaintFrame);
    if (!aChange) {
      return;
    }
  }

  // If the frame's background is propagated to an ancestor, walk up to
  // that ancestor.
  const nsStyleBackground *bg;
  PRBool isCanvas;
  while (!nsCSSRendering::FindBackground(aPresContext, aFrame,
                                         &bg, &isCanvas)) {
    aFrame = aFrame->GetParent();
    NS_ASSERTION(aFrame, "root frame must paint");
  }

  nsIViewManager* viewManager = aViewManager;
  if (!viewManager) {
    viewManager = aPresContext->GetViewManager();
  }

  // Trigger rendering updates by damaging this frame and any
  // continuations of this frame.

  // XXX this needs to detect the need for a view due to an opacity change and deal with it...

  viewManager->BeginUpdateViewBatch();

#ifdef DEBUG
  gInApplyRenderingChangeToTree = PR_TRUE;
#endif
  DoApplyRenderingChangeToTree(aPresContext, aFrame, viewManager,
                               shell->FrameManager(), aChange);
#ifdef DEBUG
  gInApplyRenderingChangeToTree = PR_FALSE;
#endif
  
  viewManager->EndUpdateViewBatch(NS_VMREFRESH_NO_SYNC);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool CheckOverflow ( nsPresContext aPresContext,
const nsStyleDisplay aDisplay 
) [static]

Definition at line 4321 of file nsCSSFrameConstructor.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static void CleanupFrameReferences ( nsPresContext aPresContext,
nsFrameManager aFrameManager,
nsIFrame aFrameList 
) [static]

Definition at line 690 of file nsCSSFrameConstructor.cpp.

{
  while (aFrameList) {
    DoCleanupFrameReferences(aPresContext, aFrameManager, aFrameList);

    // Get the sibling frame
    aFrameList = aFrameList->GetNextSibling();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

CollectRestyles ( nsISupports *  aContent,
nsCSSFrameConstructor::RestyleData aData,
void aRestyleArrayPtr 
)

Definition at line 14116 of file nsCSSFrameConstructor.cpp.

{
  nsCSSFrameConstructor::RestyleEnumerateData** restyleArrayPtr =
    NS_STATIC_CAST(nsCSSFrameConstructor::RestyleEnumerateData**,
                   aRestyleArrayPtr);
  nsCSSFrameConstructor::RestyleEnumerateData* currentRestyle =
    *restyleArrayPtr;
  currentRestyle->mContent = NS_STATIC_CAST(nsIContent*, aContent);
  currentRestyle->mRestyleHint = aData.mRestyleHint;
  currentRestyle->mChangeHint = aData.mChangeHint;

  // Increment to the next slot in the array
  *restyleArrayPtr = currentRestyle + 1; 

  return PL_DHASH_NEXT;
}

Here is the caller graph for this function:

static nsresult DeletingFrameSubtree ( nsPresContext aPresContext,
nsFrameManager aFrameManager,
nsIFrame aFrame 
) [static]

Called when a frame is about to be deleted.

Calls DoDeletingFrameSubtree() for aFrame and each of its continuing frames

Definition at line 9785 of file nsCSSFrameConstructor.cpp.

{
  NS_ENSURE_TRUE(aFrame, NS_OK); // XXXldb Remove this sometime in the future.

  // If there's no frame manager it's probably because the pres shell is
  // being destroyed.
  if (NS_UNLIKELY(!aFrameManager)) {
    return NS_OK;
  }

  nsAutoVoidArray destroyQueue;

  // If it's a "special" block-in-inline frame, then we can't really deal.
  // That really shouldn't be happening.
  NS_ASSERTION(!IsFrameSpecial(aFrame),
               "DeletingFrameSubtree on a special frame.  Prepare to crash.");

  do {
    DoDeletingFrameSubtree(aPresContext, aFrameManager, destroyQueue,
                           aFrame, aFrame);

    // If it's split, then get the continuing frame. Note that we only do
    // this for the top-most frame being deleted. Don't do it if we're
    // recursing over a subtree, because those continuing frames should be
    // found as part of the walk over the top-most frame's continuing frames.
    // Walking them again will make this an N^2/2 algorithm.
    aFrame = aFrame->GetNextInFlow();
  } while (aFrame);

  // Now destroy any out-of-flow frames that have been enqueued for destruction.
  for (PRInt32 i = destroyQueue.Count() - 1; i >= 0; --i) {
    nsIFrame* outOfFlowFrame = NS_STATIC_CAST(nsIFrame*, destroyQueue[i]);

#ifdef MOZ_XUL
    const nsStyleDisplay* display = outOfFlowFrame->GetStyleDisplay();
    if (display->mDisplay == NS_STYLE_DISPLAY_POPUP) {
      // Locate the root popup set and remove ourselves from the popup set's list
      // of popup frames.
      nsIFrame* rootFrame = aFrameManager->GetRootFrame();
      if (rootFrame)
        rootFrame = rootFrame->GetFirstChild(nsnull);
      nsCOMPtr<nsIRootBox> rootBox(do_QueryInterface(rootFrame));
      NS_ASSERTION(rootBox, "unexpected null pointer");
      if (rootBox) {
        nsIFrame* popupSetFrame;
        rootBox->GetPopupSetFrame(&popupSetFrame);
        NS_ASSERTION(popupSetFrame, "unexpected null pointer");
        if (popupSetFrame) {
          nsCOMPtr<nsIPopupSetFrame> popupSet(do_QueryInterface(popupSetFrame));
          NS_ASSERTION(popupSet, "unexpected null pointer");
          if (popupSet)
            popupSet->RemovePopupFrame(outOfFlowFrame);
        }
      }
    } else
#endif
    {
      // Get the out-of-flow frame's parent
      nsIFrame* parentFrame = outOfFlowFrame->GetParent();
  
      // Get the child list name for the out-of-flow frame
      nsCOMPtr<nsIAtom> listName;
      GetChildListNameFor(parentFrame, outOfFlowFrame,
                          getter_AddRefs(listName));
  
      // Ask the out-of-flow's parent to delete the out-of-flow
      // frame from the right list.
      aFrameManager->RemoveFrame(parentFrame,
                                 listName, outOfFlowFrame);
    }
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 14291 of file nsCSSFrameConstructor.cpp.

Here is the caller graph for this function:

static void DoApplyRenderingChangeToTree ( nsPresContext aPresContext,
nsIFrame aFrame,
nsIViewManager aViewManager,
nsFrameManager aFrameManager,
nsChangeHint  aChange 
) [static]

Definition at line 10252 of file nsCSSFrameConstructor.cpp.

{
  NS_PRECONDITION(gInApplyRenderingChangeToTree,
                  "should only be called within ApplyRenderingChangeToTree");

  for ( ; aFrame; aFrame = GetNifOrSpecialSibling(aFrameManager, aFrame)) {
    // Get view if this frame has one and trigger an update. If the
    // frame doesn't have a view, find the nearest containing view
    // (adjusting r's coordinate system to reflect the nesting) and
    // update there.
    nsRect invalidRect;
    UpdateViewsForTree(aPresContext, aFrame, aViewManager, aFrameManager,
                       invalidRect, aChange);

    if (!aFrame->HasView()
        && (aChange & nsChangeHint_RepaintFrame)) {
      // if frame has view, will already be invalidated
      invalidRect -= aFrame->GetPosition();

      aFrame->Invalidate(invalidRect, PR_FALSE);
    }
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void DoCleanupFrameReferences ( nsPresContext aPresContext,
nsFrameManager aFrameManager,
nsIFrame aFrameIn 
) [static]

Definition at line 664 of file nsCSSFrameConstructor.cpp.

{
  nsIContent* content = aFrameIn->GetContent();

  // if the frame is a placeholder use the out of flow frame
  nsIFrame* frame = nsPlaceholderFrame::GetRealFrameFor(aFrameIn);

  // Remove the mapping from the content object to its frame
  aFrameManager->RemoveAsPrimaryFrame(content, frame);
  aFrameManager->ClearAllUndisplayedContentIn(content);

  // Recursively walk the child frames.
  // Note: we only need to look at the principal child list
  nsIFrame* childFrame = frame->GetFirstChild(nsnull);
  while (childFrame) {
    DoCleanupFrameReferences(aPresContext, aFrameManager, childFrame);
    
    // Get the next sibling child frame
    childFrame = childFrame->GetNextSibling();
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult DoDeletingFrameSubtree ( nsPresContext aPresContext,
nsFrameManager aFrameManager,
nsVoidArray aDestroyQueue,
nsIFrame aRemovedFrame,
nsIFrame aFrame 
) [static]

Called when a frame subtree is about to be deleted.

Two important things happen:

  1. For each frame in the subtree, we remove the mapping from the content object to its frame
  1. For child frames that have been moved out of the flow, we enqueue the out-of-frame for deletion if the out-of-flow frame's geometric parent is not in |aRemovedFrame|'s hierarchy (e.g., an absolutely positioned element that has been promoted to be a direct descendant of an area frame).

Note: this function should only be called by DeletingFrameSubtree()

Parameters:
aRemovedFramethis is the frame that was removed from the content model. As we recurse we need to remember this so we can check if out-of-flow frames are a descendent of the frame being removed
aFramethe local subtree that is being deleted. This is initially the same as aRemovedFrame, but as we recurse down the tree this changes

Definition at line 9712 of file nsCSSFrameConstructor.cpp.

{
  // Remove the mapping from the content object to its frame.
  nsIContent* content = aFrame->GetContent();
  if (content) {
    aFrameManager->RemoveAsPrimaryFrame(content, aFrame);
    aFrameManager->ClearAllUndisplayedContentIn(content);
  }

  nsIAtom* childListName = nsnull;
  PRInt32 childListIndex = 0;

  do {
    // Walk aFrame's normal flow child frames looking for placeholder frames.
    nsIFrame* childFrame = aFrame->GetFirstChild(childListName);
    for (; childFrame; childFrame = childFrame->GetNextSibling()) {
      if (NS_LIKELY(nsLayoutAtoms::placeholderFrame != childFrame->GetType())) {
        DoDeletingFrameSubtree(aPresContext, aFrameManager, aDestroyQueue,
                               aRemovedFrame, childFrame);

      } else {
        nsIFrame* outOfFlowFrame =
          nsPlaceholderFrame::GetRealFrameForPlaceholder(childFrame);
  
        // Remove the mapping from the out-of-flow frame to its placeholder.
        aFrameManager->UnregisterPlaceholderFrame((nsPlaceholderFrame*)childFrame);
        // Don't SetOutOfFlowFrame(nsnull) here because the float cache depends
        // on it when the float is removed later on, see bug 348688 comment 6.

        // Queue the out-of-flow frame to be destroyed only if aRemovedFrame is _not_
        // one of its ancestor frames or if it is a popup frame. 
        // If aRemovedFrame is an ancestor of the out-of-flow frame, then 
        // the out-of-flow frame will be destroyed by aRemovedFrame.
        if (outOfFlowFrame->GetStyleDisplay()->mDisplay == NS_STYLE_DISPLAY_POPUP ||
            !nsLayoutUtils::IsProperAncestorFrame(aRemovedFrame, outOfFlowFrame)) {
          NS_ASSERTION(aDestroyQueue.IndexOf(outOfFlowFrame) == kNotFound,
                       "out-of-flow is already in the destroy queue");
          aDestroyQueue.AppendElement(outOfFlowFrame);
          // Recurse into the out-of-flow, it is now the aRemovedFrame.
          DoDeletingFrameSubtree(aPresContext, aFrameManager, aDestroyQueue,
                                 outOfFlowFrame, outOfFlowFrame);
        }
        else {
          // Also recurse into the out-of-flow when it's a descendant of aRemovedFrame
          // since we don't walk those lists, see |childListName| increment below.
          DoDeletingFrameSubtree(aPresContext, aFrameManager, aDestroyQueue,
                                 aRemovedFrame, outOfFlowFrame);
        }
      }
    }

    // Move to next child list but skip lists with frames we should have
    // a placeholder for.
    do {
      childListName = aFrame->GetAdditionalChildListName(childListIndex++);
    } while (childListName == nsLayoutAtoms::floatList    ||
             childListName == nsLayoutAtoms::absoluteList ||
             childListName == nsLayoutAtoms::overflowOutOfFlowList ||
             childListName == nsLayoutAtoms::fixedList);
  } while (childListName);

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsIFrame* FindFirstBlock ( nsIFrame aKid,
nsIFrame **  aPrevKid 
) [static]

Definition at line 609 of file nsCSSFrameConstructor.cpp.

{
  nsIFrame* prevKid = nsnull;
  while (aKid) {
    if (IsBlockFrame(aKid)) {
      *aPrevKid = prevKid;
      return aKid;
    }
    prevKid = aKid;
    aKid = aKid->GetNextSibling();
  }
  *aPrevKid = nsnull;
  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsIFrame* FindLastBlock ( nsIFrame aKid) [static]

Definition at line 625 of file nsCSSFrameConstructor.cpp.

{
  nsIFrame* lastBlock = nsnull;
  while (aKid) {
    if (IsBlockFrame(aKid)) {
      lastBlock = aKid;
    }
    aKid = aKid->GetNextSibling();
  }
  return lastBlock;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsIFrame* FindNextAnonymousSibling ( nsIPresShell aPresShell,
nsIDocument aDocument,
nsIContent aContainer,
nsIContent aChild 
) [static]

Find the frame for the anonymous content immediately following aChild.

Definition at line 8303 of file nsCSSFrameConstructor.cpp.

{
  NS_PRECONDITION(aDocument, "null document from content element in FindNextAnonymousSibling");

  nsCOMPtr<nsIDOMDocumentXBL> xblDoc(do_QueryInterface(aDocument));
  NS_ASSERTION(xblDoc, "null xblDoc for content element in FindNextAnonymousSibling");
  if (! xblDoc)
    return nsnull;

  // Grovel through the anonymous elements looking for aChild
  nsCOMPtr<nsIDOMNodeList> nodeList;
  nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aContainer));
  xblDoc->GetAnonymousNodes(elt, getter_AddRefs(nodeList));

  if (! nodeList)
    return nsnull;

  PRUint32 length;
  nodeList->GetLength(&length);

  PRInt32 index;
  for (index = 0; index < PRInt32(length); ++index) {
    nsCOMPtr<nsIDOMNode> node;
    nodeList->Item(PRUint32(index), getter_AddRefs(node));

    nsCOMPtr<nsIContent> child = do_QueryInterface(node);
    if (child == aChild)
      break;
  }

  // We want the node immediately after aChild. Keep going until we
  // run off the end of the nodeList, or we find a next sibling.
  while (++index < PRInt32(length)) {
    nsCOMPtr<nsIDOMNode> node;
    nodeList->Item(PRUint32(index), getter_AddRefs(node));

    nsCOMPtr<nsIContent> child = do_QueryInterface(node);

    // Get its frame
    nsIFrame* nextSibling;
    aPresShell->GetPrimaryFrameFor(child, &nextSibling);
    if (nextSibling) {
      // The primary frame should never be a continuation
      NS_ASSERTION(!nextSibling->GetPrevInFlow(),
                   "primary frame is a continuation!?");

      // If the frame is out-of-flow, GPFF() will have returned the
      // out-of-flow frame; we want the placeholder.
      const nsStyleDisplay* display = nextSibling->GetStyleDisplay();

      if (display->IsFloating() || display->IsAbsolutelyPositioned()) {
        nsIFrame* placeholderFrame;
        aPresShell->GetPlaceholderFrameFor(nextSibling, &placeholderFrame);
        NS_ASSERTION(placeholderFrame, "no placeholder for out-of-flow frame");
        nextSibling = placeholderFrame;
      }

      // Found a next sibling, we're done!
      return nextSibling;
    }
  }

  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsIFrame* FindPreviousAnonymousSibling ( nsIPresShell aPresShell,
nsIDocument aDocument,
nsIContent aContainer,
nsIContent aChild 
) [static]

Find the ``rightmost'' frame for the anonymous content immediately preceding aChild, following continuation if necessary.

Definition at line 8221 of file nsCSSFrameConstructor.cpp.

{
  NS_PRECONDITION(aDocument, "null document from content element in FindNextAnonymousSibling");

  nsCOMPtr<nsIDOMDocumentXBL> xblDoc(do_QueryInterface(aDocument));
  NS_ASSERTION(xblDoc, "null xblDoc for content element in FindNextAnonymousSibling");
  if (! xblDoc)
    return nsnull;

  // Grovel through the anonymous elements looking for aChild. We'll
  // start our search for a previous frame there.
  nsCOMPtr<nsIDOMNodeList> nodeList;
  nsCOMPtr<nsIDOMElement> elt(do_QueryInterface(aContainer));
  xblDoc->GetAnonymousNodes(elt, getter_AddRefs(nodeList));

  if (! nodeList)
    return nsnull;

  PRUint32 length;
  nodeList->GetLength(&length);

  PRInt32 index;
  for (index = PRInt32(length) - 1; index >= 0; --index) {
    nsCOMPtr<nsIDOMNode> node;
    nodeList->Item(PRUint32(index), getter_AddRefs(node));

    nsCOMPtr<nsIContent> child = do_QueryInterface(node);
    if (child == aChild)
      break;
  }

  // We want the node immediately before aChild. Keep going until we
  // run off the beginning of the nodeList, or we find a frame.
  while (--index >= 0) {
    nsCOMPtr<nsIDOMNode> node;
    nodeList->Item(PRUint32(index), getter_AddRefs(node));

    nsCOMPtr<nsIContent> child = do_QueryInterface(node);

    // Get its frame. If it doesn't have one, continue on to the
    // anonymous element that preceded it.
    nsIFrame* prevSibling;
    aPresShell->GetPrimaryFrameFor(child, &prevSibling);
    if (prevSibling) {
      // The frame may be a special frame (a split inline frame that
      // contains a block).  Get the last part of that split.
      if (IsFrameSpecial(prevSibling)) {
        prevSibling = GetLastSpecialSibling(aPresShell->FrameManager(),
                                            prevSibling);
      }

      // The frame may have a continuation. If so, we want the
      // last-in-flow as our previous sibling.
      prevSibling = prevSibling->GetLastInFlow();

      // If the frame is out-of-flow, GPFF() will have returned the
      // out-of-flow frame; we want the placeholder.
      const nsStyleDisplay* display = prevSibling->GetStyleDisplay();

      if (display->IsFloating() || display->IsAbsolutelyPositioned()) {
        nsIFrame *placeholderFrame;
        aPresShell->GetPlaceholderFrameFor(prevSibling, &placeholderFrame);
        NS_ASSERTION(placeholderFrame, "no placeholder for out-of-flow frame");
        prevSibling = placeholderFrame;
      }

      // Found a previous sibling, we're done!
      return prevSibling;
    }
  }

  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRInt32 FirstLetterCount ( const nsTextFragment aFragment) [static]

Definition at line 12568 of file nsCSSFrameConstructor.cpp.

{
  PRInt32 count = 0;
  PRInt32 firstLetterLength = 0;
  PRBool done = PR_FALSE;

  PRInt32 i, n = aFragment->GetLength();
  for (i = 0; i < n; i++) {
    PRUnichar ch = aFragment->CharAt(i);
    if (XP_IS_SPACE(ch)) {
      if (firstLetterLength) {
        done = PR_TRUE;
        break;
      }
      count++;
      continue;
    }
    // XXX I18n
    if ((ch == '\'') || (ch == '\"')) {
      if (firstLetterLength) {
        done = PR_TRUE;
        break;
      }
      // keep looping
      firstLetterLength = 1;
    }
    else {
      count++;
      done = PR_TRUE;
      break;
    }
  }

  return count;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsIFrame* GetAdjustedParentFrame ( nsIFrame aParentFrame,
nsIAtom aParentFrameType,
nsIContent aParentContent,
PRInt32  aChildIndex 
) [static]

Definition at line 8601 of file nsCSSFrameConstructor.cpp.

{
  nsIContent *childContent = aParentContent->GetChildAt(aChildIndex);
  nsIFrame* newParent = nsnull;

  if (nsLayoutAtoms::tableOuterFrame == aParentFrameType) {
    nsCOMPtr<nsIDOMHTMLTableCaptionElement> captionContent(do_QueryInterface(childContent));
    // If the parent frame is an outer table, use the innner table
    // as the parent unless the new content is a caption.
    if (!captionContent) 
      newParent = aParentFrame->GetFirstChild(nsnull);
  }
  else if (nsLayoutAtoms::fieldSetFrame == aParentFrameType) {
    // If the parent is a fieldSet, use the fieldSet's area frame as the
    // parent unless the new content is a legend. 
    nsCOMPtr<nsIDOMHTMLLegendElement> legendContent(do_QueryInterface(childContent));
    if (!legendContent) {
      newParent = GetFieldSetAreaFrame(aParentFrame);
    }
  }
  return (newParent) ? newParent : aParentFrame;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool GetCaptionAdjustedParent ( nsIFrame aParentFrame,
const nsIFrame aChildFrame,
nsIFrame **  aAdjParentFrame 
) [static]

If the parent frame is a |tableFrame| and the child is a |captionFrame|, then we want to insert the frames beneath the |tableFrame|'s parent frame.

Returns |PR_TRUE| if the parent frame needed to be fixed up.

Definition at line 1856 of file nsCSSFrameConstructor.cpp.

{
  *aAdjParentFrame = aParentFrame;
  PRBool haveCaption = PR_FALSE;

  if (nsLayoutAtoms::tableCaptionFrame == aChildFrame->GetType()) {
    haveCaption = PR_TRUE;
    if (nsLayoutAtoms::tableFrame == aParentFrame->GetType()) {
      *aAdjParentFrame = aParentFrame->GetParent();
    }
  }
  return haveCaption;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void GetChildListNameFor ( nsIFrame aParentFrame,
nsIFrame aChildFrame,
nsIAtom **  aListName 
) [static]

Definition at line 1875 of file nsCSSFrameConstructor.cpp.

{
  nsIAtom*      listName;
  
  // See if the frame is moved out of the flow
  if (aChildFrame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
    // Look at the style information to tell
    const nsStyleDisplay* disp = aChildFrame->GetStyleDisplay();
    
    if (NS_STYLE_POSITION_ABSOLUTE == disp->mPosition) {
      listName = nsLayoutAtoms::absoluteList;
    } else if (NS_STYLE_POSITION_FIXED == disp->mPosition) {
      listName = nsLayoutAtoms::fixedList;
    } else {
      NS_ASSERTION(aChildFrame->GetStyleDisplay()->IsFloating(),
                   "not a floated frame");
      listName = nsLayoutAtoms::floatList;
    }

  } else {
    listName = nsnull;
  }

  // Verify that the frame is actually in that child list
  NS_ASSERTION(nsFrameList(aParentFrame->GetFirstChild(listName))
               .ContainsFrame(aChildFrame), "not in child list");

  NS_IF_ADDREF(listName);
  *aListName = listName;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsIFrame* GetFieldSetAreaFrame ( nsIFrame aFieldsetFrame) [inline, static]

Definition at line 443 of file nsCSSFrameConstructor.cpp.

{
  // Depends on the fieldset child frame order - see ConstructFieldSetFrame() below.
  nsIFrame* firstChild = aFieldsetFrame->GetFirstChild(nsnull);
  return firstChild && firstChild->GetNextSibling() ? firstChild->GetNextSibling() : firstChild;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsIFrame* GetIBContainingBlockFor ( nsIFrame aFrame) [static]

Definition at line 523 of file nsCSSFrameConstructor.cpp.

{
  NS_PRECONDITION(IsFrameSpecial(aFrame),
                  "GetIBContainingBlockFor() should only be called on known IB frames");

  // Get the first "normal" ancestor of the target frame.
  nsIFrame* parentFrame;
  do {
    parentFrame = aFrame->GetParent();

    if (! parentFrame) {
      NS_ERROR("no unsplit block frame in IB hierarchy");
      return aFrame;
    }

    // Note that we ignore non-special frames which have a pseudo on their
    // style context -- they're not the frames we're looking for!  In
    // particular, they may be hiding a real parent that _is_ special.
    if (!IsFrameSpecial(parentFrame) &&
        !parentFrame->GetStyleContext()->GetPseudoType())
      break;

    aFrame = parentFrame;
  } while (1);
 
  // post-conditions
  NS_ASSERTION(parentFrame, "no normal ancestor found for special frame in GetIBContainingBlockFor");
  NS_ASSERTION(parentFrame != aFrame, "parentFrame is actually the child frame - bogus reslt");

  return parentFrame;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsIFrame* GetLastSpecialSibling ( nsFrameManager aFrameManager,
nsIFrame aFrame 
) [static]

Definition at line 476 of file nsCSSFrameConstructor.cpp.

{
  for (nsIFrame *frame = aFrame, *next; ; frame = next) {
    GetSpecialSibling(aFrameManager, frame, &next);
    if (!next)
      return frame;
  }
  NS_NOTREACHED("unreachable code");
  return nsnull;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsIFrame* GetNifOrSpecialSibling ( nsFrameManager aFrameManager,
nsIFrame aFrame 
) [static]

Definition at line 490 of file nsCSSFrameConstructor.cpp.

{
  nsIFrame *result = aFrame->GetNextInFlow();
  if (result)
    return result;

  if (IsFrameSpecial(aFrame))
    GetSpecialSibling(aFrameManager, aFrame, &result);
  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void GetSpecialSibling ( nsFrameManager aFrameManager,
nsIFrame aFrame,
nsIFrame **  aResult 
) [static]

Definition at line 464 of file nsCSSFrameConstructor.cpp.

{
  // We only store the "special sibling" annotation with the first
  // frame in the flow. Walk back to find that frame now.
  aFrame = aFrame->GetFirstInFlow();

  void* value = aFrame->GetProperty(nsLayoutAtoms::IBSplitSpecialSibling);

  *aResult = NS_STATIC_CAST(nsIFrame*, value);
}

Here is the call graph for this function:

Here is the caller graph for this function:

HandleRestyleEvent ( PLEvent aEvent)

Definition at line 14282 of file nsCSSFrameConstructor.cpp.

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool HasDisplayableChildren ( nsIFrame aContainerFrame) [static]

Definition at line 10974 of file nsCSSFrameConstructor.cpp.

{
  // Returns 'true' if there are frames within aContainerFrame that
  // could be displayed in the frame list.
  NS_PRECONDITION(aContainerFrame != nsnull, "null ptr");
  if (! aContainerFrame)
    return PR_FALSE;

  nsIFrame* frame = aContainerFrame->GetFirstChild(nsnull);

  while (frame) {
    // If it's not a text frame, then assume that it's displayable.
    if (frame->GetType() != nsLayoutAtoms::textFrame)
      return PR_TRUE;

    // If not only whitespace, then we have displayable content here.
    if (! IsOnlyWhitespace(frame->GetContent()))
      return PR_TRUE;
    
    // Otherwise, on to the next frame...
    frame = frame->GetNextSibling();
  }

  // If we get here, then we've iterated through all the child frames,
  // and every one is a text frame containing whitespace. (Or, there
  // weren't any frames at all!) There is nothing to diplay.
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool IsBlockFrame ( nsIFrame aFrame) [static]

Definition at line 599 of file nsCSSFrameConstructor.cpp.

{
  // XXXwaterson this seems wrong; see IsInlineFrame() immediately
  // above, which will treat inline-block (e.g.) as an inline. Why
  // don't we use display->IsBlockLevel() here?
  const nsStyleDisplay* display = aFrame->GetStyleDisplay();
  return NS_STYLE_DISPLAY_INLINE != display->mDisplay;
}

Here is the caller graph for this function:

static PRBool IsBorderCollapse ( nsIFrame aFrame) [static]

Definition at line 1579 of file nsCSSFrameConstructor.cpp.

{
  for (nsIFrame* frame = aFrame; frame; frame = frame->GetParent()) {
    if (nsLayoutAtoms::tableFrame == frame->GetType()) {
      return ((nsTableFrame*)frame)->IsBorderCollapse();
    }
  }
  NS_ASSERTION(PR_FALSE, "program error");
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool IsFirstLetterContent ( nsIContent aContent) [static]

Definition at line 12624 of file nsCSSFrameConstructor.cpp.

{
  PRBool result = PR_FALSE;

  nsCOMPtr<nsITextContent> textContent = do_QueryInterface(aContent);
  if (textContent && textContent->TextLength()) {
    result = !textContent->IsOnlyWhitespace();
  }

  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool IsFrameSpecial ( nsIFrame aFrame) [inline, static]

Definition at line 457 of file nsCSSFrameConstructor.cpp.

{

  return (aFrame->GetStateBits() & NS_FRAME_IS_SPECIAL) != 0;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool IsInlineFrame ( nsIFrame aFrame) [static]

Definition at line 560 of file nsCSSFrameConstructor.cpp.

{
  // XXXwaterson why don't we use |! display->IsBlockLevel()| here?
  switch (aFrame->GetStyleDisplay()->mDisplay) {
    case NS_STYLE_DISPLAY_INLINE:
    case NS_STYLE_DISPLAY_INLINE_BLOCK:
    case NS_STYLE_DISPLAY_INLINE_TABLE:
    case NS_STYLE_DISPLAY_INLINE_BOX:
    case NS_STYLE_DISPLAY_INLINE_GRID:
    case NS_STYLE_DISPLAY_INLINE_STACK:
    case NS_STYLE_DISPLAY_DECK:
    case NS_STYLE_DISPLAY_POPUP:
    case NS_STYLE_DISPLAY_GROUPBOX:
      return PR_TRUE;
    default:
      break;
  }
  return PR_FALSE;
}

Here is the caller graph for this function:

static PRBool IsInlineFrame2 ( nsIFrame aFrame) [static]

Definition at line 582 of file nsCSSFrameConstructor.cpp.

{
  return !aFrame->GetStyleDisplay()->IsBlockLevel();
}

Here is the caller graph for this function:

static PRBool IsOnlyWhitespace ( nsIContent aContent) [static]

Definition at line 2418 of file nsCSSFrameConstructor.cpp.

{
  PRBool onlyWhiteSpace = PR_FALSE;
  if (aContent->IsContentOfType(nsIContent::eTEXT)) {
    nsCOMPtr<nsITextContent> textContent = do_QueryInterface(aContent);

    onlyWhiteSpace = textContent->IsOnlyWhitespace();
  }

  return onlyWhiteSpace;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool IsRootBoxFrame ( nsIFrame aFrame) [inline]

Definition at line 7982 of file nsCSSFrameConstructor.cpp.

{
  return (aFrame->GetType() == nsLayoutAtoms::rootFrame);
}

Here is the call graph for this function:

static PRBool IsSpecialContent ( nsIContent aContent,
nsIAtom aTag,
PRInt32  aNameSpaceID,
nsStyleContext aStyleContext 
) [static]

Definition at line 3319 of file nsCSSFrameConstructor.cpp.

{
  // Gross hack. Return true if this is a content node that we'd create a
  // frame for based on something other than display -- in other words if this
  // is a node that could never have a nsTableCellFrame, for example.
  if (aContent->IsContentOfType(nsIContent::eHTML) ||
      aNameSpaceID == kNameSpaceID_XHTML) {
    // XXXbz this is duplicating some logic from ConstructHTMLFrame....
    // Would be nice to avoid that.  :(
  
    if (aTag == nsHTMLAtoms::input) {
      nsCOMPtr<nsIFormControl> control = do_QueryInterface(aContent);
      if (control && NS_FORM_INPUT_HIDDEN == control->GetType())
        return PR_FALSE; // input hidden does not create a special frame
    }

    return
      aTag == nsHTMLAtoms::img ||
      aTag == nsHTMLAtoms::br ||
      aTag == nsHTMLAtoms::wbr ||
      aTag == nsHTMLAtoms::input ||
      aTag == nsHTMLAtoms::textarea ||
      aTag == nsHTMLAtoms::select ||
      aTag == nsHTMLAtoms::object ||
      aTag == nsHTMLAtoms::applet ||
      aTag == nsHTMLAtoms::embed ||
      aTag == nsHTMLAtoms::fieldset ||
      aTag == nsHTMLAtoms::legend ||
      aTag == nsHTMLAtoms::frameset ||
      aTag == nsHTMLAtoms::iframe ||
      aTag == nsHTMLAtoms::spacer ||
      aTag == nsHTMLAtoms::button ||
      aTag == nsHTMLAtoms::isindex ||
      aTag == nsHTMLAtoms::canvas; 
  }
  if (aNameSpaceID == kNameSpaceID_XUL)
    return
#ifdef MOZ_XUL
      aTag == nsXULAtoms::button ||
      aTag == nsXULAtoms::checkbox ||
      aTag == nsXULAtoms::radio ||
      aTag == nsXULAtoms::autorepeatbutton ||
      aTag == nsXULAtoms::titlebar ||
      aTag == nsXULAtoms::resizer ||
      aTag == nsXULAtoms::image ||
      aTag == nsXULAtoms::spring ||
      aTag == nsHTMLAtoms::spacer ||
      aTag == nsXULAtoms::treechildren ||
      aTag == nsXULAtoms::treecol ||
      aTag == nsXULAtoms::text ||
      aTag == nsXULAtoms::description ||
      aTag == nsHTMLAtoms::label ||
      aTag == nsXULAtoms::menu ||
      aTag == nsXULAtoms::menuitem ||
      aTag == nsXULAtoms::menubutton ||
      aTag == nsXULAtoms::menubar ||
      aTag == nsXULAtoms::popupgroup ||
      aTag == nsXULAtoms::iframe ||
      aTag == nsXULAtoms::editor ||
      aTag == nsXULAtoms::browser ||
      aTag == nsXULAtoms::progressmeter ||
#endif
      aTag == nsXULAtoms::slider ||
      aTag == nsXULAtoms::scrollbar ||
      aTag == nsXULAtoms::nativescrollbar ||
      aTag == nsXULAtoms::scrollbarbutton ||
#ifdef MOZ_XUL
      aTag == nsXULAtoms::splitter ||
      aTag == nsXULAtoms::grippy ||
#endif
      PR_FALSE;

#ifdef MOZ_SVG
  if (aNameSpaceID == kNameSpaceID_SVG &&
      nsSVGUtils::SVGEnabled())
    return
      aTag == nsSVGAtoms::svg ||
      aTag == nsSVGAtoms::g ||
      aTag == nsSVGAtoms::polygon ||
      aTag == nsSVGAtoms::polyline ||
      aTag == nsSVGAtoms::circle ||
      aTag == nsSVGAtoms::defs ||
      aTag == nsSVGAtoms::ellipse ||
      aTag == nsSVGAtoms::line ||
      aTag == nsSVGAtoms::rect ||
#ifdef MOZ_SVG_FOREIGNOBJECT
      aTag == nsSVGAtoms::foreignObject ||
#endif
      aTag == nsSVGAtoms::path ||
      aTag == nsSVGAtoms::text ||
      aTag == nsSVGAtoms::tspan ||
      aTag == nsSVGAtoms::linearGradient ||
      aTag == nsSVGAtoms::radialGradient ||
      aTag == nsSVGAtoms::stop ||
      aTag == nsSVGAtoms::use ||
      aTag == nsSVGAtoms::marker ||
      aTag == nsSVGAtoms::image  ||
      aTag == nsSVGAtoms::clipPath;
#endif

#ifdef MOZ_MATHML
  if (aNameSpaceID == kNameSpaceID_MathML)
    return
      aTag == nsMathMLAtoms::mi_ ||
      aTag == nsMathMLAtoms::mn_ ||
      aTag == nsMathMLAtoms::ms_ ||
      aTag == nsMathMLAtoms::mtext_ ||
      aTag == nsMathMLAtoms::mo_ ||
      aTag == nsMathMLAtoms::mfrac_ ||
      aTag == nsMathMLAtoms::msup_ ||
      aTag == nsMathMLAtoms::msub_ ||
      aTag == nsMathMLAtoms::msubsup_ ||
      aTag == nsMathMLAtoms::munder_ ||
      aTag == nsMathMLAtoms::mover_ ||
      aTag == nsMathMLAtoms::munderover_ ||
      aTag == nsMathMLAtoms::mphantom_ ||
      aTag == nsMathMLAtoms::mpadded_ ||
      aTag == nsMathMLAtoms::mspace_ ||
      aTag == nsMathMLAtoms::mfenced_ ||
      aTag == nsMathMLAtoms::mmultiscripts_ ||
      aTag == nsMathMLAtoms::mstyle_ ||
      aTag == nsMathMLAtoms::msqrt_ ||
      aTag == nsMathMLAtoms::mroot_ ||
      aTag == nsMathMLAtoms::maction_ ||
      aTag == nsMathMLAtoms::mrow_   ||
      aTag == nsMathMLAtoms::merror_ ||
      aTag == nsMathMLAtoms::none_   ||
      aTag == nsMathMLAtoms::mprescripts_ ||
      (aTag == nsMathMLAtoms::mtable_ &&
       aStyleContext->GetStyleDisplay()->mDisplay == NS_STYLE_DISPLAY_TABLE) ||
      aTag == nsMathMLAtoms::math;
#endif
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool IsTableRelated ( PRUint8  aDisplay,
PRBool  aIncludeSpecial 
) [static]

Definition at line 2441 of file nsCSSFrameConstructor.cpp.

{
  if ((aDisplay == NS_STYLE_DISPLAY_TABLE)              ||
      (aDisplay == NS_STYLE_DISPLAY_TABLE_HEADER_GROUP) ||
      (aDisplay == NS_STYLE_DISPLAY_TABLE_ROW_GROUP)    ||
      (aDisplay == NS_STYLE_DISPLAY_TABLE_FOOTER_GROUP) ||
      (aDisplay == NS_STYLE_DISPLAY_TABLE_ROW)) {
    return PR_TRUE;
  }
  else if (aIncludeSpecial && 
           ((aDisplay == NS_STYLE_DISPLAY_TABLE_CAPTION)      ||
            (aDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN_GROUP) ||
            (aDisplay == NS_STYLE_DISPLAY_TABLE_COLUMN)       ||
            (aDisplay == NS_STYLE_DISPLAY_TABLE_CELL))) {
    return PR_TRUE;
  }
  else return PR_FALSE;
}

Here is the caller graph for this function:

static PRBool IsTableRelated ( nsIAtom aParentType,
PRBool  aIncludeSpecial 
) [static]

Definition at line 2462 of file nsCSSFrameConstructor.cpp.

{
  if ((nsLayoutAtoms::tableFrame         == aParentType)  ||
      (nsLayoutAtoms::tableRowGroupFrame == aParentType)  ||
      (nsLayoutAtoms::tableRowFrame      == aParentType)) {
    return PR_TRUE;
  }
  else if (aIncludeSpecial && 
           ((nsLayoutAtoms::tableCaptionFrame  == aParentType)  ||
            (nsLayoutAtoms::tableColGroupFrame == aParentType)  ||
            (nsLayoutAtoms::tableColFrame      == aParentType)  ||
            IS_TABLE_CELL(aParentType))) {
    return PR_TRUE;
  }
  else return PR_FALSE;
}

Here is the call graph for this function:

static PRBool IsXULDisplayType ( const nsStyleDisplay aDisplay) [static]

Definition at line 5914 of file nsCSSFrameConstructor.cpp.

Here is the caller graph for this function:

void MarkIBSpecialPrevSibling ( nsPresContext aPresContext,
nsIFrame aAnonymousFrame,
nsIFrame aSpecialParent 
) [inline]

Definition at line 648 of file nsCSSFrameConstructor.cpp.

{
  aPresContext->PropertyTable()->SetProperty(aAnonymousFrame,
                                      nsLayoutAtoms::IBSplitSpecialPrevSibling,
                                             aSpecialParent, nsnull, nsnull);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void MoveChildrenTo ( nsFrameManager aFrameManager,
nsStyleContext aNewParentSC,
nsIFrame aNewParent,
nsIFrame aFrameList,
nsFrameConstructorState aState,
nsFrameConstructorState aOuterState 
) [static]

Moves frames to a new parent, updating the style context and propagating relevant frame state bits.

|aNewParentSC| may be null, in which case the child frames' style contexts will remain untouched. |aState| may be null, in which case the parent pointers of out-of-flow frames will remain untouched.

Definition at line 1661 of file nsCSSFrameConstructor.cpp.

{
  PRBool setHasChildWithView = PR_FALSE;

  while (aFrameList) {
    if (!setHasChildWithView
        && (aFrameList->GetStateBits() & (NS_FRAME_HAS_VIEW | NS_FRAME_HAS_CHILD_WITH_VIEW))) {
      setHasChildWithView = PR_TRUE;
    }

    aFrameList->SetParent(aNewParent);

    // If aState is not null, the caller expects us to make adjustments so that
    // floats whose placeholders are descendants of frames in aFrameList point
    // to the correct parent.
    if (aState) {
      NS_ASSERTION(aOuterState, "need an outer state too");
      AdjustFloatParentPtrs(aFrameList, *aState, *aOuterState);
    }

#if 0
    // XXX When this is used with {ib} frame hierarchies, it seems
    // fine to leave the style contexts of the children of the
    // anonymous block frame parented by the original inline
    // frame. (In fact, one would expect some inheritance
    // relationships to be broken if we reparented them to the
    // anonymous block frame, but oddly they aren't -- need to
    // investigate that...)
    if (aNewParentSC)
      aPresContext->FrameManager()->ReParentStyleContext(aFrameList);
#endif

    aFrameList = aFrameList->GetNextSibling();
  }

  if (setHasChildWithView) {
    aNewParent->AddStateBits(NS_FRAME_HAS_CHILD_WITH_VIEW);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool MustGeneratePseudoParent ( nsIContent aContent,
nsStyleContext aStyleContext 
) [static]

Definition at line 4021 of file nsCSSFrameConstructor.cpp.

{
  if (!aStyleContext ||
      NS_STYLE_DISPLAY_NONE == aStyleContext->GetStyleDisplay()->mDisplay) {
    return PR_FALSE;
  }
    
  if (aContent->IsContentOfType(nsIContent::eTEXT)) {
    return !IsOnlyWhitespace(aContent);
  }

  return !aContent->IsContentOfType(nsIContent::eCOMMENT);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool NeedFirstLetterContinuation ( nsIContent aContent) [static]

Definition at line 12605 of file nsCSSFrameConstructor.cpp.

{
  NS_PRECONDITION(aContent, "null ptr");

  PRBool result = PR_FALSE;
  if (aContent) {
    nsCOMPtr<nsITextContent> tc(do_QueryInterface(aContent));
    if (tc) {
      const nsTextFragment* frag = tc->Text();
      PRInt32 flc = FirstLetterCount(frag);
      PRInt32 tl = frag->GetLength();
      if (flc < tl) {
        result = PR_TRUE;
      }
    }
  }
  return result;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool NeedFrameFor ( nsIFrame aParentFrame,
nsIContent aChildContent 
) [static]

Definition at line 4100 of file nsCSSFrameConstructor.cpp.

{
  // don't create a whitespace frame if aParentFrame doesn't want it
  if ((NS_FRAME_EXCLUDE_IGNORABLE_WHITESPACE & aParentFrame->GetStateBits())
      && IsOnlyWhitespace(aChildContent)) {
    return PR_FALSE;
  }
  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult NS_NewHTMLCanvasFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)

Definition at line 50 of file nsHTMLCanvasFrame.cpp.

{
  nsHTMLCanvasFrame* it = new (aPresShell) nsHTMLCanvasFrame;
  if (nsnull == it) {
    return NS_ERROR_OUT_OF_MEMORY;
  }
  *aNewFrame = it;
  return NS_OK;
}

Here is the caller graph for this function:

nsresult NS_NewHTMLScrollFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame,
PRBool  aIsRoot 
)

Definition at line 89 of file nsGfxScrollFrame.cpp.

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

Here is the caller graph for this function:

nsresult NS_NewNativeScrollbarFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)

Definition at line 58 of file nsNativeScrollbarFrame.cpp.

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

  *aNewFrame = it;
  return NS_OK;
  
} // NS_NewNativeScrollbarFrame

Here is the caller graph for this function:

nsresult NS_NewScrollbarButtonFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)

Definition at line 65 of file nsScrollbarButtonFrame.cpp.

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

  *aNewFrame = it;
  return NS_OK;
  
} // NS_NewScrollBarButtonFrame

Here is the caller graph for this function:

nsresult NS_NewScrollbarFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)

Definition at line 59 of file nsScrollbarFrame.cpp.

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

  *aNewFrame = it;
  return NS_OK;
  
} // NS_NewScrollbarFrame

Here is the caller graph for this function:

nsresult NS_NewSliderFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
)

Definition at line 97 of file nsSliderFrame.cpp.

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

  *aNewFrame = it;
  return NS_OK;

} // NS_NewSliderFrame

Here is the caller graph for this function:

nsresult NS_NewXULScrollFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame,
PRBool  aIsRoot 
)

Definition at line 914 of file nsGfxScrollFrame.cpp.

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

Here is the caller graph for this function:

static nsresult ProcessPseudoCellFrame ( nsPresContext aPresContext,
nsPseudoFrames aPseudoFrames,
nsIFrame *&  aParent 
) [static]

Definition at line 2558 of file nsCSSFrameConstructor.cpp.

{
  nsresult rv = NS_OK;
  if (!aPresContext) return rv;

  rv = ProcessPseudoFrame(aPresContext, aPseudoFrames.mCellInner, aParent);
  if (NS_FAILED(rv)) return rv;
  rv = ProcessPseudoFrame(aPresContext, aPseudoFrames.mCellOuter, aParent);
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult ProcessPseudoFrame ( nsPresContext aPresContext,
nsPseudoFrameData aPseudoData,
nsIFrame *&  aParent 
) [static]

Definition at line 2490 of file nsCSSFrameConstructor.cpp.

{
  nsresult rv = NS_OK;
  if (!aPresContext) return rv;

  aParent = aPseudoData.mFrame;
  nsFrameItems* items = &aPseudoData.mChildList;
  if (items && items->childList) {
    rv = aParent->SetInitialChildList(aPresContext, nsnull, items->childList);
    if (NS_FAILED(rv)) return rv;
  }
  aPseudoData.Reset();
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult ProcessPseudoFrames ( nsFrameConstructorState aState,
nsIAtom aHighestType,
nsIFrame *&  aHighestFrame 
) [static]

Definition at line 2574 of file nsCSSFrameConstructor.cpp.

{
  nsresult rv = NS_OK;

  aHighestFrame = nsnull;

#ifdef DEBUG
  if (gTablePseudoFrame) {
    printf("*** ProcessPseudoFrames enter***\n");
    aState.mPseudoFrames.Dump();
  }
#endif

  nsPseudoFrames& pseudoFrames = aState.mPseudoFrames;
  nsPresContext* presContext = aState.mPresContext;

  if (nsLayoutAtoms::tableFrame == pseudoFrames.mLowestType) {
    if (pseudoFrames.mColGroup.mFrame) {
       rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup,
                              aHighestFrame);
      if (nsLayoutAtoms::tableColGroupFrame == aHighestType) return rv;
    }
    rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame);
    if (nsLayoutAtoms::tableOuterFrame == aHighestType) return rv;
    
    if (pseudoFrames.mCellOuter.mFrame) {
      rv = ProcessPseudoCellFrame(presContext, pseudoFrames, aHighestFrame);
      if (IS_TABLE_CELL(aHighestType)) return rv;
    }
    if (pseudoFrames.mRow.mFrame) {
      rv = ProcessPseudoFrame(presContext, pseudoFrames.mRow, aHighestFrame);
      if (nsLayoutAtoms::tableRowFrame == aHighestType) return rv;
    }
    if (pseudoFrames.mRowGroup.mFrame) {
      rv = ProcessPseudoRowGroupFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame);
      if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv;
    }
  }
  else if (nsLayoutAtoms::tableRowGroupFrame == pseudoFrames.mLowestType) {
    rv = ProcessPseudoRowGroupFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame);
    if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv;
    if (pseudoFrames.mColGroup.mFrame) {
      nsIFrame* colGroupHigh;
      rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup,
                              colGroupHigh);
      if (aHighestFrame &&
          nsLayoutAtoms::tableRowGroupFrame == aHighestFrame->GetType() &&
          !pseudoFrames.mTableInner.mFrame) {
        // table frames are special they can have two types of pseudo frames
        // that need to be processed in one pass, we only need to link them if
        // the parent is not a pseudo where the link is already done
        // We sort this later out inside nsTableFrame.
         colGroupHigh->SetNextSibling(aHighestFrame); 
      }
      aHighestFrame = colGroupHigh;
      if (nsLayoutAtoms::tableColGroupFrame == aHighestType) return rv;
    }
    if (pseudoFrames.mTableOuter.mFrame) {
      rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame);
      if (nsLayoutAtoms::tableOuterFrame == aHighestType) return rv;
    }
    if (pseudoFrames.mCellOuter.mFrame) {
      rv = ProcessPseudoCellFrame(presContext, pseudoFrames, aHighestFrame);
      if (IS_TABLE_CELL(aHighestType)) return rv;
    }
    if (pseudoFrames.mRow.mFrame) {
      rv = ProcessPseudoFrame(presContext, pseudoFrames.mRow, aHighestFrame);
      if (nsLayoutAtoms::tableRowFrame == aHighestType) return rv;
    }
  }
  else if (nsLayoutAtoms::tableRowFrame == pseudoFrames.mLowestType) {
    rv = ProcessPseudoFrame(presContext, pseudoFrames.mRow, aHighestFrame);
    if (nsLayoutAtoms::tableRowFrame == aHighestType) return rv;

    if (pseudoFrames.mRowGroup.mFrame) {
      rv = ProcessPseudoRowGroupFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame);
      if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv;
    }
    if (pseudoFrames.mColGroup.mFrame) {
      nsIFrame* colGroupHigh;
      rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup,
                              colGroupHigh);
      if (aHighestFrame &&
          nsLayoutAtoms::tableRowGroupFrame == aHighestFrame->GetType() &&
          !pseudoFrames.mTableInner.mFrame) {
        // table frames are special they can have two types of pseudo frames
        // that need to be processed in one pass, we only need to link them if
        // the parent is not a pseudo where the link is already done
        // We sort this later out inside nsTableFrame.
         colGroupHigh->SetNextSibling(aHighestFrame); 
      }
      aHighestFrame = colGroupHigh;
      if (nsLayoutAtoms::tableColGroupFrame == aHighestType) return rv;
    }
    if (pseudoFrames.mTableOuter.mFrame) {
      rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame);
      if (nsLayoutAtoms::tableOuterFrame == aHighestType) return rv;
    }
    if (pseudoFrames.mCellOuter.mFrame) {
      rv = ProcessPseudoCellFrame(presContext, pseudoFrames, aHighestFrame);
      if (IS_TABLE_CELL(aHighestType)) return rv;
    }
  }
  else if (IS_TABLE_CELL(pseudoFrames.mLowestType)) {
    rv = ProcessPseudoCellFrame(presContext, pseudoFrames, aHighestFrame);
    if (IS_TABLE_CELL(aHighestType)) return rv;

    if (pseudoFrames.mRow.mFrame) {
      rv = ProcessPseudoFrame(presContext, pseudoFrames.mRow, aHighestFrame);
      if (nsLayoutAtoms::tableRowFrame == aHighestType) return rv;
    }
    if (pseudoFrames.mRowGroup.mFrame) {
      rv = ProcessPseudoRowGroupFrame(presContext, pseudoFrames.mRowGroup, aHighestFrame);
      if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) return rv;
    }
    if (pseudoFrames.mColGroup.mFrame) {
      nsIFrame* colGroupHigh;
      rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup,
                              colGroupHigh);
      if (aHighestFrame &&
          nsLayoutAtoms::tableRowGroupFrame == aHighestFrame->GetType() &&
          !pseudoFrames.mTableInner.mFrame) {
        // table frames are special they can have two types of pseudo frames
        // that need to be processed in one pass, we only need to link them if
        // the parent is not a pseudo where the link is already done
        // We sort this later out inside nsTableFrame.
         colGroupHigh->SetNextSibling(aHighestFrame); 
      }
      aHighestFrame = colGroupHigh;
      if (nsLayoutAtoms::tableColGroupFrame == aHighestType) return rv;
    }
    if (pseudoFrames.mTableOuter.mFrame) {
      rv = ProcessPseudoTableFrame(presContext, pseudoFrames, aHighestFrame);
    }
  }
  else if (pseudoFrames.mColGroup.mFrame) { 
    // process the col group frame
    rv = ProcessPseudoFrame(presContext, pseudoFrames.mColGroup, aHighestFrame);
  }

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult ProcessPseudoFrames ( nsFrameConstructorState aState,
nsFrameItems aItems 
) [static]

Definition at line 2720 of file nsCSSFrameConstructor.cpp.

{

#ifdef DEBUG
  if (gTablePseudoFrame) {
    printf("*** ProcessPseudoFrames complete enter***\n");
    aState.mPseudoFrames.Dump();
  }
#endif
 
  nsIFrame* highestFrame;
  nsresult rv = ProcessPseudoFrames(aState, nsnull, highestFrame);
  if (highestFrame) {
    aItems.AddChild(highestFrame);
  }
 
#ifdef DEBUG
  if (gTablePseudoFrame) {
    printf("*** ProcessPseudoFrames complete leave, highestframe:%p***\n",
           NS_STATIC_CAST(void*, highestFrame));
    aState.mPseudoFrames.Dump();
  }
#endif
  aState.mPseudoFrames.Reset();
  return rv;
}

Here is the call graph for this function:

static nsresult ProcessPseudoFrames ( nsFrameConstructorState aState,
nsIAtom aHighestType 
) [static]

Definition at line 2749 of file nsCSSFrameConstructor.cpp.

{
#ifdef DEBUG
  if (gTablePseudoFrame) {
    printf("*** ProcessPseudoFrames limited enter highest:");
    if (nsLayoutAtoms::tableOuterFrame == aHighestType) 
      printf("OuterTable");
    else if (nsLayoutAtoms::tableFrame == aHighestType) 
      printf("InnerTable");
    else if (nsLayoutAtoms::tableColGroupFrame == aHighestType) 
      printf("ColGroup");
    else if (nsLayoutAtoms::tableRowGroupFrame == aHighestType) 
      printf("RowGroup");
    else if (nsLayoutAtoms::tableRowFrame == aHighestType) 
      printf("Row");
    else if (IS_TABLE_CELL(aHighestType)) 
      printf("Cell");
    else 
      NS_ASSERTION(PR_FALSE, "invalid call to ProcessPseudoFrames ");
    printf("***\n");
    aState.mPseudoFrames.Dump();
  }
#endif
 
  nsIFrame* highestFrame;
  nsresult rv = ProcessPseudoFrames(aState, aHighestType, highestFrame);

#ifdef DEBUG
  if (gTablePseudoFrame) {
    printf("*** ProcessPseudoFrames limited leave:%p***\n",
           NS_STATIC_CAST(void*, highestFrame));
    aState.mPseudoFrames.Dump();
  }
#endif
  return rv;
}

Here is the call graph for this function:

static nsresult ProcessPseudoRowGroupFrame ( nsPresContext aPresContext,
nsPseudoFrameData aPseudoData,
nsIFrame *&  aParent 
) [static]

Definition at line 2508 of file nsCSSFrameConstructor.cpp.

{
  nsresult rv = NS_OK;
  if (!aPresContext) return rv;

  aParent = aPseudoData.mFrame;
  nsFrameItems* items = &aPseudoData.mChildList;
  if (items && items->childList) {
    nsTableRowGroupFrame* rgFrame = nsTableFrame::GetRowGroupFrame(aParent);
    rv = rgFrame->SetInitialChildList(aPresContext, nsnull, items->childList);
    if (NS_FAILED(rv)) return rv;
  }
  aPseudoData.Reset();
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult ProcessPseudoTableFrame ( nsPresContext aPresContext,
nsPseudoFrames aPseudoFrames,
nsIFrame *&  aParent 
) [static]

Definition at line 2527 of file nsCSSFrameConstructor.cpp.

{
  nsresult rv = NS_OK;
  if (!aPresContext) return rv;

  // process the col group frame, if it exists
  if (aPseudoFrames.mColGroup.mFrame) {
    rv = ProcessPseudoFrame(aPresContext, aPseudoFrames.mColGroup, aParent);
  }

  // process the inner table frame
  rv = ProcessPseudoFrame(aPresContext, aPseudoFrames.mTableInner, aParent);

  // process the outer table frame
  aParent = aPseudoFrames.mTableOuter.mFrame;
  nsFrameItems* items = &aPseudoFrames.mTableOuter.mChildList;
  if (items && items->childList) {
    rv = aParent->SetInitialChildList(aPresContext, nsnull, items->childList);
    if (NS_FAILED(rv)) return rv;
  }
  nsFrameItems* captions = &aPseudoFrames.mTableOuter.mChildList2;
  if (captions && captions->childList) {
    rv = aParent->SetInitialChildList(aPresContext, nsLayoutAtoms::captionList, captions->childList);
  }
  aPseudoFrames.mTableOuter.Reset();
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void ReparentFrame ( nsFrameManager aFrameManager,
nsIFrame aNewParentFrame,
nsIFrame aFrame 
) [static]

Definition at line 12261 of file nsCSSFrameConstructor.cpp.

{
  aFrame->SetParent(aNewParentFrame);
  aFrameManager->ReParentStyleContext(aFrame);
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void SetFrameIsSpecial ( nsIFrame aFrame,
nsIFrame aSpecialSibling 
) [static]

Definition at line 502 of file nsCSSFrameConstructor.cpp.

{
  NS_PRECONDITION(aFrame, "bad args!");

  // Mark the frame and all of its siblings as "special".
  for (nsIFrame* frame = aFrame; frame != nsnull; frame = frame->GetNextInFlow()) {
    frame->AddStateBits(NS_FRAME_IS_SPECIAL);
  }

  if (aSpecialSibling) {
    // We should be the first-in-flow
    NS_ASSERTION(!aFrame->GetPrevInFlow(),
                 "assigning special sibling to other than first-in-flow!");

    // Store the "special sibling" (if we were given one) with the
    // first frame in the flow.
    aFrame->SetProperty(nsLayoutAtoms::IBSplitSpecialSibling, aSpecialSibling);
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

PRBool ShouldIgnoreSelectChild ( nsIContent aContainer) [inline]

Definition at line 8567 of file nsCSSFrameConstructor.cpp.

{
  // Ignore options and optgroups inside a select (size > 1)
  nsIAtom *containerTag = aContainer->Tag();

  if (containerTag == nsHTMLAtoms::optgroup ||
      containerTag == nsHTMLAtoms::select) {
    nsIContent* selectContent = aContainer;

    while (containerTag != nsHTMLAtoms::select) {
      selectContent = selectContent->GetParent();
      if (!selectContent) {
        break;
      }
      containerTag = selectContent->Tag();
    }

    nsCOMPtr<nsISelectElement> selectElement = do_QueryInterface(selectContent);
    if (selectElement) {
      nsAutoString selSize;
      aContainer->GetAttr(kNameSpaceID_None, nsHTMLAtoms::size, selSize);
      if (!selSize.IsEmpty()) {
        PRInt32 err;
        return (selSize.ToInteger(&err) > 1);
      }
    }
  }

  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static void UpdateViewsForTree ( nsPresContext aPresContext,
nsIFrame aFrame,
nsIViewManager aViewManager,
nsFrameManager aFrameManager,
nsRect aBoundsRect,
nsChangeHint  aChange 
) [static]
Parameters:
aBoundsRectreturns the bounds enclosing the areas covered by aFrame and its childre This rect is relative to aFrame's parent

Definition at line 10200 of file nsCSSFrameConstructor.cpp.

{
  NS_PRECONDITION(gInApplyRenderingChangeToTree,
                  "should only be called within ApplyRenderingChangeToTree");

  nsIView* view = aFrame->GetView();
  if (view) {
    if (aChange & nsChangeHint_RepaintFrame) {
      aViewManager->UpdateView(view, NS_VMREFRESH_NO_SYNC);
    }
    if (aChange & nsChangeHint_SyncFrameView) {
      nsContainerFrame::SyncFrameViewProperties(aPresContext, aFrame, nsnull, view);
    }
  }

  nsRect bounds = aFrame->GetOverflowRect();

  // now do children of frame
  PRInt32 listIndex = 0;
  nsIAtom* childList = nsnull;

  do {
    nsIFrame* child = aFrame->GetFirstChild(childList);
    while (child) {
      if (!(child->GetStateBits() & NS_FRAME_OUT_OF_FLOW)) {
        // only do frames that are in flow
        if (nsLayoutAtoms::placeholderFrame == child->GetType()) { // placeholder
          // get out of flow frame and start over there
          nsIFrame* outOfFlowFrame =
            nsPlaceholderFrame::GetRealFrameForPlaceholder(child);

          DoApplyRenderingChangeToTree(aPresContext, outOfFlowFrame,
                                       aViewManager, aFrameManager, aChange);
        }
        else {  // regular frame
          nsRect  childBounds;
          UpdateViewsForTree(aPresContext, child, aViewManager, aFrameManager, childBounds, aChange);
          bounds.UnionRect(bounds, childBounds);
        }
      }
      child = child->GetNextSibling();
    }
    childList = aFrame->GetAdditionalChildListName(listIndex++);
  } while (childList);

  nsPoint parentOffset = aFrame->GetPosition();
  aBoundsRect = bounds + parentOffset;
}

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

Definition at line 244 of file nsCSSFrameConstructor.cpp.

Definition at line 245 of file nsCSSFrameConstructor.cpp.