Back to index

lightning-sunbird  0.9+nobinonly
Public Member Functions | Protected Member Functions | Protected Attributes | Friends
nsMathMLmathInlineFrame Class Reference

#include <nsMathMLContainerFrame.h>

Inheritance diagram for nsMathMLmathInlineFrame:
Inheritance graph
[legend]
Collaboration diagram for nsMathMLmathInlineFrame:
Collaboration graph
[legend]

List of all members.

Public Member Functions

NS_IMETHOD SetInitialChildList (nsPresContext *aPresContext, nsIAtom *aListName, nsIFrame *aChildList)
NS_IMETHOD Reflow (nsPresContext *aPresContext, nsHTMLReflowMetrics &aDesiredSize, const nsHTMLReflowState &aReflowState, nsReflowStatus &aStatus)
NS_IMETHOD AppendFrames (nsIAtom *aListName, nsIFrame *aFrameList)
NS_IMETHOD InsertFrames (nsIAtom *aListName, nsIFrame *aPrevFrame, nsIFrame *aFrameList)
NS_IMETHOD ReplaceFrame (nsIAtom *aListName, nsIFrame *aOldFrame, nsIFrame *aNewFrame)
NS_IMETHOD RemoveFrame (nsIAtom *aListName, nsIFrame *aOldFrame)
virtual PRBool IsFrameOfType (PRUint32 aFlags) const
NS_IMETHOD QueryInterface (const nsIID &aIID, void **aInstancePtr)
NS_IMETHOD Paint (nsPresContext *aPresContext, nsIRenderingContext &aRenderingContext, const nsRect &aDirtyRect, nsFramePaintLayer aWhichLayer, PRUint32 aFlags=0)
NS_IMETHOD ReflowDirtyChild (nsIPresShell *aPresShell, nsIFrame *aChild)
virtual nsIAtomGetType () const
virtual PRBool IsEmpty ()
virtual PRBool IsSelfEmpty ()
NS_IMETHOD CanContinueTextRun (PRBool &aContinueTextRun) const
void StealAllFrames ()

Protected Member Functions

 nsMathMLmathInlineFrame ()
virtual ~nsMathMLmathInlineFrame ()
NS_IMETHOD DidSetStyleContext (nsPresContext *aPresContext)
virtual PRIntn GetSkipSides () const
nsresult ReflowFrames (nsPresContext *aPresContext, const nsHTMLReflowState &aReflowState, InlineReflowState &rs, nsHTMLReflowMetrics &aMetrics, nsReflowStatus &aStatus)
nsresult ReflowInlineFrame (nsPresContext *aPresContext, const nsHTMLReflowState &aReflowState, InlineReflowState &rs, nsIFrame *aFrame, nsReflowStatus &aStatus)
void ReparentFloatsForInlineChild (nsIFrame *aOurBlock, nsIFrame *aFrame, PRBool aReparentSiblings)
 Reparent floats whose placeholders are inline descendants of aFrame from whatever block they're currently parented by to aOurBlock.
virtual nsIFramePullOneFrame (nsPresContext *aPresContext, InlineReflowState &rs, PRBool *aIsComplete)
virtual void PushFrames (nsPresContext *aPresContext, nsIFrame *aFromChild, nsIFrame *aPrevSibling)

Protected Attributes

PRBool mScriptStyleChanged

Friends

nsresult NS_NewMathMLmathInlineFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)
nsresult NS_NewInlineFrame (nsIPresShell *aPresShell, nsIFrame **aNewFrame)

Detailed Description

Definition at line 427 of file nsMathMLContainerFrame.h.


Constructor & Destructor Documentation

Definition at line 503 of file nsMathMLContainerFrame.h.

{}
virtual nsMathMLmathInlineFrame::~nsMathMLmathInlineFrame ( ) [inline, protected, virtual]

Definition at line 504 of file nsMathMLContainerFrame.h.

{}

Member Function Documentation

NS_IMETHOD nsMathMLmathInlineFrame::AppendFrames ( nsIAtom aListName,
nsIFrame aFrameList 
) [inline]

