зеркало из https://github.com/mozilla/pjs.git
Only resize to (0,0) when we know we have no new image. Bug 270517, r+sr=dbaron
This commit is contained in:
Родитель
b7cf0124a5
Коммит
2438b1f0de
|
@ -332,7 +332,6 @@ nsImageBoxFrame::UpdateImage()
|
|||
if (mImageRequest) {
|
||||
mImageRequest->Cancel(NS_ERROR_FAILURE);
|
||||
mImageRequest = nsnull;
|
||||
mIntrinsicSize.SizeTo(0, 0);
|
||||
}
|
||||
|
||||
// get the new image src
|
||||
|
@ -370,6 +369,11 @@ nsImageBoxFrame::UpdateImage()
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!mImageRequest) {
|
||||
// We have no image, so size to 0
|
||||
mIntrinsicSize.SizeTo(0, 0);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -610,11 +614,19 @@ NS_IMETHODIMP nsImageBoxFrame::OnStopDecode(imgIRequest *request,
|
|||
nsresult aStatus,
|
||||
const PRUnichar *statusArg)
|
||||
{
|
||||
// XXXbz this is firing DOM events possibly from inside style resolution!
|
||||
// See the nsImageLoadingContent code for how this should be done
|
||||
// asynchronously.
|
||||
if (NS_SUCCEEDED(aStatus))
|
||||
// Fire an onerror DOM event.
|
||||
// Fire an onload DOM event.
|
||||
FireDOMEvent(mContent, NS_IMAGE_LOAD);
|
||||
else // Fire an onload DOM event.
|
||||
else {
|
||||
// Fire an onerror DOM event.
|
||||
mIntrinsicSize.SizeTo(0, 0);
|
||||
nsBoxLayoutState state(GetPresContext());
|
||||
MarkDirty(state);
|
||||
FireDOMEvent(mContent, NS_IMAGE_ERROR);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче