204386 r+sr=bz Allow setting Image.src to empty

git-svn-id: svn://10.0.0.236/trunk@142905 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cbiesinger%web.de 2003-05-25 20:43:08 +00:00
parent 3ed66bbb59
commit 965b435ac9
3 changed files with 6 additions and 9 deletions

View File

@ -381,13 +381,6 @@ nsImageLoadingContent::ImageURIChanged(const nsACString& aNewURI)
return NS_OK;
}
if (aNewURI.IsEmpty()) {
// Do not take down the already loaded image... (for compat with
// the old code that loaded images from frames)
// XXXbz is this what we really want?
return NS_OK;
}
nsresult rv; // XXXbz Should failures in this method fire onerror?
// First, get a document (needed for security checks, base URI and the like)

View File

@ -659,13 +659,15 @@ nsImageFrame::OnStopDecode(imgIRequest *aRequest,
if (loadType == nsIImageLoadingContent::PENDING_REQUEST) {
// May have to switch sizes here!
PRBool intrinsicSizeChanged = PR_FALSE;
PRBool intrinsicSizeChanged = PR_TRUE;
if (NS_SUCCEEDED(aStatus)) {
nsCOMPtr<imgIContainer> imageContainer;
aRequest->GetImage(getter_AddRefs(imageContainer));
NS_ASSERTION(imageContainer, "Successful load with no container?");
intrinsicSizeChanged = RecalculateTransform(imageContainer);
}
else
mIntrinsicSize.SizeTo(0, 0);
if (mState & IMAGE_GOTINITIALREFLOW) { // do nothing if we havn't gotten the inital reflow yet
if (!(mState & IMAGE_SIZECONSTRAINED) && intrinsicSizeChanged) {

View File

@ -659,13 +659,15 @@ nsImageFrame::OnStopDecode(imgIRequest *aRequest,
if (loadType == nsIImageLoadingContent::PENDING_REQUEST) {
// May have to switch sizes here!
PRBool intrinsicSizeChanged = PR_FALSE;
PRBool intrinsicSizeChanged = PR_TRUE;
if (NS_SUCCEEDED(aStatus)) {
nsCOMPtr<imgIContainer> imageContainer;
aRequest->GetImage(getter_AddRefs(imageContainer));
NS_ASSERTION(imageContainer, "Successful load with no container?");
intrinsicSizeChanged = RecalculateTransform(imageContainer);
}
else
mIntrinsicSize.SizeTo(0, 0);
if (mState & IMAGE_GOTINITIALREFLOW) { // do nothing if we havn't gotten the inital reflow yet
if (!(mState & IMAGE_SIZECONSTRAINED) && intrinsicSizeChanged) {