зеркало из https://github.com/mozilla/gecko-dev.git
Bug 501847 part 5. Get rid of the MoveFrames function now that there is only one caller. r=tn,roc
This commit is contained in:
Родитель
2ba57b5fb5
Коммит
c060c98048
|
@ -10899,7 +10899,21 @@ nsCSSFrameConstructor::CreateIBSiblings(nsFrameConstructorState& aState,
|
|||
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);
|
||||
|
@ -10910,40 +10924,6 @@ nsCSSFrameConstructor::CreateIBSiblings(nsFrameConstructorState& aState,
|
|||
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)
|
||||
|
|
|
@ -1476,22 +1476,6 @@ private:
|
|||
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.
|
||||
|
|
Загрузка…
Ссылка в новой задаче