Changed ContentRemoved() to also generate a reflow command for the placeholder

for an absolutely positioned frame. Also made sure the child list name is
properly set for the reflow command for the absolutely positioned frame


git-svn-id: svn://10.0.0.236/trunk@17303 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
troy%netscape.com
1999-01-07 05:03:53 +00:00
parent 0e2a9c299a
commit f1e9e67f66
3 changed files with 150 additions and 39 deletions

View File

@@ -2571,21 +2571,58 @@ HTMLStyleSheetImpl::ContentRemoved(nsIPresContext* aPresContext,
shell->GetPrimaryFrameFor(aChild, childFrame);
if (nsnull != childFrame) {
// Get the parent frame.
// Note that we use the content parent, and not the geometric parent,
// in case the frame has been moved out of the flow...
nsIFrame* parentFrame;
childFrame->GetContentParent(parentFrame);
NS_ASSERTION(nsnull != parentFrame, "null content parent frame");
// See if it's absolutely positioned
const nsStylePosition* position;
childFrame->GetStyleData(eStyleStruct_Position, (const nsStyleStruct*&)position);
if (NS_STYLE_POSITION_ABSOLUTE == position->mPosition) {
// Generate two reflow commands. First for the absolutely positioned
// frame and then for its placeholder frame
nsIFrame* parentFrame;
childFrame->GetGeometricParent(parentFrame);
// Notify the parent frame with a reflow command.
nsIReflowCommand* reflowCmd;
rv = NS_NewHTMLReflowCommand(&reflowCmd, parentFrame,
nsIReflowCommand::FrameRemoved, childFrame);
if (NS_SUCCEEDED(rv)) {
reflowCmd->SetChildListName(nsLayoutAtoms::absoluteList);
shell->AppendReflowCommand(reflowCmd);
NS_RELEASE(reflowCmd);
}
// Notify the parent frame with a reflow command.
nsIReflowCommand* reflowCmd;
rv = NS_NewHTMLReflowCommand(&reflowCmd, parentFrame,
nsIReflowCommand::FrameRemoved, childFrame);
// Now the placeholder frame
nsIFrame* placeholderFrame;
if (NS_SUCCEEDED(rv)) {
shell->AppendReflowCommand(reflowCmd);
NS_RELEASE(reflowCmd);
shell->GetPlaceholderFrameFor(childFrame, placeholderFrame);
if (nsnull != placeholderFrame) {
placeholderFrame->GetGeometricParent(parentFrame);
rv = NS_NewHTMLReflowCommand(&reflowCmd, parentFrame,
nsIReflowCommand::FrameRemoved, placeholderFrame);
if (NS_SUCCEEDED(rv)) {
shell->AppendReflowCommand(reflowCmd);
NS_RELEASE(reflowCmd);
}
}
} else {
// Get the parent frame.
// Note that we use the content parent, and not the geometric parent,
// in case the frame has been moved out of the flow...
nsIFrame* parentFrame;
childFrame->GetContentParent(parentFrame);
NS_ASSERTION(nsnull != parentFrame, "null content parent frame");
// Notify the parent frame with a reflow command.
nsIReflowCommand* reflowCmd;
rv = NS_NewHTMLReflowCommand(&reflowCmd, parentFrame,
nsIReflowCommand::FrameRemoved, childFrame);
if (NS_SUCCEEDED(rv)) {
shell->AppendReflowCommand(reflowCmd);
NS_RELEASE(reflowCmd);
}
}
}