Reimplemented from nsInlineFrame.

Definition at line 457 of file nsMathMLContainerFrame.h.

  {
    NS_ASSERTION(!aListName, "internal error");
    nsresult rv = nsInlineFrame::AppendFrames(aListName, aFrameList);
    nsMathMLContainerFrame::ReLayoutChildren(this);
    return rv;
  }

Here is the call graph for this function:

NS_IMETHODIMP nsInlineFrame::CanContinueTextRun ( PRBool aContinueTextRun) const [inherited]

Definition at line 500 of file nsInlineFrame.cpp.

{
  // We can continue a text run through an inline frame
  aContinueTextRun = PR_TRUE;
  return NS_OK;
}
NS_IMETHOD nsMathMLmathInlineFrame::DidSetStyleContext ( nsPresContext aPresContext) [inline, protected]

Definition at line 507 of file nsMathMLContainerFrame.h.

PRIntn nsInlineFrame::GetSkipSides ( ) const [protected, virtual, inherited]

Definition at line 916 of file nsInlineFrame.cpp.

{
  PRIntn skip = 0;
  if (nsnull != mPrevInFlow) {
    nsInlineFrame* prev = (nsInlineFrame*) mPrevInFlow;
    if (prev->mRect.height || prev->mRect.width) {
      // Prev-in-flow is not empty therefore we don't render our left
      // border edge.
      skip |= 1 << NS_SIDE_LEFT;
    }
    else {
      // If the prev-in-flow is empty, then go ahead and let our left
      // edge border render.
    }
  }
  if (nsnull != mNextInFlow) {
    nsInlineFrame* next = (nsInlineFrame*) mNextInFlow;
    if (next->mRect.height || next->mRect.width) {
      // Next-in-flow is not empty therefore we don't render our right
      // border edge.
      skip |= 1 << NS_SIDE_RIGHT;
    }
    else {
      // If the next-in-flow is empty, then go ahead and let our right
      // edge border render.
    }
  }
  return skip;
}
nsIAtom * nsInlineFrame::GetType ( void  ) const [virtual, inherited]

Reimplemented in nsPositionedInlineFrame, and nsFirstLineFrame.

Definition at line 112 of file nsInlineFrame.cpp.

{
  return nsLayoutAtoms::inlineFrame;
}
NS_IMETHOD nsMathMLmathInlineFrame::InsertFrames ( nsIAtom aListName,
nsIFrame aPrevFrame,
nsIFrame aFrameList 
) [inline]

Reimplemented from nsInlineFrame.

Definition at line 467 of file nsMathMLContainerFrame.h.

  {
    NS_ASSERTION(!aListName, "internal error");
    nsresult rv = nsInlineFrame::InsertFrames(aListName, aPrevFrame, aFrameList);
    nsMathMLContainerFrame::ReLayoutChildren(this);
    return rv;
  }

Here is the call graph for this function:

PRBool nsInlineFrame::IsEmpty ( void  ) [virtual, inherited]

Definition at line 167 of file nsInlineFrame.cpp.

{
  if (!IsSelfEmpty()) {
    return PR_FALSE;
  }

  for (nsIFrame *kid = mFrames.FirstChild(); kid; kid = kid->GetNextSibling()) {
    if (!kid->IsEmpty())
      return PR_FALSE;
  }

  return PR_TRUE;
}

Here is the call graph for this function:

virtual PRBool nsMathMLmathInlineFrame::IsFrameOfType ( PRUint32  aFlags) const [inline, virtual]

Definition at line 498 of file nsMathMLContainerFrame.h.

                                                      {
    return !(aFlags & ~nsIFrame::eMathML);
  }
PRBool nsInlineFrame::IsSelfEmpty ( ) [virtual, inherited]

Definition at line 135 of file nsInlineFrame.cpp.

