Back to index

lightning-sunbird  0.9+nobinonly
Functions
nsSVGTSpanFrame.cpp File Reference
#include "nsSVGTSpanFrame.h"
#include "nsSVGUtils.h"

Go to the source code of this file.

Functions

nsresult NS_NewSVGTSpanFrame (nsIPresShell *aPresShell, nsIContent *aContent, nsIFrame *parentFrame, nsIFrame **aNewFrame)

Function Documentation

nsresult NS_NewSVGTSpanFrame ( nsIPresShell aPresShell,
nsIContent aContent,
nsIFrame parentFrame,
nsIFrame **  aNewFrame 
)

Definition at line 46 of file nsSVGTSpanFrame.cpp.

{
  *aNewFrame = nsnull;

  NS_ASSERTION(parentFrame, "null parent");
  nsISVGTextContainerFrame *text_container;
  parentFrame->QueryInterface(NS_GET_IID(nsISVGTextContainerFrame),
                              (void**)&text_container);
  if (!text_container) {
    NS_ERROR("trying to construct an SVGTSpanFrame for an invalid container");
    return NS_ERROR_FAILURE;
  }
  
  nsCOMPtr<nsIDOMSVGTSpanElement> tspan_elem = do_QueryInterface(aContent);
  if (!tspan_elem) {
    NS_ERROR("Trying to construct an SVGTSpanFrame for a "
             "content element that doesn't support the right interfaces");
    return NS_ERROR_FAILURE;
  }
  
  nsSVGTSpanFrame* it = new (aPresShell) nsSVGTSpanFrame;
  if (nsnull == it)
    return NS_ERROR_OUT_OF_MEMORY;

  *aNewFrame = it;
  
  return NS_OK;
}

Here is the call graph for this function: