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:
parent
3ed66bbb59
commit
965b435ac9
@ -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)
|
||||
|
||||
@ -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) {
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user