2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
2012-05-21 04:12:37 -07:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/* rendering object for the HTML <canvas> element */
|
|
|
|
|
|
|
|
#include "nsHTMLParts.h"
|
|
|
|
#include "nsCOMPtr.h"
|
|
|
|
#include "nsIServiceManager.h"
|
|
|
|
#include "nsGkAtoms.h"
|
|
|
|
|
|
|
|
#include "nsHTMLCanvasFrame.h"
|
2010-05-17 21:04:22 -07:00
|
|
|
#include "nsHTMLCanvasElement.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
#include "nsDisplayList.h"
|
2009-07-21 17:44:57 -07:00
|
|
|
#include "nsLayoutUtils.h"
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsTransform2D.h"
|
|
|
|
|
2009-04-08 13:27:20 -07:00
|
|
|
#include "gfxContext.h"
|
2009-03-05 05:43:45 -08:00
|
|
|
|
2011-11-25 08:58:34 -08:00
|
|
|
#ifdef ACCESSIBILITY
|
|
|
|
#include "nsAccessibilityService.h"
|
|
|
|
#endif
|
|
|
|
|
2010-05-17 21:04:22 -07:00
|
|
|
using namespace mozilla;
|
|
|
|
using namespace mozilla::layers;
|
|
|
|
|
|
|
|
static nsHTMLCanvasElement *
|
|
|
|
CanvasElementFromContent(nsIContent *content)
|
|
|
|
{
|
|
|
|
nsCOMPtr<nsIDOMHTMLCanvasElement> domCanvas(do_QueryInterface(content));
|
|
|
|
return domCanvas ? static_cast<nsHTMLCanvasElement*>(domCanvas.get()) : nsnull;
|
|
|
|
}
|
|
|
|
|
2010-07-15 14:07:44 -07:00
|
|
|
class nsDisplayCanvas : public nsDisplayItem {
|
2009-03-05 05:43:45 -08:00
|
|
|
public:
|
2010-08-13 03:01:13 -07:00
|
|
|
nsDisplayCanvas(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
|
|
|
|
: nsDisplayItem(aBuilder, aFrame)
|
2009-03-05 05:43:45 -08:00
|
|
|
{
|
2010-07-15 14:07:44 -07:00
|
|
|
MOZ_COUNT_CTOR(nsDisplayCanvas);
|
2009-03-05 05:43:45 -08:00
|
|
|
}
|
|
|
|
#ifdef NS_BUILD_REFCNT_LOGGING
|
2010-07-15 14:07:44 -07:00
|
|
|
virtual ~nsDisplayCanvas() {
|
|
|
|
MOZ_COUNT_DTOR(nsDisplayCanvas);
|
2009-03-05 05:43:45 -08:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
2010-07-15 14:07:49 -07:00
|
|
|
NS_DISPLAY_DECL_NAME("nsDisplayCanvas", TYPE_CANVAS)
|
2009-03-05 05:43:45 -08:00
|
|
|
|
2011-01-02 17:48:09 -08:00
|
|
|
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
|
2012-06-21 00:21:55 -07:00
|
|
|
bool* aSnap) {
|
2012-04-10 04:24:18 -07:00
|
|
|
*aSnap = false;
|
2009-03-05 05:43:45 -08:00
|
|
|
nsIFrame* f = GetUnderlyingFrame();
|
2010-05-17 21:04:22 -07:00
|
|
|
nsHTMLCanvasElement *canvas = CanvasElementFromContent(f->GetContent());
|
2011-01-02 17:48:09 -08:00
|
|
|
nsRegion result;
|
|
|
|
if (canvas->GetIsOpaque()) {
|
2012-04-10 04:24:18 -07:00
|
|
|
result = GetBounds(aBuilder, aSnap);
|
2011-01-02 17:48:09 -08:00
|
|
|
}
|
|
|
|
return result;
|
2009-03-05 05:43:45 -08:00
|
|
|
}
|
|
|
|
|
2012-04-10 04:24:18 -07:00
|
|
|
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder, bool* aSnap) {
|
|
|
|
*aSnap = false;
|
2009-03-05 05:43:45 -08:00
|
|
|
nsHTMLCanvasFrame* f = static_cast<nsHTMLCanvasFrame*>(GetUnderlyingFrame());
|
2010-08-13 03:01:58 -07:00
|
|
|
return f->GetInnerArea() + ToReferenceFrame();
|
2009-03-05 05:43:45 -08:00
|
|
|
}
|
2010-05-17 21:04:22 -07:00
|
|
|
|
|
|
|
virtual already_AddRefed<Layer> BuildLayer(nsDisplayListBuilder* aBuilder,
|
2011-06-22 05:11:27 -07:00
|
|
|
LayerManager* aManager,
|
|
|
|
const ContainerParameters& aContainerParameters)
|
2010-05-17 21:04:22 -07:00
|
|
|
{
|
2010-07-15 14:07:46 -07:00
|
|
|
return static_cast<nsHTMLCanvasFrame*>(mFrame)->
|
|
|
|
BuildLayer(aBuilder, aManager, this);
|
2010-05-17 21:04:22 -07:00
|
|
|
}
|
2010-07-15 14:08:05 -07:00
|
|
|
virtual LayerState GetLayerState(nsDisplayListBuilder* aBuilder,
|
2012-05-03 07:05:55 -07:00
|
|
|
LayerManager* aManager,
|
|
|
|
const FrameLayerBuilder::ContainerParameters& aParameters)
|
2010-07-15 14:08:05 -07:00
|
|
|
{
|
2011-07-08 03:42:21 -07:00
|
|
|
if (CanvasElementFromContent(mFrame->GetContent())->ShouldForceInactiveLayer(aManager))
|
|
|
|
return LAYER_INACTIVE;
|
|
|
|
|
2011-02-04 10:11:24 -08:00
|
|
|
// If compositing is cheap, just do that
|
|
|
|
if (aManager->IsCompositingCheap())
|
|
|
|
return mozilla::LAYER_ACTIVE;
|
|
|
|
|
|
|
|
return mFrame->AreLayersMarkedActive() ? LAYER_ACTIVE : LAYER_INACTIVE;
|
2010-07-15 14:08:05 -07:00
|
|
|
}
|
2009-03-05 05:43:45 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsIFrame*
|
|
|
|
NS_NewHTMLCanvasFrame(nsIPresShell* aPresShell, nsStyleContext* aContext)
|
|
|
|
{
|
|
|
|
return new (aPresShell) nsHTMLCanvasFrame(aContext);
|
|
|
|
}
|
|
|
|
|
2009-09-12 09:49:24 -07:00
|
|
|
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLCanvasFrame)
|
|
|
|
|
2011-02-04 10:11:24 -08:00
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLCanvasFrame::Init(nsIContent* aContent,
|
|
|
|
nsIFrame* aParent,
|
|
|
|
nsIFrame* aPrevInFlow)
|
|
|
|
{
|
|
|
|
nsresult rv = nsSplittableFrame::Init(aContent, aParent, aPrevInFlow);
|
|
|
|
|
|
|
|
// We can fill in the canvas before the canvas frame is created, in
|
|
|
|
// which case we never get around to marking the layer active. Therefore,
|
|
|
|
// we mark it active here when we create the frame.
|
2011-06-22 05:11:28 -07:00
|
|
|
MarkLayersActive(nsChangeHint(0));
|
2011-02-04 10:11:24 -08:00
|
|
|
|
|
|
|
return rv;
|
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
nsHTMLCanvasFrame::~nsHTMLCanvasFrame()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-01-14 19:27:09 -08:00
|
|
|
nsIntSize
|
2007-03-22 10:30:00 -07:00
|
|
|
nsHTMLCanvasFrame::GetCanvasSize()
|
|
|
|
{
|
2010-05-17 21:04:22 -07:00
|
|
|
nsIntSize size(0,0);
|
|
|
|
nsHTMLCanvasElement *canvas = CanvasElementFromContent(GetContent());
|
2007-03-22 10:30:00 -07:00
|
|
|
if (canvas) {
|
2010-05-17 21:04:22 -07:00
|
|
|
size = canvas->GetSize();
|
2007-03-22 10:30:00 -07:00
|
|
|
} else {
|
|
|
|
NS_NOTREACHED("couldn't get canvas size");
|
|
|
|
}
|
|
|
|
|
2010-05-17 21:04:22 -07:00
|
|
|
return size;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
/* virtual */ nscoord
|
2011-04-07 18:04:40 -07:00
|
|
|
nsHTMLCanvasFrame::GetMinWidth(nsRenderingContext *aRenderingContext)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
// XXX The caller doesn't account for constraints of the height,
|
|
|
|
// min-height, and max-height properties.
|
|
|
|
nscoord result = nsPresContext::CSSPixelsToAppUnits(GetCanvasSize().width);
|
|
|
|
DISPLAY_MIN_WIDTH(this, result);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* virtual */ nscoord
|
2011-04-07 18:04:40 -07:00
|
|
|
nsHTMLCanvasFrame::GetPrefWidth(nsRenderingContext *aRenderingContext)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
|
|
|
// XXX The caller doesn't account for constraints of the height,
|
|
|
|
// min-height, and max-height properties.
|
|
|
|
nscoord result = nsPresContext::CSSPixelsToAppUnits(GetCanvasSize().width);
|
|
|
|
DISPLAY_PREF_WIDTH(this, result);
|
|
|
|
return result;
|
|
|
|
}
|
|
|
|
|
2007-06-12 11:27:09 -07:00
|
|
|
/* virtual */ nsSize
|
|
|
|
nsHTMLCanvasFrame::GetIntrinsicRatio()
|
|
|
|
{
|
2009-01-14 19:27:09 -08:00
|
|
|
nsIntSize size(GetCanvasSize());
|
|
|
|
return nsSize(nsPresContext::CSSPixelsToAppUnits(size.width),
|
|
|
|
nsPresContext::CSSPixelsToAppUnits(size.height));
|
2007-06-12 11:27:09 -07:00
|
|
|
}
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
/* virtual */ nsSize
|
2011-04-07 18:04:40 -07:00
|
|
|
nsHTMLCanvasFrame::ComputeSize(nsRenderingContext *aRenderingContext,
|
2007-03-22 10:30:00 -07:00
|
|
|
nsSize aCBSize, nscoord aAvailableWidth,
|
|
|
|
nsSize aMargin, nsSize aBorder, nsSize aPadding,
|
2012-03-16 11:01:05 -07:00
|
|
|
PRUint32 aFlags)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2009-01-14 19:27:09 -08:00
|
|
|
nsIntSize size = GetCanvasSize();
|
2007-11-18 04:09:03 -08:00
|
|
|
|
|
|
|
IntrinsicSize intrinsicSize;
|
|
|
|
intrinsicSize.width.SetCoordValue(nsPresContext::CSSPixelsToAppUnits(size.width));
|
|
|
|
intrinsicSize.height.SetCoordValue(nsPresContext::CSSPixelsToAppUnits(size.height));
|
|
|
|
|
2009-01-14 19:27:09 -08:00
|
|
|
nsSize intrinsicRatio = GetIntrinsicRatio(); // won't actually be used
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
return nsLayoutUtils::ComputeSizeWithIntrinsicDimensions(
|
2007-11-18 04:09:03 -08:00
|
|
|
aRenderingContext, this,
|
|
|
|
intrinsicSize, intrinsicRatio, aCBSize,
|
|
|
|
aMargin, aBorder, aPadding);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
|
|
|
|
nsHTMLReflowMetrics& aMetrics,
|
|
|
|
const nsHTMLReflowState& aReflowState,
|
|
|
|
nsReflowStatus& aStatus)
|
|
|
|
{
|
|
|
|
DO_GLOBAL_REFLOW_COUNT("nsHTMLCanvasFrame");
|
|
|
|
DISPLAY_REFLOW(aPresContext, this, aReflowState, aMetrics, aStatus);
|
|
|
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
|
|
|
("enter nsHTMLCanvasFrame::Reflow: availSize=%d,%d",
|
|
|
|
aReflowState.availableWidth, aReflowState.availableHeight));
|
|
|
|
|
|
|
|
NS_PRECONDITION(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
|
|
|
|
|
|
|
|
aStatus = NS_FRAME_COMPLETE;
|
|
|
|
|
|
|
|
aMetrics.width = aReflowState.ComputedWidth();
|
2007-08-02 11:08:05 -07:00
|
|
|
aMetrics.height = aReflowState.ComputedHeight();
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
// stash this away so we can compute our inner area later
|
|
|
|
mBorderPadding = aReflowState.mComputedBorderPadding;
|
|
|
|
|
|
|
|
aMetrics.width += mBorderPadding.left + mBorderPadding.right;
|
|
|
|
aMetrics.height += mBorderPadding.top + mBorderPadding.bottom;
|
|
|
|
|
|
|
|
if (GetPrevInFlow()) {
|
|
|
|
nscoord y = GetContinuationOffset(&aMetrics.width);
|
|
|
|
aMetrics.height -= y + mBorderPadding.top;
|
2009-09-16 08:01:36 -07:00
|
|
|
aMetrics.height = NS_MAX(0, aMetrics.height);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
2010-10-06 21:25:46 -07:00
|
|
|
aMetrics.SetOverflowAreasToDesiredBounds();
|
2007-03-22 10:30:00 -07:00
|
|
|
FinishAndStoreOverflow(&aMetrics);
|
|
|
|
|
2012-02-17 20:26:37 -08:00
|
|
|
// Reflow the single anon block child.
|
|
|
|
nsReflowStatus childStatus;
|
|
|
|
nsSize availSize(aReflowState.ComputedWidth(), NS_UNCONSTRAINEDSIZE);
|
|
|
|
nsIFrame* childFrame = mFrames.FirstChild();
|
|
|
|
NS_ASSERTION(!childFrame->GetNextSibling(), "HTML canvas should have 1 kid");
|
|
|
|
nsHTMLReflowMetrics childDesiredSize(aMetrics.mFlags);
|
|
|
|
nsHTMLReflowState childReflowState(aPresContext, aReflowState, childFrame,
|
|
|
|
availSize);
|
|
|
|
ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowState,
|
|
|
|
0, 0, 0, childStatus, nsnull);
|
|
|
|
FinishReflowChild(childFrame, aPresContext, &childReflowState,
|
|
|
|
childDesiredSize, 0, 0, 0);
|
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
|
|
|
|
("exit nsHTMLCanvasFrame::Reflow: size=%d,%d",
|
|
|
|
aMetrics.width, aMetrics.height));
|
|
|
|
NS_FRAME_SET_TRUNCATION(aStatus, aReflowState, aMetrics);
|
2012-02-17 20:26:37 -08:00
|
|
|
|
2007-03-22 10:30:00 -07:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FIXME taken from nsImageFrame, but then had splittable frame stuff
|
|
|
|
// removed. That needs to be fixed.
|
|
|
|
nsRect
|
|
|
|
nsHTMLCanvasFrame::GetInnerArea() const
|
|
|
|
{
|
|
|
|
nsRect r;
|
|
|
|
r.x = mBorderPadding.left;
|
|
|
|
r.y = mBorderPadding.top;
|
|
|
|
r.width = mRect.width - mBorderPadding.left - mBorderPadding.right;
|
|
|
|
r.height = mRect.height - mBorderPadding.top - mBorderPadding.bottom;
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
|
2010-05-17 21:04:22 -07:00
|
|
|
already_AddRefed<Layer>
|
|
|
|
nsHTMLCanvasFrame::BuildLayer(nsDisplayListBuilder* aBuilder,
|
2010-07-15 14:07:46 -07:00
|
|
|
LayerManager* aManager,
|
|
|
|
nsDisplayItem* aItem)
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2010-08-13 03:01:58 -07:00
|
|
|
nsRect area = GetContentRect() - GetPosition() + aItem->ToReferenceFrame();
|
2010-05-17 21:04:22 -07:00
|
|
|
nsHTMLCanvasElement* element = static_cast<nsHTMLCanvasElement*>(GetContent());
|
|
|
|
nsIntSize canvasSize = GetCanvasSize();
|
2009-05-06 13:02:59 -07:00
|
|
|
|
2010-05-17 21:04:22 -07:00
|
|
|
if (canvasSize.width <= 0 || canvasSize.height <= 0 || area.IsEmpty())
|
|
|
|
return nsnull;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-07-15 14:07:46 -07:00
|
|
|
CanvasLayer* oldLayer = static_cast<CanvasLayer*>
|
2012-06-29 20:06:11 -07:00
|
|
|
(GetLayerBuilderForManager(aManager)->GetLeafLayerFor(aBuilder, aItem));
|
2011-03-27 16:59:47 -07:00
|
|
|
nsRefPtr<CanvasLayer> layer = element->GetCanvasLayer(aBuilder, oldLayer, aManager);
|
2010-05-17 21:04:22 -07:00
|
|
|
if (!layer)
|
|
|
|
return nsnull;
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-17 21:04:22 -07:00
|
|
|
nsPresContext* presContext = PresContext();
|
|
|
|
gfxRect r = gfxRect(presContext->AppUnitsToGfxUnits(area.x),
|
|
|
|
presContext->AppUnitsToGfxUnits(area.y),
|
|
|
|
presContext->AppUnitsToGfxUnits(area.width),
|
|
|
|
presContext->AppUnitsToGfxUnits(area.height));
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-05-17 21:04:22 -07:00
|
|
|
// Transform the canvas into the right place
|
|
|
|
gfxMatrix transform;
|
2011-04-18 20:07:21 -07:00
|
|
|
transform.Translate(r.TopLeft());
|
2010-05-17 21:04:22 -07:00
|
|
|
transform.Scale(r.Width()/canvasSize.width, r.Height()/canvasSize.height);
|
|
|
|
layer->SetTransform(gfx3DMatrix::From2D(transform));
|
2010-05-17 21:04:22 -07:00
|
|
|
layer->SetFilter(nsLayoutUtils::GetGraphicsFilterForFrame(this));
|
2011-02-22 21:38:09 -08:00
|
|
|
layer->SetVisibleRegion(nsIntRect(0, 0, canvasSize.width, canvasSize.height));
|
2007-03-22 10:30:00 -07:00
|
|
|
|
2010-08-05 15:11:23 -07:00
|
|
|
return layer.forget();
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
|
|
|
const nsRect& aDirtyRect,
|
|
|
|
const nsDisplayListSet& aLists)
|
|
|
|
{
|
|
|
|
if (!IsVisibleForPainting(aBuilder))
|
|
|
|
return NS_OK;
|
|
|
|
|
|
|
|
nsresult rv = DisplayBorderBackgroundOutline(aBuilder, aLists);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2010-09-09 08:21:47 -07:00
|
|
|
nsDisplayList replacedContent;
|
|
|
|
|
|
|
|
rv = replacedContent.AppendNewToTop(
|
2010-08-13 03:01:13 -07:00
|
|
|
new (aBuilder) nsDisplayCanvas(aBuilder, this));
|
2007-03-22 10:30:00 -07:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2010-09-09 08:21:47 -07:00
|
|
|
rv = DisplaySelectionOverlay(aBuilder, &replacedContent,
|
|
|
|
nsISelectionDisplay::DISPLAY_IMAGES);
|
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
WrapReplacedContentForBorderRadius(aBuilder, &replacedContent, aLists);
|
|
|
|
|
|
|
|
return NS_OK;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
nsIAtom*
|
|
|
|
nsHTMLCanvasFrame::GetType() const
|
|
|
|
{
|
|
|
|
return nsGkAtoms::HTMLCanvasFrame;
|
|
|
|
}
|
|
|
|
|
|
|
|
// get the offset into the content area of the image where aImg starts if it is a continuation.
|
|
|
|
// from nsImageFrame
|
|
|
|
nscoord
|
|
|
|
nsHTMLCanvasFrame::GetContinuationOffset(nscoord* aWidth) const
|
|
|
|
{
|
|
|
|
nscoord offset = 0;
|
|
|
|
if (aWidth) {
|
|
|
|
*aWidth = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (GetPrevInFlow()) {
|
|
|
|
for (nsIFrame* prevInFlow = GetPrevInFlow() ; prevInFlow; prevInFlow = prevInFlow->GetPrevInFlow()) {
|
|
|
|
nsRect rect = prevInFlow->GetRect();
|
|
|
|
if (aWidth) {
|
|
|
|
*aWidth = rect.width;
|
|
|
|
}
|
|
|
|
offset += rect.height;
|
|
|
|
}
|
|
|
|
offset -= mBorderPadding.top;
|
2009-09-16 08:01:36 -07:00
|
|
|
offset = NS_MAX(0, offset);
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
return offset;
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef ACCESSIBILITY
|
2012-05-28 18:18:45 -07:00
|
|
|
already_AddRefed<Accessible>
|
2010-06-28 05:02:03 -07:00
|
|
|
nsHTMLCanvasFrame::CreateAccessible()
|
2007-03-22 10:30:00 -07:00
|
|
|
{
|
2011-11-25 08:58:34 -08:00
|
|
|
nsAccessibilityService* accService = nsIPresShell::AccService();
|
|
|
|
if (accService) {
|
|
|
|
return accService->CreateHTMLCanvasAccessible(mContent, PresContext()->PresShell());
|
|
|
|
}
|
2010-06-28 05:02:03 -07:00
|
|
|
return nsnull;
|
2007-03-22 10:30:00 -07:00
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#ifdef DEBUG
|
|
|
|
NS_IMETHODIMP
|
|
|
|
nsHTMLCanvasFrame::GetFrameName(nsAString& aResult) const
|
|
|
|
{
|
|
|
|
return MakeFrameName(NS_LITERAL_STRING("HTMLCanvas"), aResult);
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|