{
#if 0
  // I used to think inline frames worked this way, but it seems they
  // don't.  At least not in our codebase.
  if (GetPresContext()->CompatibilityMode() == eCompatibility_FullStandards) {
    return PR_FALSE;
  }
#endif
  const nsStyleMargin* margin = GetStyleMargin();
  const nsStyleBorder* border = GetStyleBorder();
  const nsStylePadding* padding = GetStylePadding();
  nsStyleCoord coord;
  // XXX Top and bottom removed, since they shouldn't affect things, but this
  // doesn't really match with nsLineLayout.cpp's setting of
  // ZeroEffectiveSpanBox, anymore, so what should this really be?
  if (border->GetBorderWidth(NS_SIDE_RIGHT) != 0 ||
      border->GetBorderWidth(NS_SIDE_LEFT) != 0 ||
      !IsPaddingZero(padding->mPadding.GetRightUnit(),
                     padding->mPadding.GetRight(coord)) ||
      !IsPaddingZero(padding->mPadding.GetLeftUnit(),
                     padding->mPadding.GetLeft(coord)) ||
      !IsMarginZero(margin->mMargin.GetRightUnit(),
                    margin->mMargin.GetRight(coord)) ||
      !IsMarginZero(margin->mMargin.GetLeftUnit(),
                    margin->mMargin.GetLeft(coord))) {
    return PR_FALSE;
  }
  return PR_TRUE;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsInlineFrame::Paint ( nsPresContext aPresContext,
nsIRenderingContext aRenderingContext,
const nsRect aDirtyRect,
nsFramePaintLayer  aWhichLayer,
PRUint32  aFlags = 0 
) [inherited]

Definition at line 300 of file nsInlineFrame.cpp.

{
  if (NS_FRAME_IS_UNFLOWABLE & mState) {
    return NS_OK;
  }

  // Paint inline element backgrounds in the foreground layer (bug 36710).
  if (aWhichLayer == NS_FRAME_PAINT_LAYER_FOREGROUND) {
    PaintSelf(aPresContext, aRenderingContext, aDirtyRect);
  }
    
  // The sole purpose of this is to trigger display of the selection
  // window for Named Anchors, which don't have any children and
  // normally don't have any size, but in Editor we use CSS to display
  // an image to represent this "hidden" element.
  if (!mFrames.FirstChild()) {
    nsFrame::Paint(aPresContext, aRenderingContext, aDirtyRect,
                   aWhichLayer, aFlags);
  }

  PaintDecorationsAndChildren(aPresContext, aRenderingContext,
                              aDirtyRect, aWhichLayer, PR_FALSE,
                              aFlags);
  return NS_OK;
}
nsIFrame * nsInlineFrame::PullOneFrame ( nsPresContext aPresContext,
InlineReflowState rs,
PRBool aIsComplete 
) [protected, virtual, inherited]

Reimplemented in nsFirstLineFrame.

Definition at line 857 of file nsInlineFrame.cpp.

{
  PRBool isComplete = PR_TRUE;

  nsIFrame* frame = nsnull;
  nsInlineFrame* nextInFlow = irs.mNextInFlow;
  while (nsnull != nextInFlow) {
    frame = nextInFlow->mFrames.FirstChild();
    if (nsnull != frame) {
      // If our block has no next continuation, then any floats belonging to
      // the pulled frame must belong to our block already. This check ensures
      // we do no extra work in the common non-vertical-breaking case.
      if (irs.mLineContainer && irs.mLineContainer->GetNextInFlow()) {
        // The blockChildren.ContainsFrame check performed by
        // ReparentFloatsForInlineChild will be fast because frame's ancestor
        // will be the first child of its containing block.
        ReparentFloatsForInlineChild(irs.mLineContainer, frame, PR_FALSE);
      }
      nextInFlow->mFrames.RemoveFirstChild();
      mFrames.InsertFrame(this, irs.mPrevFrame, frame);
      isComplete = PR_FALSE;
      nsHTMLContainerFrame::ReparentFrameView(aPresContext, frame, nextInFlow, this);
      break;
    }
    nextInFlow = (nsInlineFrame*) nextInFlow->mNextInFlow;
    irs.mNextInFlow = nextInFlow;
  }

  *aIsComplete = isComplete;
  return frame;
}

Here is the call graph for this function:

Here is the caller graph for this function:

void nsInlineFrame::PushFrames ( nsPresContext aPresContext,
nsIFrame aFromChild,
nsIFrame aPrevSibling 
) [protected, virtual, inherited]

Definition at line 892 of file nsInlineFrame.cpp.

{
  NS_PRECONDITION(nsnull != aFromChild, "null pointer");
  NS_PRECONDITION(nsnull != aPrevSibling, "pushing first child");
  NS_PRECONDITION(aPrevSibling->GetNextSibling() == aFromChild, "bad prev sibling");

#ifdef NOISY_PUSHING
      printf("%p pushing aFromChild %p, disconnecting from prev sib %p\n", 
             this, aFromChild, aPrevSibling);
#endif
  // Disconnect aFromChild from its previous sibling
  aPrevSibling->SetNextSibling(nsnull);

  // Add the frames to our overflow list (let our next in flow drain
  // our overflow list when it is ready)
  SetOverflowFrames(aPresContext, aFromChild);
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHODIMP nsInlineFrame::QueryInterface ( const nsIID aIID,
void **  aInstancePtr 
) [inherited]

Reimplemented in nsXTFXMLInlineDisplayFrame.

Definition at line 90 of file nsInlineFrame.cpp.

{
  if (nsnull == aInstancePtr) {
    return NS_ERROR_NULL_POINTER;
  }
  if (aIID.Equals(kInlineFrameCID)) {
    nsInlineFrame* tmp = this;
    *aInstancePtr = (void*) tmp;
    return NS_OK;
  }
  return nsInlineFrameSuper::QueryInterface(aIID, aInstancePtr);
}

Here is the call graph for this function:

NS_IMETHOD nsMathMLmathInlineFrame::Reflow ( nsPresContext aPresContext,
nsHTMLReflowMetrics aDesiredSize,
const nsHTMLReflowState aReflowState,
nsReflowStatus aStatus 
) [inline]

Reimplemented from nsInlineFrame.

Definition at line 444 of file nsMathMLContainerFrame.h.

  {
    if (mScriptStyleChanged) {
      mScriptStyleChanged = PR_FALSE;
      nsMathMLContainerFrame::PropagateScriptStyleFor(this, 0);
    }
    return nsInlineFrame::Reflow(aPresContext, aDesiredSize, aReflowState, aStatus);
  }

Here is the call graph for this function:

NS_IMETHODIMP nsInlineFrame::ReflowDirtyChild ( nsIPresShell aPresShell,
nsIFrame aChild 
) [inherited]

Definition at line 508 of file nsInlineFrame.cpp.

{
  // The inline container frame does not handle the reflow
  // request.  It passes it up to its parent container.

  // If you don't already have dirty children,
  if (!(mState & NS_FRAME_HAS_DIRTY_CHILDREN)) {
    if (mParent) {
      // Record that you are dirty and have dirty children
      mState |= NS_FRAME_IS_DIRTY;
      mState |= NS_FRAME_HAS_DIRTY_CHILDREN; 

      // Pass the reflow request up to the parent
      mParent->ReflowDirtyChild(aPresShell, this);
    }
    else {
      NS_ERROR("No parent to pass the reflow request up to.");
    }
  }

  return NS_OK;
}

Here is the caller graph for this function:

nsresult nsInlineFrame::ReflowFrames ( nsPresContext aPresContext,
const nsHTMLReflowState aReflowState,
InlineReflowState rs,
nsHTMLReflowMetrics aMetrics,
nsReflowStatus aStatus 
) [protected, inherited]

Definition at line 532 of file nsInlineFrame.cpp.

{
  nsresult rv = NS_OK;
  aStatus = NS_FRAME_COMPLETE;

  nsLineLayout* lineLayout = aReflowState.mLineLayout;
  nscoord leftEdge = 0;
  if (nsnull == mPrevInFlow) {
    leftEdge = aReflowState.mComputedBorderPadding.left;
  }
  nscoord availableWidth = aReflowState.availableWidth;
  if (NS_UNCONSTRAINEDSIZE != availableWidth) {
    // Subtract off left and right border+padding from availableWidth
    availableWidth -= leftEdge;
    availableWidth -= aReflowState.mComputedBorderPadding.right;
    availableWidth = PR_MAX(0, availableWidth);
  }
  lineLayout->BeginSpan(this, &aReflowState, leftEdge, leftEdge + availableWidth);

  // First reflow our current children
  nsIFrame* frame = mFrames.FirstChild();
  PRBool done = PR_FALSE;
  while (nsnull != frame) {
    PRBool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();

    // Check if we should lazily set the child frame's parent pointer
    if (irs.mSetParentPointer) {
      PRBool havePrevBlock =
         irs.mLineContainer && irs.mLineContainer->GetPrevInFlow();
      // If our block is the first in flow, then any floats under the pulled
      // frame must already belong to our block.
      if (havePrevBlock) {
        // This has to happen before we update frame's parent; we need to
        // know frame's ancestry under its old block.
        // The blockChildren.ContainsFrame check performed by
        // ReparentFloatsForInlineChild here may be slow, but we can't
        // easily avoid it because we don't know where 'frame' originally
        // came from. If we really really have to optimize this we could
        // cache whether frame->GetParent() is under its containing blocks
        // overflowList or not.
        ReparentFloatsForInlineChild(irs.mLineContainer, frame, PR_FALSE);
      }
      frame->SetParent(this);
      // We also need to check if frame has a next-in-flow. It it does, then set
      // its parent frame pointer, too. Otherwise, if we reflow frame and it's
      // complete we'll fail when deleting its next-in-flow which is no longer
      // needed. This scenario doesn't happen often, but it can happen
      nsIFrame* nextInFlow = frame->GetNextInFlow();
      while (nextInFlow) {
        // Since we only do lazy setting of parent pointers for the frame's
        // initial reflow, this frame can't have a next-in-flow. That means
        // the continuing child frame must be in our child list as well. If
        // not, then something is wrong
        NS_ASSERTION(mFrames.ContainsFrame(nextInFlow), "unexpected flow");
        if (havePrevBlock) {
          ReparentFloatsForInlineChild(irs.mLineContainer, nextInFlow, PR_FALSE);
        }
        nextInFlow->SetParent(this);
        nextInFlow = nextInFlow->GetNextInFlow();
      }
    }
    rv = ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus);
    if (NS_FAILED(rv)) {
      done = PR_TRUE;
      break;
    }
    if (NS_INLINE_IS_BREAK(aStatus) || 
        (!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus))) {
      done = PR_TRUE;
      break;
    }
    irs.mPrevFrame = frame;
    frame = frame->GetNextSibling();
  }

  // Attempt to pull frames from our next-in-flow until we can't
  if (!done && (nsnull != mNextInFlow)) {
    while (!done) {
      PRBool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();
      PRBool isComplete;
      frame = PullOneFrame(aPresContext, irs, &isComplete);
#ifdef NOISY_PUSHING
      printf("%p pulled up %p\n", this, frame);
#endif
      if (nsnull == frame) {
        if (!isComplete) {
          aStatus = NS_FRAME_NOT_COMPLETE;
        }
        break;
      }
      rv = ReflowInlineFrame(aPresContext, aReflowState, irs, frame, aStatus);
      if (NS_FAILED(rv)) {
        done = PR_TRUE;
        break;
      }
      if (NS_INLINE_IS_BREAK(aStatus) || 
          (!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus))) {
        done = PR_TRUE;
        break;
      }
      irs.mPrevFrame = frame;
    }
  }
