Bug 501847 part 5. Get rid of the MoveFrames function now that there is only one caller. r=tn,roc
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -10894,62 +10894,42 @@ nsCSSFrameConstructor::CreateIBSiblings(
// Any frame might need a view
nsHTMLContainerFrame::CreateViewForFrame(inlineFrame, PR_FALSE);
if (aChildItems.NotEmpty()) {
nsFrameList::FrameLinkEnumerator firstBlock(aChildItems);
FindFirstBlock(firstBlock);
nsFrameList inlineKids = aChildItems.ExtractHead(firstBlock);
- MoveFramesToEndOfIBSplit(aState, inlineFrame, inlineKids, nsnull);
+
+ nsIFrame* newFirstChild = inlineKids.FirstChild();
+ if (inlineFrame->HasView() || aInitialInline->HasView()) {
+ // Move the frames into the new view
+ nsHTMLContainerFrame::ReparentFrameViewList(aState.mPresContext,
+ inlineKids, aInitialInline,
+ inlineFrame);
+ }
+
+ // Save the first frame in inlineKids for the MoveChildrenTo call, since
+ // SetInitialChildList will empty inlineKids.
+ inlineFrame->SetInitialChildList(nsnull, inlineKids);
+
+ MoveChildrenTo(aState.mFrameManager, inlineFrame, newFirstChild,
+ nsnull, nsnull, nsnull);
}
SetFrameIsSpecial(blockFrame, inlineFrame);
aSiblings.AddChild(inlineFrame);
lastNewInline = inlineFrame;
} while (aChildItems.NotEmpty());
SetFrameIsSpecial(lastNewInline, nsnull);
}
void
-nsCSSFrameConstructor::MoveFramesToEndOfIBSplit(nsFrameConstructorState& aState,
- nsIFrame* aExistingEndFrame,
- nsFrameList& aFramesToMove,
- nsFrameConstructorState* aTargetState)
-{
- NS_PRECONDITION(aExistingEndFrame, "Must have trailing inline");
- NS_PRECONDITION(aFramesToMove.NotEmpty(), "Must have frames to move");
-
- nsIFrame* newFirstChild = aFramesToMove.FirstChild();
- if (aExistingEndFrame->HasView() ||
- newFirstChild->GetParent()->HasView()) {
- // Move the frames into the new view
- nsHTMLContainerFrame::ReparentFrameViewList(aState.mPresContext,
- aFramesToMove,
- newFirstChild->GetParent(),
- aExistingEndFrame);
- }
-
- // Reparent (cheaply) the child frames. Have to grab the frame pointers
- // for MoveChildrenTo now, since aFramesToMove will get cleared when we add
- // the frames to aExistingEndFrame. We already have newFirstChild.
- nsIFrame* existingFirstChild = aExistingEndFrame->GetFirstChild(nsnull);
- if (!existingFirstChild &&
- (aExistingEndFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
- aExistingEndFrame->SetInitialChildList(nsnull, aFramesToMove);
- } else {
- aExistingEndFrame->InsertFrames(nsnull, nsnull, aFramesToMove);
- }
- nsFrameConstructorState* startState = aTargetState ? &aState : nsnull;
- MoveChildrenTo(aState.mFrameManager, aExistingEndFrame, newFirstChild,
- existingFirstChild, aTargetState, startState);
-}
-
-void
nsCSSFrameConstructor::BuildInlineChildItems(nsFrameConstructorState& aState,
FrameConstructionItem& aParentItem)
{
// XXXbz should we preallocate aParentItem.mChildItems to some sane
// length? Maybe even to parentContent->GetChildCount()?
// Probe for generated content before
nsStyleContext* const parentStyleContext = aParentItem.mStyleContext;
--- a/layout/base/nsCSSFrameConstructor.h
+++ b/layout/base/nsCSSFrameConstructor.h
@@ -1472,32 +1472,16 @@ private:
*/
void CreateIBSiblings(nsFrameConstructorState& aState,
nsIFrame* aInitialInline,
PRBool aIsPositioned,
nsFrameItems& aChildItems,
nsFrameItems& aSiblings);
/**
- * Move an already-constructed framelist into the inline frame at
- * the tail end of an {ib} split.
- *
- * @param aState the frame construction state we're using right now.
- * @param aExistingEndFrame the already-existing end frame.
- * @param aFramesToMove The frame list to move over. Must be nonempty.
- * @param aTargetState if non-null, the target state to pass to
- * MoveChildrenTo for float reparenting.
- * XXXbz test float reparenting?
- */
- void MoveFramesToEndOfIBSplit(nsFrameConstructorState& aState,
- nsIFrame* aExistingEndFrame,
- nsFrameList& aFramesToMove,
- nsFrameConstructorState* aTargetState);
-
- /**
* For an inline aParentItem, construct its list of child
* FrameConstructionItems and set its mIsAllInline flag appropriately.
*/
void BuildInlineChildItems(nsFrameConstructorState& aState,
FrameConstructionItem& aParentItem);
// Determine whether we need to wipe out what we just did and start over
// because we're doing something like adding block kids to an inline frame