aChild->AddStateBits(NS_FRAME_OUT_OF_FLOW); nsFrameItems::AddChild(aChild);
PRBool needPlaceholder = PR_FALSE; nsFrameItems* frameItems = &aFrameItems; if (aCanBeFloated && aStyleDisplay->IsFloating() && mFloatedItems.containingBlock) { NS_ASSERTION(aNewFrame->GetParent() == mFloatedItems.containingBlock, "Float whose parent is not the float containing block?"); needPlaceholder = PR_TRUE; frameItems = &mFloatedItems; } else if (aCanBePositioned) { if (aStyleDisplay->mPosition == NS_STYLE_POSITION_ABSOLUTE && mAbsoluteItems.containingBlock) { NS_ASSERTION(aNewFrame->GetParent() == mAbsoluteItems.containingBlock, "Abs pos whose parent is not the abs pos containing block?"); needPlaceholder = PR_TRUE; frameItems = &mAbsoluteItems; } if (aStyleDisplay->mPosition == NS_STYLE_POSITION_FIXED && mFixedItems.containingBlock) { NS_ASSERTION(aNewFrame->GetParent() == mFixedItems.containingBlock, "Fixed pos whose parent is not the fixed pos containing block?"); needPlaceholder = PR_TRUE; frameItems = &mFixedItems; } }  if (needPlaceholder) { NS_ASSERTION(frameItems != &aFrameItems, "Putting frame in-flow _and_ want a placeholder?"); nsIFrame* placeholderFrame; nsresult rv = nsCSSFrameConstructor::CreatePlaceholderFrameFor(mPresShell, mPresContext, mFrameManager, aContent, aNewFrame, aStyleContext, aParentFrame, &placeholderFrame); if (NS_FAILED(rv)) {     CleanupFrameReferences(mPresContext, mFrameManager, aNewFrame); aNewFrame->Destroy(mPresContext); return rv; }   aFrameItems.AddChild(placeholderFrame); } #ifdef DEBUG else { NS_ASSERTION(aNewFrame->GetParent() == aParentFrame, "In-flow frame has wrong parent"); } #endif  frameItems->AddChild(aNewFrame);   nsIFrame* specialSibling = aNewFrame; while (specialSibling && IsFrameSpecial(specialSibling)) { GetSpecialSibling(mFrameManager, specialSibling, &specialSibling); if (specialSibling) { NS_ASSERTION(frameItems == &aFrameItems, "IB split ending up in an out-of-flow childlist?"); frameItems->AddChild(specialSibling); } }  return NS_OK;
nsAbsoluteItems::AddChild(nsIFrame* aChild){  aChild->AddStateBits(NS_FRAME_OUT_OF_FLOW);  nsFrameItems::AddChild(aChild);}