#ifdef DEBUG
  if (NS_FRAME_IS_COMPLETE(aStatus)) {
    // We can't be complete AND have overflow frames!
    nsIFrame* overflowFrames = GetOverflowFrames(aPresContext, PR_FALSE);
    NS_ASSERTION(!overflowFrames, "whoops");
  }
#endif

  // If after reflowing our children they take up no area then make
  // sure that we don't either.
  //
  // Note: CSS demands that empty inline elements still affect the
  // line-height calculations. However, continuations of an inline
  // that are empty we force to empty so that things like collapsed
  // whitespace in an inline element don't affect the line-height.
  nsSize size;
  lineLayout->EndSpan(this, size,
                    aMetrics.mComputeMEW ? &aMetrics.mMaxElementWidth : nsnull);
  if ((0 == size.height) && (0 == size.width) &&
      ((nsnull != mPrevInFlow) || (nsnull != mNextInFlow))) {
    // This is a continuation of a previous inline. Therefore make
    // sure we don't affect the line-height.
    aMetrics.width = 0;
    aMetrics.height = 0;
    aMetrics.ascent = 0;
    aMetrics.descent = 0;
    if (aMetrics.mComputeMEW) {
      aMetrics.mMaxElementWidth = 0;
    }
  }
  else {
    // Compute final width
    aMetrics.width = size.width;
    if (nsnull == mPrevInFlow) {
      aMetrics.width += aReflowState.mComputedBorderPadding.left;
    }
    if (NS_FRAME_IS_COMPLETE(aStatus)) {
      aMetrics.width += aReflowState.mComputedBorderPadding.right;
    }

    SetFontFromStyle(aReflowState.rendContext, mStyleContext);
    nsCOMPtr<nsIFontMetrics> fm;
    aReflowState.rendContext->GetFontMetrics(*getter_AddRefs(fm));

    if (fm) {
      // Compute final height of the frame.
      //
      // Do things the standard css2 way -- though it's hard to find it
      // in the css2 spec! It's actually found in the css1 spec section
      // 4.4 (you will have to read between the lines to really see
      // it).
      //
      // The height of our box is the sum of our font size plus the top
      // and bottom border and padding. The height of children do not
      // affect our height.
      fm->GetMaxAscent(aMetrics.ascent);
      fm->GetMaxDescent(aMetrics.descent);
      fm->GetHeight(aMetrics.height);
    } else {
      NS_WARNING("Cannot get font metrics - defaulting sizes to 0");
      aMetrics.ascent = aMetrics.descent = aMetrics.height = 0;
    }
    aMetrics.ascent += aReflowState.mComputedBorderPadding.top;
    aMetrics.descent += aReflowState.mComputedBorderPadding.bottom;
    aMetrics.height += aReflowState.mComputedBorderPadding.top +
      aReflowState.mComputedBorderPadding.bottom;
  }

  // For now our overflow area is zero. The real value will be
  // computed during vertical alignment of the line we are on.
  aMetrics.mOverflowArea.SetRect(0, 0, 0, 0);

