if (IsBlockFrame(aFrame)) {
if (aFrame->IsFloatContainingBlock()) {
AdjustFloatParentPtrs(nsIFrame*                aFrame,                      nsFrameConstructorState& aState){  nsIFrame *outOfFlowFrame = GetRealFrame(aFrame);  if (outOfFlowFrame && outOfFlowFrame != aFrame) {    // Get the display data for the outOfFlowFrame so we can    // figure out if it is a float.    if (outOfFlowFrame->GetStyleDisplay()->IsFloating()) {      // Update the parent pointer for outOfFlowFrame if it's      // containing block has changed as the result of reparenting,            nsIFrame *parent = aState.mFloatedItems.containingBlock;      outOfFlowFrame->SetParent(parent);      if (outOfFlowFrame->GetStateBits() &          (NS_FRAME_HAS_VIEW | NS_FRAME_HAS_CHILD_WITH_VIEW)) {        // We don't need to walk up the tree, since each level of        // recursion of the SplitToContainingBlock will propagate the        // bit.        parent->AddStateBits(NS_FRAME_HAS_CHILD_WITH_VIEW);      }    }    // All out-of-flows are automatically float containing blocks, so we're    // done here    return;  }  // XXXbz we really want IsFloatContainingBlock() here!  if (IsBlockFrame(aFrame)) {    // No need to recurse further; floats whose placeholders are    // inside a block already have the right parent.    return;  }  // Dive down into children to see if any of their  // placeholders need adjusting.  nsIFrame *childFrame = aFrame->GetFirstChild(nsnull);  while (childFrame)  {    // XXX_kin: Do we need to prevent descent into anonymous content here?    AdjustFloatParentPtrs(childFrame, aState);    childFrame = childFrame->GetNextSibling();  }}