Fix for bug #12449. Changed UpdateImageFrame() so that if the content object

has a NULL document object (the case for generated content) we mark the image
frame dirty and generate a reflow command targeted at the parent frame
This commit is contained in:
troy%netscape.com 1999-08-25 23:55:57 +00:00
Родитель 19ccc6552b
Коммит 4ba0f18641
2 изменённых файлов: 38 добавлений и 0 удалений

Просмотреть файл

@ -186,6 +186,25 @@ nsImageFrame::UpdateImage(nsIPresContext* aPresContext, PRUint32 aStatus)
if (nsnull != document) {
document->ContentChanged(mContent, nsnull);
NS_RELEASE(document);
} else {
// The content object isn't associated with a document. That probably
// means it's generated content. Mark ourselves dirty and generate a
// reflow command targeted at our parent frame
nsIReflowCommand* reflowCmd;
nsresult rv;
mState |= NS_FRAME_IS_DIRTY;
rv = NS_NewHTMLReflowCommand(&reflowCmd, mParent,
nsIReflowCommand::ReflowDirty);
if (NS_SUCCEEDED(rv)) {
nsIPresShell* presShell;
// Add the reflow command
aPresContext->GetShell(&presShell);
presShell->AppendReflowCommand(reflowCmd);
NS_RELEASE(reflowCmd);
NS_RELEASE(presShell);
}
}
}
}

Просмотреть файл

@ -186,6 +186,25 @@ nsImageFrame::UpdateImage(nsIPresContext* aPresContext, PRUint32 aStatus)
if (nsnull != document) {
document->ContentChanged(mContent, nsnull);
NS_RELEASE(document);
} else {
// The content object isn't associated with a document. That probably
// means it's generated content. Mark ourselves dirty and generate a
// reflow command targeted at our parent frame
nsIReflowCommand* reflowCmd;
nsresult rv;
mState |= NS_FRAME_IS_DIRTY;
rv = NS_NewHTMLReflowCommand(&reflowCmd, mParent,
nsIReflowCommand::ReflowDirty);
if (NS_SUCCEEDED(rv)) {
nsIPresShell* presShell;
// Add the reflow command
aPresContext->GetShell(&presShell);
presShell->AppendReflowCommand(reflowCmd);
NS_RELEASE(reflowCmd);
NS_RELEASE(presShell);
}
}
}
}