Bugzilla
Quick Search
Browse
Advanced Search
Reports
Quick Search Help
Documentation
New Account
Log In
Login with GitHub
Remember
Forgot Password
Mozilla Home
Privacy
Cookies
Legal
Attachment 501045 Details for
Bug 594771
[patch]
patch for described problem
o (text/plain), 4.48 KB, created by
Alon Zakai (:azakai)
(
hide
)
Description:
patch for described problem
Filename:
MIME Type:
Creator:
Alon Zakai (:azakai)
Size:
4.48 KB
patch
obsolete
>diff --git a/content/base/src/nsImageLoadingContent.cpp b/content/base/src/nsImageLoadingContent.cpp >--- a/content/base/src/nsImageLoadingContent.cpp >+++ b/content/base/src/nsImageLoadingContent.cpp >@@ -782,21 +782,23 @@ nsImageLoadingContent::UpdateImageState( > mozAutoDocUpdate upd(doc, UPDATE_CONTENT_STATE, PR_TRUE); > doc->ContentStatesChanged(thisContent, nsnull, changedBits); > } > } > } > } > > void >-nsImageLoadingContent::CancelImageRequests(PRBool aNotify) >+nsImageLoadingContent::CancelImageRequests(PRBool aPending, PRBool aCurrent, PRBool aNotify) > { > AutoStateChanger changer(this, aNotify); >- ClearPendingRequest(NS_BINDING_ABORTED); >- ClearCurrentRequest(NS_BINDING_ABORTED); >+ if (aPending) >+ ClearPendingRequest(NS_BINDING_ABORTED); >+ if (aCurrent) >+ ClearCurrentRequest(NS_BINDING_ABORTED); > } > > nsresult > nsImageLoadingContent::UseAsPrimaryRequest(imgIRequest* aRequest, > PRBool aNotify) > { > // Our state will change. Watch it. > AutoStateChanger changer(this, aNotify); >diff --git a/content/base/src/nsImageLoadingContent.h b/content/base/src/nsImageLoadingContent.h >--- a/content/base/src/nsImageLoadingContent.h >+++ b/content/base/src/nsImageLoadingContent.h >@@ -121,22 +121,25 @@ protected: > * helper to get the document for this content (from the nodeinfo > * and such). Not named GetDocument to prevent ambiguous method > * names in subclasses > * > * @return the document we belong to > */ > nsIDocument* GetOurDocument(); > >+ void CancelImageRequests(PRBool aPending, PRBool aCurrent, PRBool aNotify); >+ > /** > * CancelImageRequests is called by subclasses when they want to > * cancel all image requests (for example when the subclass is > * somehow not an image anymore). > */ >- void CancelImageRequests(PRBool aNotify); >+ void CancelImageRequests(PRBool aNotify) >+ { CancelImageRequests(PR_TRUE, PR_TRUE, aNotify); } > > /** > * UseAsPrimaryRequest is called by subclasses when they have an existing > * imgIRequest that they want this nsImageLoadingContent to use. This may > * effectively be called instead of LoadImage or LoadImageWithChannel. > * If aNotify is true, this method will notify on state changes. > */ > nsresult UseAsPrimaryRequest(imgIRequest* aRequest, PRBool aNotify); >diff --git a/content/html/content/src/nsHTMLImageElement.cpp b/content/html/content/src/nsHTMLImageElement.cpp >--- a/content/html/content/src/nsHTMLImageElement.cpp >+++ b/content/html/content/src/nsHTMLImageElement.cpp >@@ -505,36 +505,35 @@ nsHTMLImageElement::SetAttr(PRInt32 aNam > > // If caller is not chrome and dom.disable_image_src_set is true, > // prevent setting image.src by exiting early > if (nsContentUtils::GetBoolPref("dom.disable_image_src_set") && > !nsContentUtils::IsCallerChrome()) { > return NS_OK; > } > >- nsCOMPtr<imgIRequest> oldCurrentRequest = mCurrentRequest; >+ // If the current request has the same image as us, then changing .src on >+ // it should restart the animation, see bug 594771. To allow that to >+ // happen, we cancel the current request, which we are about to replace >+ // anyhow with the same image. >+ if (mCurrentRequest) { >+ nsCOMPtr<nsIURI> uri; >+ mCurrentRequest->GetURI(getter_AddRefs(uri)); >+ nsCString spec; >+ uri->GetSpec(spec); >+ if (spec == NS_ConvertUTF16toUTF8(aValue)) >+ CancelImageRequests(PR_FALSE, PR_TRUE, PR_TRUE); >+ } > > // Force image loading here, so that we'll try to load the image from > // network if it's set to be not cacheable... If we change things so that > // the state gets in nsGenericElement's attr-setting happen around this > // LoadImage call, we could start passing PR_FALSE instead of aNotify > // here. > LoadImage(aValue, PR_TRUE, aNotify); >- >- if (mCurrentRequest && !mPendingRequest && >- oldCurrentRequest != mCurrentRequest) { >- // We have a current request, and it's not the same one as we used >- // to have, and we have no pending request. So imglib already had >- // that image. Reset the animation on it -- see bug 210001 >- nsCOMPtr<imgIContainer> container; >- mCurrentRequest->GetImage(getter_AddRefs(container)); >- if (container) { >- container->ResetAnimation(); >- } >- } > } > > return nsGenericHTMLElement::SetAttr(aNameSpaceID, aName, aPrefix, aValue, > aNotify); > } > > nsresult > nsHTMLImageElement::UnsetAttr(PRInt32 aNameSpaceID, nsIAtom* aAttribute,
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
|
Review
Attachments on
bug 594771
:
489837
|
494068
|
501045
|
501422
|
503241
|
503916
|
503970
|
504791
|
507011