#ifdef NOISY_FINAL_SIZE
  ListTag(stdout);
  printf(": metrics=%d,%d ascent=%d descent=%d\n",
         aMetrics.width, aMetrics.height, aMetrics.ascent, aMetrics.descent);
  if (aMetrics.mComputeMEW) {
    printf(" maxElementWidth %d\n", aMetrics.mMaxElementWidth);
  }
#endif

  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult nsInlineFrame::ReflowInlineFrame ( nsPresContext aPresContext,
const nsHTMLReflowState aReflowState,
InlineReflowState rs,
nsIFrame aFrame,
nsReflowStatus aStatus 
) [protected, inherited]

Definition at line 753 of file nsInlineFrame.cpp.

{
  nsLineLayout* lineLayout = aReflowState.mLineLayout;
  PRBool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();
  PRBool pushedFrame;
  nsresult rv = lineLayout->ReflowFrame(aFrame, aStatus, nsnull, pushedFrame);
  /* This next block is for bug 28811
     Test the child frame for %-awareness, 
     and mark this frame with a bit if it is %-aware.
     Don't bother if this frame is already marked
  */
  if (!(mState & NS_INLINE_FRAME_CONTAINS_PERCENT_AWARE_CHILD)) {  
    MarkPercentAwareFrame(aPresContext, this, aFrame);
  }

  if (NS_FAILED(rv)) {
    return rv;
  }
  if (NS_INLINE_IS_BREAK(aStatus)) {
    if (NS_INLINE_IS_BREAK_BEFORE(aStatus)) {
      if (aFrame != mFrames.FirstChild()) {
        // Change break-before status into break-after since we have
        // already placed at least one child frame. This preserves the
        // break-type so that it can be propagated upward.
        aStatus = NS_FRAME_NOT_COMPLETE |
          NS_INLINE_BREAK | NS_INLINE_BREAK_AFTER |
          (aStatus & NS_INLINE_BREAK_TYPE_MASK);
        PushFrames(aPresContext, aFrame, irs.mPrevFrame);
      }
      else {
        // Preserve reflow status when breaking-before our first child
        // and propagate it upward without modification.
        // Note: if we're lazily setting the frame pointer for our child 
        // frames, then we need to set it now. Don't return and leave the
        // remaining child frames in our child list with the wrong parent
        // frame pointer...
        if (irs.mSetParentPointer) {
          if (irs.mLineContainer && irs.mLineContainer->GetPrevInFlow()) {
            ReparentFloatsForInlineChild(irs.mLineContainer, aFrame->GetNextSibling(),
                                         PR_TRUE);
          }
          for (nsIFrame* f = aFrame->GetNextSibling(); f; f = f->GetNextSibling()) {
            f->SetParent(this);
          }
        }
      }
    }
    else {
      // Break-after
      if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
        nsIFrame* newFrame;
        rv = CreateNextInFlow(aPresContext, this, aFrame, newFrame);
        if (NS_FAILED(rv)) {
          return rv;
        }
      }
      nsIFrame* nextFrame = aFrame->GetNextSibling();
      if (nextFrame) {
        aStatus |= NS_FRAME_NOT_COMPLETE;
        PushFrames(aPresContext, nextFrame, aFrame);
      }
      else if (nsnull != mNextInFlow) {
        // We must return an incomplete status if there are more child
        // frames remaining in a next-in-flow that follows this frame.
        nsInlineFrame* nextInFlow = (nsInlineFrame*) mNextInFlow;
        while (nsnull != nextInFlow) {
          if (nextInFlow->mFrames.NotEmpty()) {
            aStatus |= NS_FRAME_NOT_COMPLETE;
            break;
          }
          nextInFlow = (nsInlineFrame*) nextInFlow->mNextInFlow;
        }
      }
    }
  }
  else if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
    if (nsLayoutAtoms::placeholderFrame == aFrame->GetType()) {
      nsBlockReflowState* blockRS = lineLayout->mBlockRS;
      blockRS->mBlock->SplitPlaceholder(*blockRS, aFrame);
      // Allow the parent to continue reflowing
      aStatus = NS_FRAME_COMPLETE;
    }
    else {
      nsIFrame* newFrame;
      rv = CreateNextInFlow(aPresContext, this, aFrame, newFrame);
      if (NS_FAILED(rv)) {
        return rv;
      }
      if (!reflowingFirstLetter) {
        nsIFrame* nextFrame = aFrame->GetNextSibling();
        if (nextFrame) {
          PushFrames(aPresContext, nextFrame, aFrame);
        }
      }
    }
  }
  return rv;
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHOD nsMathMLmathInlineFrame::RemoveFrame ( nsIAtom aListName,
nsIFrame aOldFrame 
) [inline]

