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
Родитель d2a9464cab
Коммит 72d8261683
4 изменённых файлов: 22 добавлений и 10 удалений

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

@ -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