diff --git a/content/base/src/nsImageLoadingContent.cpp b/content/base/src/nsImageLoadingContent.cpp index 3a3f3a253e7..bc565bee3ab 100644 --- a/content/base/src/nsImageLoadingContent.cpp +++ b/content/base/src/nsImageLoadingContent.cpp @@ -159,10 +159,11 @@ nsImageLoadingContent::~nsImageLoadingContent() * imgIContainerObserver impl */ NS_IMETHODIMP -nsImageLoadingContent::FrameChanged(imgIContainer* aContainer, +nsImageLoadingContent::FrameChanged(imgIRequest* aRequest, + imgIContainer* aContainer, const nsIntRect* aDirtyRect) { - LOOP_OVER_OBSERVERS(FrameChanged(aContainer, aDirtyRect)); + LOOP_OVER_OBSERVERS(FrameChanged(aRequest, aContainer, aDirtyRect)); return NS_OK; } diff --git a/content/base/src/nsStubImageDecoderObserver.cpp b/content/base/src/nsStubImageDecoderObserver.cpp index 74f8aeea16e..91bac8b3883 100644 --- a/content/base/src/nsStubImageDecoderObserver.cpp +++ b/content/base/src/nsStubImageDecoderObserver.cpp @@ -113,7 +113,8 @@ nsStubImageDecoderObserver::OnImageIsAnimated(imgIRequest *aRequest) } NS_IMETHODIMP -nsStubImageDecoderObserver::FrameChanged(imgIContainer *aContainer, +nsStubImageDecoderObserver::FrameChanged(imgIRequest* aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect) { return NS_OK; diff --git a/content/svg/content/src/nsSVGFilters.cpp b/content/svg/content/src/nsSVGFilters.cpp index 0516dcad245..1b7411fdcd3 100644 --- a/content/svg/content/src/nsSVGFilters.cpp +++ b/content/svg/content/src/nsSVGFilters.cpp @@ -5742,11 +5742,12 @@ nsSVGFEImageElement::OnStopDecode(imgIRequest *aRequest, } NS_IMETHODIMP -nsSVGFEImageElement::FrameChanged(imgIContainer *aContainer, +nsSVGFEImageElement::FrameChanged(imgIRequest* aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect) { nsresult rv = - nsImageLoadingContent::FrameChanged(aContainer, aDirtyRect); + nsImageLoadingContent::FrameChanged(aRequest, aContainer, aDirtyRect); Invalidate(); return rv; } diff --git a/content/svg/content/src/nsSVGFilters.h b/content/svg/content/src/nsSVGFilters.h index c4f9e38cf8f..d72e861530b 100644 --- a/content/svg/content/src/nsSVGFilters.h +++ b/content/svg/content/src/nsSVGFilters.h @@ -298,7 +298,8 @@ public: NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status, const PRUnichar *statusArg); // imgIContainerObserver - NS_IMETHOD FrameChanged(imgIContainer *aContainer, + NS_IMETHOD FrameChanged(imgIRequest* aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect); // imgIContainerObserver NS_IMETHOD OnStartContainer(imgIRequest *aRequest, diff --git a/image/public/imgIContainerObserver.idl b/image/public/imgIContainerObserver.idl index 30f24d750fe..361019e67d5 100644 --- a/image/public/imgIContainerObserver.idl +++ b/image/public/imgIContainerObserver.idl @@ -44,6 +44,7 @@ %} interface imgIContainer; +interface imgIRequest; [ptr] native nsIntRect(nsIntRect); /** @@ -52,9 +53,10 @@ interface imgIContainer; * @author Stuart Parmenter * @version 0.1 */ -[scriptable, uuid(aa2068c1-6b91-4f52-8603-487b14ac5f04)] +[scriptable, uuid(f01efdb3-4b20-4313-a636-a2aa01a4ef5d)] interface imgIContainerObserver : nsISupports { - [noscript] void frameChanged(in imgIContainer aContainer, + [noscript] void frameChanged(in imgIRequest aRequest, + in imgIContainer aContainer, [const] in nsIntRect aDirtyRect); }; diff --git a/image/public/imgIDecoderObserver.idl b/image/public/imgIDecoderObserver.idl index bed7cf6fc41..b7724c2fbca 100644 --- a/image/public/imgIDecoderObserver.idl +++ b/image/public/imgIDecoderObserver.idl @@ -77,7 +77,7 @@ interface imgIContainer; * @version 0.1 * @see imagelib2 */ -[scriptable, uuid(2e5fa0c4-57f8-4d16-bda3-1daeba9caa34)] +[scriptable, uuid(5ca71b89-1a2f-475f-881d-d76c1531c4c8)] interface imgIDecoderObserver : imgIContainerObserver { /** diff --git a/image/src/RasterImage.cpp b/image/src/RasterImage.cpp index beb7b336978..bf33f74bb50 100644 --- a/image/src/RasterImage.cpp +++ b/image/src/RasterImage.cpp @@ -480,7 +480,7 @@ RasterImage::RequestRefresh(const mozilla::TimeStamp& aTime) mFramesNotified++; #endif - observer->FrameChanged(this, &dirtyRect); + observer->FrameChanged(nsnull, this, &dirtyRect); } } @@ -1423,7 +1423,7 @@ RasterImage::ResetAnimation() // Update display if we were animating before nsCOMPtr observer(do_QueryReferent(mObserver)); if (mAnimating && observer) - observer->FrameChanged(this, &(mAnim->firstFrameRefreshArea)); + observer->FrameChanged(nsnull, this, &(mAnim->firstFrameRefreshArea)); if (ShouldAnimate()) { StartAnimation(); diff --git a/image/src/VectorImage.cpp b/image/src/VectorImage.cpp index 181300cb141..611840f7dca 100644 --- a/image/src/VectorImage.cpp +++ b/image/src/VectorImage.cpp @@ -699,7 +699,7 @@ VectorImage::OnStopRequest(nsIRequest* aRequest, nsISupports* aCtxt, // NOTE: This signals that width/height are available. observer->OnStartContainer(nsnull, this); - observer->FrameChanged(this, &nsIntRect::GetMaxSizedIntRect()); + observer->FrameChanged(nsnull, this, &nsIntRect::GetMaxSizedIntRect()); observer->OnStopFrame(nsnull, 0); observer->OnStopDecode(nsnull, NS_OK, nsnull); } @@ -738,7 +738,7 @@ VectorImage::InvalidateObserver() nsCOMPtr containerObs(do_QueryReferent(mObserver)); if (containerObs) { - containerObs->FrameChanged(this, &nsIntRect::GetMaxSizedIntRect()); + containerObs->FrameChanged(nsnull, this, &nsIntRect::GetMaxSizedIntRect()); } nsCOMPtr decoderObs(do_QueryReferent(mObserver)); diff --git a/image/src/imgRequest.cpp b/image/src/imgRequest.cpp index 3b0ee404f9d..ac84fc90688 100644 --- a/image/src/imgRequest.cpp +++ b/image/src/imgRequest.cpp @@ -514,8 +514,11 @@ imgRequest::RequestDecode() /** imgIContainerObserver methods **/ -/* [noscript] void frameChanged (in imgIContainer container, in nsIntRect dirtyRect); */ -NS_IMETHODIMP imgRequest::FrameChanged(imgIContainer *container, +/* [noscript] void frameChanged (in imgIRequest request, + in imgIContainer container, + in nsIntRect dirtyRect); */ +NS_IMETHODIMP imgRequest::FrameChanged(imgIRequest *request, + imgIContainer *container, const nsIntRect *dirtyRect) { LOG_SCOPE(gImgLog, "imgRequest::FrameChanged"); diff --git a/image/src/imgRequestProxy.cpp b/image/src/imgRequestProxy.cpp index dc23c1f7017..c36e9c8f804 100644 --- a/image/src/imgRequestProxy.cpp +++ b/image/src/imgRequestProxy.cpp @@ -614,7 +614,7 @@ void imgRequestProxy::FrameChanged(imgIContainer *container, if (mListener && !mCanceled) { // Hold a ref to the listener while we call it, just in case. nsCOMPtr kungFuDeathGrip(mListener); - mListener->FrameChanged(container, dirtyRect); + mListener->FrameChanged(this, container, dirtyRect); } } diff --git a/layout/base/nsImageLoader.cpp b/layout/base/nsImageLoader.cpp index 347b1738b5a..e90cc3e22c4 100644 --- a/layout/base/nsImageLoader.cpp +++ b/layout/base/nsImageLoader.cpp @@ -212,7 +212,8 @@ NS_IMETHODIMP nsImageLoader::OnStopRequest(imgIRequest *aRequest, return NS_OK; } -NS_IMETHODIMP nsImageLoader::FrameChanged(imgIContainer *aContainer, +NS_IMETHODIMP nsImageLoader::FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect) { if (!mFrame) @@ -223,6 +224,8 @@ NS_IMETHODIMP nsImageLoader::FrameChanged(imgIContainer *aContainer, return NS_OK; } + NS_ASSERTION(aRequest == mRequest, "This is a neat trick."); + nsRect r = aDirtyRect->IsEqualInterior(nsIntRect::GetMaxSizedIntRect()) ? nsRect(nsPoint(0, 0), mFrame->GetSize()) : aDirtyRect->ToAppUnits(nsPresContext::AppUnitsPerCSSPixel()); diff --git a/layout/base/nsImageLoader.h b/layout/base/nsImageLoader.h index 0cdba70d7f1..85e27b223b2 100644 --- a/layout/base/nsImageLoader.h +++ b/layout/base/nsImageLoader.h @@ -90,7 +90,8 @@ public: // incrementally in nsImageFrame.cpp. // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD FrameChanged(imgIContainer *aContainer, + NS_IMETHOD FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect); void Destroy(); diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp index 49120c65839..a5020a3eb6a 100644 --- a/layout/generic/nsBulletFrame.cpp +++ b/layout/generic/nsBulletFrame.cpp @@ -1547,7 +1547,8 @@ NS_IMETHODIMP nsBulletFrame::OnImageIsAnimated(imgIRequest* aRequest) return NS_OK; } -NS_IMETHODIMP nsBulletFrame::FrameChanged(imgIContainer *aContainer, +NS_IMETHODIMP nsBulletFrame::FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect) { // Invalidate the entire content area. Maybe it's not optimal but it's simple and @@ -1700,11 +1701,12 @@ NS_IMETHODIMP nsBulletListener::OnImageIsAnimated(imgIRequest *aRequest) return mFrame->OnImageIsAnimated(aRequest); } -NS_IMETHODIMP nsBulletListener::FrameChanged(imgIContainer *aContainer, +NS_IMETHODIMP nsBulletListener::FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect) { if (!mFrame) return NS_OK; - return mFrame->FrameChanged(aContainer, aDirtyRect); + return mFrame->FrameChanged(aRequest, aContainer, aDirtyRect); } diff --git a/layout/generic/nsBulletFrame.h b/layout/generic/nsBulletFrame.h index e7142da4334..7ab909d62e3 100644 --- a/layout/generic/nsBulletFrame.h +++ b/layout/generic/nsBulletFrame.h @@ -68,7 +68,8 @@ public: NS_IMETHOD OnImageIsAnimated(imgIRequest *aRequest); // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD FrameChanged(imgIContainer *aContainer, + NS_IMETHOD FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *dirtyRect); void SetFrame(nsBulletFrame *frame) { mFrame = frame; } @@ -122,7 +123,8 @@ public: nsresult aStatus, const PRUnichar *aStatusArg); NS_IMETHOD OnImageIsAnimated(imgIRequest *aRequest); - NS_IMETHOD FrameChanged(imgIContainer *aContainer, + NS_IMETHOD FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect); /* get list item text, without '.' */ diff --git a/layout/generic/nsImageFrame.cpp b/layout/generic/nsImageFrame.cpp index ca5da70dc3e..1aa47613f8d 100644 --- a/layout/generic/nsImageFrame.cpp +++ b/layout/generic/nsImageFrame.cpp @@ -682,7 +682,8 @@ nsImageFrame::OnStopDecode(imgIRequest *aRequest, } nsresult -nsImageFrame::FrameChanged(imgIContainer *aContainer, +nsImageFrame::FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect) { if (!GetStyleVisibility()->IsVisible()) { @@ -1988,7 +1989,8 @@ nsImageFrame::IconLoad::OnDiscard(imgIRequest *aRequest) } NS_IMETHODIMP -nsImageFrame::IconLoad::FrameChanged(imgIContainer *aContainer, +nsImageFrame::IconLoad::FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect) { nsTObserverArray::ForwardIterator iter(mIconObservers); @@ -2043,13 +2045,14 @@ NS_IMETHODIMP nsImageListener::OnStopDecode(imgIRequest *aRequest, return mFrame->OnStopDecode(aRequest, status, statusArg); } -NS_IMETHODIMP nsImageListener::FrameChanged(imgIContainer *aContainer, +NS_IMETHODIMP nsImageListener::FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect) { if (!mFrame) return NS_ERROR_FAILURE; - return mFrame->FrameChanged(aContainer, aDirtyRect); + return mFrame->FrameChanged(aRequest, aContainer, aDirtyRect); } static bool diff --git a/layout/generic/nsImageFrame.h b/layout/generic/nsImageFrame.h index b6bc5c63e79..caba3ba0501 100644 --- a/layout/generic/nsImageFrame.h +++ b/layout/generic/nsImageFrame.h @@ -85,7 +85,8 @@ public: NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status, const PRUnichar *statusArg); // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD FrameChanged(imgIContainer *aContainer, + NS_IMETHOD FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *dirtyRect); void SetFrame(nsImageFrame *frame) { mFrame = frame; } @@ -237,7 +238,8 @@ protected: nsresult OnStopDecode(imgIRequest *aRequest, nsresult aStatus, const PRUnichar *aStatusArg); - nsresult FrameChanged(imgIContainer *aContainer, + nsresult FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect); private: diff --git a/layout/svg/base/src/nsSVGImageFrame.cpp b/layout/svg/base/src/nsSVGImageFrame.cpp index 998b01fbcce..e42b5b836c0 100644 --- a/layout/svg/base/src/nsSVGImageFrame.cpp +++ b/layout/svg/base/src/nsSVGImageFrame.cpp @@ -62,7 +62,8 @@ public: NS_IMETHOD OnStopDecode(imgIRequest *aRequest, nsresult status, const PRUnichar *statusArg); // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD FrameChanged(imgIContainer *aContainer, + NS_IMETHOD FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect); // imgIContainerObserver (override nsStubImageDecoderObserver) NS_IMETHOD OnStartContainer(imgIRequest *aRequest, @@ -555,7 +556,8 @@ NS_IMETHODIMP nsSVGImageListener::OnStopDecode(imgIRequest *aRequest, return NS_OK; } -NS_IMETHODIMP nsSVGImageListener::FrameChanged(imgIContainer *aContainer, +NS_IMETHODIMP nsSVGImageListener::FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect) { if (!mFrame) diff --git a/layout/xul/base/src/nsImageBoxFrame.cpp b/layout/xul/base/src/nsImageBoxFrame.cpp index ca07631f137..c03af4042d8 100644 --- a/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/layout/xul/base/src/nsImageBoxFrame.cpp @@ -626,7 +626,8 @@ NS_IMETHODIMP nsImageBoxFrame::OnImageIsAnimated(imgIRequest *aRequest) return NS_OK; } -NS_IMETHODIMP nsImageBoxFrame::FrameChanged(imgIContainer *aContainer, +NS_IMETHODIMP nsImageBoxFrame::FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect) { nsBoxLayoutState state(PresContext()); @@ -681,12 +682,13 @@ NS_IMETHODIMP nsImageBoxListener::OnImageIsAnimated(imgIRequest* aRequest) return mFrame->OnImageIsAnimated(aRequest); } -NS_IMETHODIMP nsImageBoxListener::FrameChanged(imgIContainer *aContainer, +NS_IMETHODIMP nsImageBoxListener::FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect) { if (!mFrame) return NS_ERROR_FAILURE; - return mFrame->FrameChanged(aContainer, aDirtyRect); + return mFrame->FrameChanged(aRequest, aContainer, aDirtyRect); } diff --git a/layout/xul/base/src/nsImageBoxFrame.h b/layout/xul/base/src/nsImageBoxFrame.h index 720094af676..b7287f3fae0 100644 --- a/layout/xul/base/src/nsImageBoxFrame.h +++ b/layout/xul/base/src/nsImageBoxFrame.h @@ -61,7 +61,8 @@ public: NS_IMETHOD OnImageIsAnimated(imgIRequest* aRequest); // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD FrameChanged(imgIContainer *aContainer, + NS_IMETHOD FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect); void SetFrame(nsImageBoxFrame *frame) { mFrame = frame; } @@ -126,7 +127,8 @@ public: const PRUnichar *statusArg); NS_IMETHOD OnImageIsAnimated(imgIRequest* aRequest); - NS_IMETHOD FrameChanged(imgIContainer *aContainer, + NS_IMETHOD FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect); virtual ~nsImageBoxFrame(); diff --git a/layout/xul/base/src/tree/src/nsTreeImageListener.cpp b/layout/xul/base/src/tree/src/nsTreeImageListener.cpp index 3155f5d9224..39356406918 100644 --- a/layout/xul/base/src/tree/src/nsTreeImageListener.cpp +++ b/layout/xul/base/src/tree/src/nsTreeImageListener.cpp @@ -84,7 +84,8 @@ NS_IMETHODIMP nsTreeImageListener::OnDataAvailable(imgIRequest *aRequest, return NS_OK; } -NS_IMETHODIMP nsTreeImageListener::FrameChanged(imgIContainer *aContainer, +NS_IMETHODIMP nsTreeImageListener::FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect) { Invalidate(); diff --git a/layout/xul/base/src/tree/src/nsTreeImageListener.h b/layout/xul/base/src/tree/src/nsTreeImageListener.h index e0beba4d915..84264950fb1 100644 --- a/layout/xul/base/src/tree/src/nsTreeImageListener.h +++ b/layout/xul/base/src/tree/src/nsTreeImageListener.h @@ -60,7 +60,8 @@ public: NS_IMETHOD OnDataAvailable(imgIRequest *aRequest, bool aCurrentFrame, const nsIntRect *aRect); // imgIContainerObserver (override nsStubImageDecoderObserver) - NS_IMETHOD FrameChanged(imgIContainer *aContainer, + NS_IMETHOD FrameChanged(imgIRequest *aRequest, + imgIContainer *aContainer, const nsIntRect *aDirtyRect); NS_IMETHOD ClearFrame(); diff --git a/toolkit/system/gnome/nsAlertsIconListener.cpp b/toolkit/system/gnome/nsAlertsIconListener.cpp index 8cf8c575d16..4bc64e072f6 100644 --- a/toolkit/system/gnome/nsAlertsIconListener.cpp +++ b/toolkit/system/gnome/nsAlertsIconListener.cpp @@ -144,7 +144,8 @@ nsAlertsIconListener::OnStopDecode(imgIRequest* aRequest, } NS_IMETHODIMP -nsAlertsIconListener::FrameChanged(imgIContainer* aContainer, +nsAlertsIconListener::FrameChanged(imgIRequest* aRequest, + imgIContainer* aContainer, const nsIntRect* aDirtyRect) { return NS_OK; diff --git a/widget/cocoa/nsMenuItemIconX.mm b/widget/cocoa/nsMenuItemIconX.mm index 13f866f2232..9505ea25da5 100644 --- a/widget/cocoa/nsMenuItemIconX.mm +++ b/widget/cocoa/nsMenuItemIconX.mm @@ -358,7 +358,8 @@ nsMenuItemIconX::LoadIcon(nsIURI* aIconURI) // NS_IMETHODIMP -nsMenuItemIconX::FrameChanged(imgIContainer* aContainer, +nsMenuItemIconX::FrameChanged(imgIRequest* aRequest, + imgIContainer* aContainer, const nsIntRect* aDirtyRect) { return NS_OK;