Fix for bug #5762. Changed DeleteFrame() to call CancelReflowCommand()
when a frame is destroyed git-svn-id: svn://10.0.0.236/trunk@36833 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
parent
7c478d64e4
commit
ee7e3babb8
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user