diff --git a/mozilla/content/base/public/nsIImageLoadingContent.idl b/mozilla/content/base/public/nsIImageLoadingContent.idl index f14d40e6b66..d91325d3015 100644 --- a/mozilla/content/base/public/nsIImageLoadingContent.idl +++ b/mozilla/content/base/public/nsIImageLoadingContent.idl @@ -64,7 +64,7 @@ interface nsIURI; * sufficient, when combined with the imageBlockingStatus information.) */ -[scriptable, uuid(49b02654-5f96-48a0-bf99-0fe467a3fa52)] +[scriptable, uuid(7744c6d3-5c60-4b7b-a526-4fe9d5ac7e97)] interface nsIImageLoadingContent : imgIDecoderObserver { /** @@ -160,4 +160,11 @@ interface nsIImageLoadingContent : imgIDecoderObserver * @throws NS_ERROR_NULL_POINTER if aChannel is null */ nsIStreamListener loadImageWithChannel(in nsIChannel aChannel); + + /** + * forceReload forces reloading of the image pointed to by currentURI + * + * @throws NS_ERROR_NOT_AVAILABLE if there is no current URI to reload + */ + void forceReload(); }; diff --git a/mozilla/content/base/src/nsImageLoadingContent.cpp b/mozilla/content/base/src/nsImageLoadingContent.cpp index e709a3a7f1a..f4351f9460d 100644 --- a/mozilla/content/base/src/nsImageLoadingContent.cpp +++ b/mozilla/content/base/src/nsImageLoadingContent.cpp @@ -475,6 +475,17 @@ nsImageLoadingContent::LoadImageWithChannel(nsIChannel* aChannel, return rv; } +NS_IMETHODIMP nsImageLoadingContent::ForceReload() +{ + nsCOMPtr currentURI; + GetCurrentURI(getter_AddRefs(currentURI)); + if (!currentURI) { + return NS_ERROR_NOT_AVAILABLE; + } + + return LoadImage(currentURI, PR_TRUE, PR_TRUE, nsnull, nsIRequest::VALIDATE_ALWAYS); +} + /* * Non-interface methods */ @@ -505,7 +516,8 @@ nsresult nsImageLoadingContent::LoadImage(nsIURI* aNewURI, PRBool aForce, PRBool aNotify, - nsIDocument* aDocument) + nsIDocument* aDocument, + nsLoadFlags aLoadFlags) { if (!mLoadingEnabled) { FireEvent(NS_LITERAL_STRING("error")); @@ -583,7 +595,7 @@ nsImageLoadingContent::LoadImage(nsIURI* aNewURI, rv = nsContentUtils::LoadImage(aNewURI, aDocument, aDocument->GetDocumentURI(), - this, nsIRequest::LOAD_NORMAL, + this, aLoadFlags, getter_AddRefs(req)); if (NS_FAILED(rv)) { FireEvent(NS_LITERAL_STRING("error")); diff --git a/mozilla/content/base/src/nsImageLoadingContent.h b/mozilla/content/base/src/nsImageLoadingContent.h index 232267e0bc8..2c595aa77cb 100644 --- a/mozilla/content/base/src/nsImageLoadingContent.h +++ b/mozilla/content/base/src/nsImageLoadingContent.h @@ -108,9 +108,12 @@ protected: * will be sent as needed. * @param aDocument Optional parameter giving the document this node is in. * This is purely a performance optimization. + * @param aLoadFlags Optional parameter specifying load flags to use for + * the image load */ nsresult LoadImage(nsIURI* aNewURI, PRBool aForce, PRBool aNotify, - nsIDocument* aDocument = nsnull); + nsIDocument* aDocument = nsnull, + nsLoadFlags aLoadFlags = nsIRequest::LOAD_NORMAL); /** * helper to get the document for this content (from the nodeinfo diff --git a/mozilla/suite/common/contentAreaContextOverlay.xul b/mozilla/suite/common/contentAreaContextOverlay.xul index 2087783c6d6..67f9f0253ce 100644 --- a/mozilla/suite/common/contentAreaContextOverlay.xul +++ b/mozilla/suite/common/contentAreaContextOverlay.xul @@ -105,6 +105,10 @@ label="&fitImageCmd.label;" accesskey="&fitImageCmd.accesskey;" oncommand="gContextMenu.toggleImageSize();"/> + + + diff --git a/mozilla/xpfe/communicator/resources/content/contentAreaContextOverlay.xul b/mozilla/xpfe/communicator/resources/content/contentAreaContextOverlay.xul index 0408618b7e8..f659837772f 100644 --- a/mozilla/xpfe/communicator/resources/content/contentAreaContextOverlay.xul +++ b/mozilla/xpfe/communicator/resources/content/contentAreaContextOverlay.xul @@ -105,6 +105,10 @@ label="&fitImageCmd.label;" accesskey="&fitImageCmd.accesskey;" oncommand="gContextMenu.toggleImageSize();"/> +