Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsHTMLContainerFrame.cpp File Reference
#include "nsHTMLContainerFrame.h"
#include "nsIRenderingContext.h"
#include "nsPresContext.h"
#include "nsIPresShell.h"
#include "nsStyleContext.h"
#include "nsStyleConsts.h"
#include "nsIContent.h"
#include "nsLayoutAtoms.h"
#include "nsLayoutUtils.h"
#include "nsCSSAnonBoxes.h"
#include "nsIWidget.h"
#include "nsILinkHandler.h"
#include "nsGUIEvent.h"
#include "nsIDocument.h"
#include "nsIURL.h"
#include "nsPlaceholderFrame.h"
#include "nsHTMLParts.h"
#include "nsIView.h"
#include "nsIViewManager.h"
#include "nsIDOMEvent.h"
#include "nsIScrollableView.h"
#include "nsWidgetsCID.h"
#include "nsCOMPtr.h"
#include "nsIDeviceContext.h"
#include "nsIFontMetrics.h"
#include "nsReflowPath.h"
#include "nsCSSFrameConstructor.h"

Go to the source code of this file.

Functions

static PRBool HasTextFrameDescendantOrInFlow (nsPresContext *aPresContext, nsIFrame *aFrame)
static PRBool HasTextFrameDescendant (nsPresContext *aPresContext, nsIFrame *aParent)
static nsresult ReparentFrameViewTo (nsIFrame *aFrame, nsIViewManager *aViewManager, nsIView *aNewParentView, nsIView *aOldParentView)

Function Documentation

static PRBool HasTextFrameDescendant ( nsPresContext aPresContext,
nsIFrame aParent 
) [static]

Definition at line 225 of file nsHTMLContainerFrame.cpp.

{
  for (nsIFrame* kid = aParent->GetFirstChild(nsnull); kid;
       kid = kid->GetNextSibling())
  {
    if (kid->GetType() == nsLayoutAtoms::textFrame) {
      // This is only a candidate. We need to determine if this text
      // frame is empty, as in containing only (non-pre) whitespace.
      // See bug 20163.
      if (!kid->IsEmpty()) {
        return PR_TRUE;
      }
    }
    if (HasTextFrameDescendant(aPresContext, kid)) {
      return PR_TRUE;
    }
  }
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static PRBool HasTextFrameDescendantOrInFlow ( nsPresContext aPresContext,
nsIFrame aFrame 
) [static]

Definition at line 246 of file nsHTMLContainerFrame.cpp.

{
  for (nsIFrame *f = aFrame->GetFirstInFlow(); f; f = f->GetNextInFlow()) {
    if (HasTextFrameDescendant(aPresContext, f))
      return PR_TRUE;
  }
  return PR_FALSE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

static nsresult ReparentFrameViewTo ( nsIFrame aFrame,
nsIViewManager aViewManager,
nsIView aNewParentView,
nsIView aOldParentView 
) [static]

Definition at line 340 of file nsHTMLContainerFrame.cpp.

{

  // XXX What to do about placeholder views for "position: fixed" elements?
  // They should be reparented too.

  // Does aFrame have a view?
  if (aFrame->HasView()) {
    nsIView* view = aFrame->GetView();
    // Verify that the current parent view is what we think it is
    //nsIView*  parentView;
    //NS_ASSERTION(parentView == aOldParentView, "unexpected parent view");

    aViewManager->RemoveChild(view);
    
    // The view will remember the Z-order and other attributes that have been set on it.
    nsIView* insertBefore = nsLayoutUtils::FindSiblingViewFor(aNewParentView, aFrame);
    aViewManager->InsertChild(aNewParentView, view, insertBefore, insertBefore != nsnull);
  } else {
    PRInt32 listIndex = 0;
    nsIAtom* listName = nsnull;
    // This loop iterates through every child list name, and also
    // executes once with listName == nsnull.
    do {
      // Iterate the child frames, and check each child frame to see if it has
      // a view
      nsIFrame* childFrame = aFrame->GetFirstChild(listName);
      for (; childFrame; childFrame = childFrame->GetNextSibling()) {
        ReparentFrameViewTo(childFrame, aViewManager,
                            aNewParentView, aOldParentView);
      }
      listName = aFrame->GetAdditionalChildListName(listIndex++);
    } while (listName);
  }

  return NS_OK;
}

Here is the call graph for this function:

Here is the caller graph for this function: