Back to index

lightning-sunbird  0.9+nobinonly
nsSVGClipPathFrame.cpp File Reference
#include "nsIDOMSVGTransformable.h"
#include "nsIDOMDocument.h"
#include "nsIDocument.h"
#include "nsIDOMSVGClipPathElement.h"
#include "nsSVGClipPathFrame.h"
#include "nsISVGRendererCanvas.h"
#include "nsIDOMSVGTransformList.h"
#include "nsSVGAnimatedTransformList.h"
#include "nsIDOMSVGAnimatedEnum.h"
#include "nsSVGUtils.h"

Go to the source code of this file.


nsresult NS_NewSVGClipPathFrame (nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame **aNewFrame)
nsresult NS_GetSVGClipPathFrame (nsSVGClipPathFrame **aResult, nsIURI *aURI, nsIContent *aContent)

Function Documentation

nsresult NS_GetSVGClipPathFrame ( nsSVGClipPathFrame **  aResult,
nsIContent aContent 

Definition at line 100 of file nsSVGClipPathFrame.cpp.

  *aResult = nsnull;

  // Get the PresShell
  nsIDocument *myDoc = aContent->GetCurrentDoc();
  if (!myDoc) {
    NS_WARNING("No document for this content!");
    return NS_ERROR_FAILURE;
  nsIPresShell *aPresShell = myDoc->GetShellAt(0);

  // Get the URI Spec
  nsCAutoString uriSpec;

  // Find the referenced frame
  nsIFrame *cpframe;
  if (!NS_SUCCEEDED(nsSVGUtils::GetReferencedFrame(&cpframe, 
                                                   uriSpec, aContent, aPresShell)))
    return NS_ERROR_FAILURE;

  nsIAtom* frameType = cpframe->GetType();
  if (frameType != nsLayoutAtoms::svgClipPathFrame)
    return NS_ERROR_FAILURE;

  *aResult = (nsSVGClipPathFrame *)cpframe;
  return NS_OK;

Here is the call graph for this function:

Here is the caller graph for this function:

nsresult NS_NewSVGClipPathFrame ( nsIPresShell aPresShell,
nsIContent aContent,
nsIFrame **  aNewFrame 

Definition at line 78 of file nsSVGClipPathFrame.cpp.

  *aNewFrame = nsnull;
  nsCOMPtr<nsIDOMSVGTransformable> transformable = do_QueryInterface(aContent);
  if (!transformable) {
#ifdef DEBUG
    printf("warning: trying to construct an SVGClipPathFrame for a content element that doesn't support the right interfaces\n");
    return NS_ERROR_FAILURE;
  nsSVGClipPathFrame* it = new (aPresShell) nsSVGClipPathFrame;
  if (nsnull == it)

  *aNewFrame = it;

  return NS_OK;

Here is the call graph for this function: