patch for bug 148199 - Images that are "broken" during document editing

don't redisplay using broken image icon.
added a request proxy removal from the mLoads to get the broken icon
when paint.
r=glazman, sr=waterson
This commit is contained in:
alexsavulov%netscape.com 2002-06-18 21:28:53 +00:00
Родитель ebf82f388b
Коммит 2b78156b17
2 изменённых файлов: 44 добавлений и 36 удалений

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

@ -619,26 +619,30 @@ NS_IMETHODIMP nsImageFrame::OnStopDecode(imgIRequest *aRequest, nsIPresContext *
mLoads[1].mRequest = nsnull;
if (!mSizeConstrained && (mLoads[0].mIntrinsicSize != mIntrinsicSize)) {
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
NS_ASSERTION(mParent, "No parent to pass the reflow request up to.");
NS_ASSERTION(presShell, "No PresShell.");
if (mParent && presShell && mGotInitialReflow) { // don't reflow if we havn't gotten the inital reflow yet
mState |= NS_FRAME_IS_DIRTY;
mParent->ReflowDirtyChild(presShell, NS_STATIC_CAST(nsIFrame*, this));
}
} else {
nsSize s;
GetSize(s);
nsRect r(0,0, s.width, s.height);
if (!r.IsEmpty()) {
Invalidate(aPresContext, r, PR_FALSE);
}
}
} else {
// load failed, we need to reset mLoads[0] to get an broken icon
// since the src attribute changed
mLoads[0].mRequest = nsnull;
mLoads[1].mRequest = nsnull;
imageFailedToLoad = PR_TRUE;
}
if (!mSizeConstrained && (mLoads[0].mIntrinsicSize != mIntrinsicSize)) {
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
NS_ASSERTION(mParent, "No parent to pass the reflow request up to.");
NS_ASSERTION(presShell, "No PresShell.");
if (mParent && presShell && mGotInitialReflow) { // don't reflow if we havn't gotten the inital reflow yet
mState |= NS_FRAME_IS_DIRTY;
mParent->ReflowDirtyChild(presShell, NS_STATIC_CAST(nsIFrame*, this));
}
} else {
nsSize s;
GetSize(s);
nsRect r(0,0, s.width, s.height);
if (!r.IsEmpty()) {
Invalidate(aPresContext, r, PR_FALSE);
}
}
} else if (NS_FAILED(aStatus)) {

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

@ -619,26 +619,30 @@ NS_IMETHODIMP nsImageFrame::OnStopDecode(imgIRequest *aRequest, nsIPresContext *
mLoads[1].mRequest = nsnull;
if (!mSizeConstrained && (mLoads[0].mIntrinsicSize != mIntrinsicSize)) {
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
NS_ASSERTION(mParent, "No parent to pass the reflow request up to.");
NS_ASSERTION(presShell, "No PresShell.");
if (mParent && presShell && mGotInitialReflow) { // don't reflow if we havn't gotten the inital reflow yet
mState |= NS_FRAME_IS_DIRTY;
mParent->ReflowDirtyChild(presShell, NS_STATIC_CAST(nsIFrame*, this));
}
} else {
nsSize s;
GetSize(s);
nsRect r(0,0, s.width, s.height);
if (!r.IsEmpty()) {
Invalidate(aPresContext, r, PR_FALSE);
}
}
} else {
// load failed, we need to reset mLoads[0] to get an broken icon
// since the src attribute changed
mLoads[0].mRequest = nsnull;
mLoads[1].mRequest = nsnull;
imageFailedToLoad = PR_TRUE;
}
if (!mSizeConstrained && (mLoads[0].mIntrinsicSize != mIntrinsicSize)) {
nsCOMPtr<nsIPresShell> presShell;
aPresContext->GetShell(getter_AddRefs(presShell));
NS_ASSERTION(mParent, "No parent to pass the reflow request up to.");
NS_ASSERTION(presShell, "No PresShell.");
if (mParent && presShell && mGotInitialReflow) { // don't reflow if we havn't gotten the inital reflow yet
mState |= NS_FRAME_IS_DIRTY;
mParent->ReflowDirtyChild(presShell, NS_STATIC_CAST(nsIFrame*, this));
}
} else {
nsSize s;
GetSize(s);
nsRect r(0,0, s.width, s.height);
if (!r.IsEmpty()) {
Invalidate(aPresContext, r, PR_FALSE);
}
}
} else if (NS_FAILED(aStatus)) {