Make sure that non-image inputs don't claim to have a useful image via

nsIImageLoadingContent. Bug 301635, r=biesi, sr=jst, a=cbeard


git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_8_BRANCH@178266 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
bzbarsky%mit.edu
2005-08-19 17:42:25 +00:00
parent b5605fe9cc
commit 17546ed4ae
3 changed files with 25 additions and 0 deletions

View File

@@ -375,6 +375,9 @@ nsImageLoadingContent::LoadImageWithChannel(nsIChannel* aChannel,
// Don't bother
return NS_OK;
}
// Null out our mCurrentURI, in case we have no image requests right now.
mCurrentURI = nsnull;
CancelImageRequests(NS_ERROR_IMAGE_SRC_CHANGED, PR_FALSE,
nsIContentPolicy::ACCEPT);
@@ -520,6 +523,14 @@ nsImageLoadingContent::ImageURIChanged(const nsAString& aNewURI,
return NS_OK;
}
void
nsImageLoadingContent::CancelImageRequests()
{
// Make sure to null out mCurrentURI here, so we no longer look like an image
mCurrentURI = nsnull;
CancelImageRequests(NS_BINDING_ABORTED, PR_TRUE, nsIContentPolicy::ACCEPT);
}
void
nsImageLoadingContent::CancelImageRequests(nsresult aReason,
PRBool aEvenIfSizeAvailable,