nsIFrame*     parentFrame = GetFrameFor(shell, aContainer);
nsIFrame*     parentFrame = GetFrameFor(shell, aPresContext, aContainer);
HTMLStyleSheetImpl::ContentAppended(nsIPresContext* aPresContext,                                    nsIContent*     aContainer,                                    PRInt32         aNewIndexInContainer){  nsIPresShell* shell = aPresContext->GetShell();  nsIFrame*     parentFrame = GetFrameFor(shell, aContainer);#ifdef NS_DEBUG  if (nsnull == parentFrame) {    NS_WARNING("Ignoring content-appended notification with no matching frame...");  }#endif  if (nsnull != parentFrame) {    // Get the parent frame's last-in-flow    nsIFrame* nextInFlow = parentFrame;    while (nsnull != nextInFlow) {      parentFrame->GetNextInFlow(nextInFlow);      if (nsnull != nextInFlow) {        parentFrame = nextInFlow;      }    }    // Create some new frames    PRInt32   count;    nsIFrame* lastChildFrame = nsnull;    nsIFrame* firstAppendedFrame = nsnull;    aContainer->ChildCount(count);    for (PRInt32 i = aNewIndexInContainer; i < count; i++) {      nsIContent* child;      nsIFrame*   frame;      aContainer->ChildAt(i, child);      ConstructFrame(aPresContext, child, parentFrame, frame);      if (nsnull != frame) {        // Link the frame into the child frame list        if (nsnull == lastChildFrame) {          firstAppendedFrame = frame;        } else {          lastChildFrame->SetNextSibling(frame);        }        lastChildFrame = frame;      }      NS_RELEASE(child);    }    // Adjust parent frame for table inner/outer frame    // we need to do this here because we need both the parent frame and the constructed frame    nsresult result = NS_OK;    nsIFrame *adjustedParentFrame=parentFrame;    if (nsnull!=firstAppendedFrame)    {      const nsStyleDisplay* firstAppendedFrameDisplay;      firstAppendedFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct *&)firstAppendedFrameDisplay);      result = GetAdjustedParentFrame(parentFrame, firstAppendedFrameDisplay->mDisplay, adjustedParentFrame);    }    // Notify the parent frame with a reflow command, passing it the list of    // new frames.    if (NS_SUCCEEDED(result)) {      nsIReflowCommand* reflowCmd;      result = NS_NewHTMLReflowCommand(&reflowCmd, adjustedParentFrame,                                       nsIReflowCommand::FrameAppended,                                       firstAppendedFrame);      if (NS_SUCCEEDED(result)) {        shell->AppendReflowCommand(reflowCmd);        NS_RELEASE(reflowCmd);      }    }  }  NS_RELEASE(shell);  return NS_OK;}