Reimplemented from nsInlineFrame.

Definition at line 489 of file nsMathMLContainerFrame.h.

  {
    NS_ASSERTION(!aListName, "internal error");
    nsresult rv = nsInlineFrame::RemoveFrame(aListName, aOldFrame);
    nsMathMLContainerFrame::ReLayoutChildren(this);
    return rv;
  }

Here is the call graph for this function:

void nsInlineFrame::ReparentFloatsForInlineChild ( nsIFrame aOurBlock,
nsIFrame aFrame,
PRBool  aReparentSiblings 
) [protected, inherited]

Reparent floats whose placeholders are inline descendants of aFrame from whatever block they're currently parented by to aOurBlock.

Parameters:
aReparentSiblingsif this is true, we follow aFrame's GetNextSibling chain reparenting them all

Definition at line 334 of file nsInlineFrame.cpp.

{
  NS_ASSERTION(aOurLineContainer->GetNextInFlow() ||
               aOurLineContainer->GetPrevInFlow(),
               "Don't call this when we have no continuation, it's a waste");

  if (!aFrame) {
    NS_ASSERTION(aReparentSiblings, "Why did we get called?");
    return;
  }

  nsIFrame* ancestor = aFrame;
  nsIFrame* ancestorBlockChild;
  do {
    ancestorBlockChild = ancestor;
    ancestor = ancestor->GetParent();
    NS_ASSERTION(ancestor, "No block ancestor!");
  } while (!ancestor->IsFloatContainingBlock());

  if (ancestor == aOurLineContainer)
    return;

  nsBlockFrame* ourBlock;
  nsresult rv = aOurLineContainer->QueryInterface(kBlockFrameCID, (void**)&ourBlock);
  NS_ASSERTION(NS_SUCCEEDED(rv), "Not a block, but broke vertically?");
  nsBlockFrame* frameBlock;
  rv = ancestor->QueryInterface(kBlockFrameCID, (void**)&frameBlock);
  NS_ASSERTION(NS_SUCCEEDED(rv), "ancestor not a block");

  nsFrameList blockChildren(ancestor->GetFirstChild(nsnull));
  PRBool isOverflow = !blockChildren.ContainsFrame(ancestorBlockChild);

  while (PR_TRUE) {
    ourBlock->ReparentFloats(aFrame, frameBlock, isOverflow, PR_FALSE);

    if (!aReparentSiblings)
      return;
    nsIFrame* next = aFrame->GetNextSibling();
    if (!next)
      return;
    if (next->GetParent() == aFrame->GetParent()) {
      aFrame = next;
      continue;
    }
    // This is paranoid and will hardly ever get hit ... but we can't actually
    // trust that the frames in the sibling chain all have the same parent,
    // because lazy reparenting may be going on. If we find a different
    // parent we need to redo our analysis.
    ReparentFloatsForInlineChild(aOurLineContainer, next, aReparentSiblings);
    return;
  }
}

