Fix for bug #5762. Changed DeleteFrame() to call CancelReflowCommand()

when a frame is destroyed
This commit is contained in:
troy%netscape.com 1999-06-25 04:22:15 +00:00
parent d2a9464cab
commit 72d8261683
4 changed files with 22 additions and 10 deletions

View File

@ -371,11 +371,19 @@ nsFrame::RemoveFrame(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsFrame::DeleteFrame(nsIPresContext& aPresContext)
{
nsCOMPtr<nsIPresShell> shell;
aPresContext.GetShell(getter_AddRefs(shell));
// XXX Rather than always do this it would be better if it was part of
// a frame observer mechanism and the pres shell could register as an
// observer of the frame while the reflow command is pending...
if (shell) {
shell->CancelReflowCommand(this);
}
if ((mState & NS_FRAME_EXTERNAL_REFERENCE) ||
(mState & NS_FRAME_SELECTED_CONTENT)) {
nsCOMPtr<nsIPresShell> shell;
nsresult rv = aPresContext.GetShell(getter_AddRefs(shell));
if (NS_SUCCEEDED(rv) && shell) {
if (shell) {
shell->ClearFrameRefs(this);
}
}

View File

@ -167,7 +167,6 @@ nsImageFrame::UpdateImage(nsIPresContext* aPresContext, PRUint32 aStatus)
printf(": UpdateImage: status=%x\n", aStatus);
#endif
if (NS_IMAGE_LOAD_STATUS_ERROR & aStatus) {
#ifdef XXX_troy_is_back_from_sabatical
// We failed to load the image. Notify the pres shell
nsIPresShell* presShell;
aPresContext->GetShell(&presShell);
@ -175,7 +174,6 @@ nsImageFrame::UpdateImage(nsIPresContext* aPresContext, PRUint32 aStatus)
presShell->CantRenderReplacedElement(aPresContext, this);
NS_RELEASE(presShell);
}
#endif
}
else if (NS_IMAGE_LOAD_STATUS_SIZE_AVAILABLE & aStatus) {
// Now that the size is available, trigger a content-changed reflow

View File

@ -371,11 +371,19 @@ nsFrame::RemoveFrame(nsIPresContext& aPresContext,
NS_IMETHODIMP
nsFrame::DeleteFrame(nsIPresContext& aPresContext)
{
nsCOMPtr<nsIPresShell> shell;
aPresContext.GetShell(getter_AddRefs(shell));
// XXX Rather than always do this it would be better if it was part of
// a frame observer mechanism and the pres shell could register as an
// observer of the frame while the reflow command is pending...
if (shell) {
shell->CancelReflowCommand(this);
}
if ((mState & NS_FRAME_EXTERNAL_REFERENCE) ||
(mState & NS_FRAME_SELECTED_CONTENT)) {
nsCOMPtr<nsIPresShell> shell;
nsresult rv = aPresContext.GetShell(getter_AddRefs(shell));
if (NS_SUCCEEDED(rv) && shell) {
if (shell) {
shell->ClearFrameRefs(this);
}
}

View File

@ -167,7 +167,6 @@ nsImageFrame::UpdateImage(nsIPresContext* aPresContext, PRUint32 aStatus)
printf(": UpdateImage: status=%x\n", aStatus);
#endif
if (NS_IMAGE_LOAD_STATUS_ERROR & aStatus) {
#ifdef XXX_troy_is_back_from_sabatical
// We failed to load the image. Notify the pres shell
nsIPresShell* presShell;
aPresContext->GetShell(&presShell);
@ -175,7 +174,6 @@ nsImageFrame::UpdateImage(nsIPresContext* aPresContext, PRUint32 aStatus)
presShell->CantRenderReplacedElement(aPresContext, this);
NS_RELEASE(presShell);
}
#endif
}
else if (NS_IMAGE_LOAD_STATUS_SIZE_AVAILABLE & aStatus) {
// Now that the size is available, trigger a content-changed reflow