From fd97e737fe43a0005406f8e8d273a301ef6362d6 Mon Sep 17 00:00:00 2001 From: Daniel Holbert Date: Wed, 8 Sep 2010 13:40:38 -0700 Subject: [PATCH] Bug 276431 part 2: Add imgIContainer::GetRootLayoutFrame. r=joe a=blocking --- modules/libpr0n/public/imgIContainer.idl | 12 ++++++++++++ modules/libpr0n/src/RasterImage.cpp | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/modules/libpr0n/public/imgIContainer.idl b/modules/libpr0n/public/imgIContainer.idl index e9df900b039..10533a44136 100644 --- a/modules/libpr0n/public/imgIContainer.idl +++ b/modules/libpr0n/public/imgIContainer.idl @@ -52,6 +52,7 @@ interface imgIDecoderObserver; #include "gfxPattern.h" #include "gfxASurface.h" #include "nsRect.h" +class nsIFrame; %} [ptr] native gfxImageSurface(gfxImageSurface); @@ -62,6 +63,7 @@ native gfxImageFormat(gfxASurface::gfxImageFormat); [ref] native gfxRect(gfxRect); native gfxGraphicsFilter(gfxPattern::GraphicsFilter); [ref] native nsIntRect(nsIntRect); +[ptr] native nsIFrame(nsIFrame); /** * imgIContainer is the interface that represents an image. It allows @@ -199,6 +201,16 @@ interface imgIContainer : nsISupports [const] in nsIntRect aSubimage, in PRUint32 aFlags); + /** + * If this image is TYPE_VECTOR, i.e. is really an embedded SVG document, + * this method returns a pointer to the root nsIFrame of that document. If + * not (or if the root nsIFrame isn't available for some reason), this method + * returns nsnull. + * + * "notxpcom" for convenience, since we have no need for nsresult return-val. + */ + [notxpcom] nsIFrame GetRootLayoutFrame(); + /* * Ensures that an image is decoding. Calling this function guarantees that * the image will at some point fire off decode notifications. Calling draw(), diff --git a/modules/libpr0n/src/RasterImage.cpp b/modules/libpr0n/src/RasterImage.cpp index c88d4d17d96..9f9666fb576 100644 --- a/modules/libpr0n/src/RasterImage.cpp +++ b/modules/libpr0n/src/RasterImage.cpp @@ -2464,6 +2464,14 @@ RasterImage::Draw(gfxContext *aContext, return NS_OK; } +//****************************************************************************** +/* [notxpcom] nsIFrame GetRootLayoutFrame() */ +nsIFrame* +RasterImage::GetRootLayoutFrame() +{ + return nsnull; +} + //****************************************************************************** /* void lockImage() */ NS_IMETHODIMP