Here is the call graph for this function:

Here is the caller graph for this function:

NS_IMETHOD nsMathMLmathInlineFrame::ReplaceFrame ( nsIAtom aListName,
nsIFrame aOldFrame,
nsIFrame aNewFrame 
) [inline]

Reimplemented from nsInlineFrame.

Definition at line 478 of file nsMathMLContainerFrame.h.

  {
    NS_ASSERTION(!aListName, "internal error");
    nsresult rv = nsInlineFrame::ReplaceFrame(aListName, aOldFrame, aNewFrame);
    nsMathMLContainerFrame::ReLayoutChildren(this);
    return rv;
  }

Here is the call graph for this function:

NS_IMETHOD nsMathMLmathInlineFrame::SetInitialChildList ( nsPresContext aPresContext,
nsIAtom aListName,
nsIFrame aChildList 
) [inline]

Definition at line 432 of file nsMathMLContainerFrame.h.

  {
    nsresult rv = nsInlineFrame::SetInitialChildList(aPresContext, aListName, aChildList);
    // re-resolve our subtree to set any mathml-expected data
    nsMathMLContainerFrame::MapAttributesIntoCSS(aPresContext, this);
    nsMathMLContainerFrame::RebuildAutomaticDataForChildren(this);
    return rv;
  }

Here is the call graph for this function:

void nsInlineFrame::StealAllFrames ( ) [inline, inherited]

Definition at line 116 of file nsInlineFrame.h.

                        {
    mFrames.SetFrames(nsnull);
  }

Friends And Related Function Documentation

nsresult NS_NewInlineFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
) [friend, inherited]

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;
}
nsresult NS_NewMathMLmathInlineFrame ( nsIPresShell aPresShell,
nsIFrame **  aNewFrame 
) [friend]

Definition at line 1493 of file nsMathMLContainerFrame.cpp.

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

Member Data Documentation

Definition at line 513 of file nsMathMLContainerFrame.h.


The documentation for this class was generated from the following file: