Source code

Revision control

Other Tools

1
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
3
/* This Source Code Form is subject to the terms of the Mozilla Public
4
* License, v. 2.0. If a copy of the MPL was not distributed with this
5
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6
7
/* rendering object for the HTML <canvas> element */
8
9
#include "nsHTMLCanvasFrame.h"
10
11
#include "nsGkAtoms.h"
12
#include "mozilla/Assertions.h"
13
#include "mozilla/PresShell.h"
14
#include "mozilla/dom/HTMLCanvasElement.h"
15
#include "mozilla/layers/WebRenderBridgeChild.h"
16
#include "mozilla/layers/WebRenderCanvasRenderer.h"
17
#include "mozilla/layers/RenderRootStateManager.h"
18
#include "nsDisplayList.h"
19
#include "nsLayoutUtils.h"
20
#include "nsStyleUtil.h"
21
#include "ImageLayers.h"
22
#include "Layers.h"
23
#include "ActiveLayerTracker.h"
24
25
#include <algorithm>
26
27
using namespace mozilla;
28
using namespace mozilla::dom;
29
using namespace mozilla::layers;
30
using namespace mozilla::gfx;
31
32
/* Helper for our nsIFrame::GetIntrinsicSize() impl. Takes the result of
33
* "GetCanvasSize()" as a parameter, which may help avoid redundant
34
* indirect calls to GetCanvasSize().
35
*
36
* @param aCanvasSizeInPx The canvas's size in CSS pixels, as returned
37
* by GetCanvasSize().
38
* @return The canvas's intrinsic size, as an IntrinsicSize object.
39
*/
40
static IntrinsicSize IntrinsicSizeFromCanvasSize(
41
const nsIntSize& aCanvasSizeInPx) {
42
return IntrinsicSize(
43
nsPresContext::CSSPixelsToAppUnits(aCanvasSizeInPx.width),
44
nsPresContext::CSSPixelsToAppUnits(aCanvasSizeInPx.height));
45
}
46
47
/* Helper for our nsIFrame::GetIntrinsicRatio() impl. Takes the result of
48
* "GetCanvasSize()" as a parameter, which may help avoid redundant
49
* indirect calls to GetCanvasSize().
50
*
51
* @param aCanvasSizeInPx The canvas's size in CSS pixels, as returned
52
* by GetCanvasSize().
53
* @return The canvas's intrinsic ratio, as a nsSize.
54
*/
55
static AspectRatio IntrinsicRatioFromCanvasSize(
56
const nsIntSize& aCanvasSizeInPx) {
57
return AspectRatio::FromSize(aCanvasSizeInPx.width, aCanvasSizeInPx.height);
58
}
59
60
class nsDisplayCanvas final : public nsPaintedDisplayItem {
61
public:
62
nsDisplayCanvas(nsDisplayListBuilder* aBuilder, nsIFrame* aFrame)
63
: nsPaintedDisplayItem(aBuilder, aFrame) {
64
MOZ_COUNT_CTOR(nsDisplayCanvas);
65
}
66
#ifdef NS_BUILD_REFCNT_LOGGING
67
virtual ~nsDisplayCanvas() { MOZ_COUNT_DTOR(nsDisplayCanvas); }
68
#endif
69
70
NS_DISPLAY_DECL_NAME("nsDisplayCanvas", TYPE_CANVAS)
71
72
virtual nsRegion GetOpaqueRegion(nsDisplayListBuilder* aBuilder,
73
bool* aSnap) const override {
74
*aSnap = false;
75
nsHTMLCanvasFrame* f = static_cast<nsHTMLCanvasFrame*>(Frame());
76
HTMLCanvasElement* canvas = HTMLCanvasElement::FromNode(f->GetContent());
77
nsRegion result;
78
if (canvas->GetIsOpaque()) {
79
// OK, the entire region painted by the canvas is opaque. But what is
80
// that region? It's the canvas's "dest rect" (controlled by the
81
// object-fit/object-position CSS properties), clipped to the container's
82
// content box (which is what GetBounds() returns). So, we grab those
83
// rects and intersect them.
84
nsRect constraintRect = GetBounds(aBuilder, aSnap);
85
86
// Need intrinsic size & ratio, for ComputeObjectDestRect:
87
nsIntSize canvasSize = f->GetCanvasSize();
88
IntrinsicSize intrinsicSize = IntrinsicSizeFromCanvasSize(canvasSize);
89
AspectRatio intrinsicRatio = IntrinsicRatioFromCanvasSize(canvasSize);
90
91
const nsRect destRect = nsLayoutUtils::ComputeObjectDestRect(
92
constraintRect, intrinsicSize, intrinsicRatio, f->StylePosition());
93
return nsRegion(destRect.Intersect(constraintRect));
94
}
95
return result;
96
}
97
98
virtual nsRect GetBounds(nsDisplayListBuilder* aBuilder,
99
bool* aSnap) const override {
100
*aSnap = true;
101
nsHTMLCanvasFrame* f = static_cast<nsHTMLCanvasFrame*>(Frame());
102
return f->GetInnerArea() + ToReferenceFrame();
103
}
104
105
virtual already_AddRefed<Layer> BuildLayer(
106
nsDisplayListBuilder* aBuilder, LayerManager* aManager,
107
const ContainerLayerParameters& aContainerParameters) override {
108
return static_cast<nsHTMLCanvasFrame*>(mFrame)->BuildLayer(
109
aBuilder, aManager, this, aContainerParameters);
110
}
111
112
virtual bool CreateWebRenderCommands(
113
mozilla::wr::DisplayListBuilder& aBuilder,
114
wr::IpcResourceUpdateQueue& aResources, const StackingContextHelper& aSc,
115
mozilla::layers::RenderRootStateManager* aManager,
116
nsDisplayListBuilder* aDisplayListBuilder) override {
117
HTMLCanvasElement* element =
118
static_cast<HTMLCanvasElement*>(mFrame->GetContent());
119
element->HandlePrintCallback(mFrame->PresContext()->Type());
120
121
switch (element->GetCurrentContextType()) {
122
case CanvasContextType::Canvas2D:
123
case CanvasContextType::WebGL1:
124
case CanvasContextType::WebGL2: {
125
bool isRecycled;
126
RefPtr<WebRenderCanvasData> canvasData =
127
aManager->CommandBuilder()
128
.CreateOrRecycleWebRenderUserData<WebRenderCanvasData>(
129
this, aBuilder.GetRenderRoot(), &isRecycled);
130
nsHTMLCanvasFrame* canvasFrame =
131
static_cast<nsHTMLCanvasFrame*>(mFrame);
132
if (!canvasFrame->UpdateWebRenderCanvasData(aDisplayListBuilder,
133
canvasData)) {
134
return true;
135
}
136
WebRenderCanvasRendererAsync* data =
137
static_cast<WebRenderCanvasRendererAsync*>(
138
canvasData->GetCanvasRenderer());
139
MOZ_ASSERT(data);
140
data->UpdateCompositableClient(aBuilder.GetRenderRoot());
141
142
// Push IFrame for async image pipeline.
143
// XXX Remove this once partial display list update is supported.
144
145
nsIntSize canvasSizeInPx = data->GetSize();
146
IntrinsicSize intrinsicSize =
147
IntrinsicSizeFromCanvasSize(canvasSizeInPx);
148
AspectRatio intrinsicRatio =
149
IntrinsicRatioFromCanvasSize(canvasSizeInPx);
150
151
nsRect area =
152
mFrame->GetContentRectRelativeToSelf() + ToReferenceFrame();
153
nsRect dest = nsLayoutUtils::ComputeObjectDestRect(
154
area, intrinsicSize, intrinsicRatio, mFrame->StylePosition());
155
156
LayoutDeviceRect bounds = LayoutDeviceRect::FromAppUnits(
157
dest, mFrame->PresContext()->AppUnitsPerDevPixel());
158
159
// We don't push a stacking context for this async image pipeline here.
160
// Instead, we do it inside the iframe that hosts the image. As a
161
// result, a bunch of the calculations normally done as part of that
162
// stacking context need to be done manually and pushed over to the
163
// parent side, where it will be done when we build the display list for
164
// the iframe. That happens in WebRenderCompositableHolder.
165
166
wr::LayoutRect r = wr::ToRoundedLayoutRect(bounds);
167
aBuilder.PushIFrame(r, !BackfaceIsHidden(), data->GetPipelineId().ref(),
168
/*ignoreMissingPipelines*/ false);
169
170
gfx::Matrix4x4 scTransform;
171
gfxRect destGFXRect = mFrame->PresContext()->AppUnitsToGfxUnits(dest);
172
scTransform.PreScale(destGFXRect.Width() / canvasSizeInPx.width,
173
destGFXRect.Height() / canvasSizeInPx.height,
174
1.0f);
175
176
MaybeIntSize scaleToSize;
177
LayoutDeviceRect scBounds(LayoutDevicePoint(0, 0), bounds.Size());
178
wr::ImageRendering filter = wr::ToImageRendering(
179
nsLayoutUtils::GetSamplingFilterForFrame(mFrame));
180
wr::MixBlendMode mixBlendMode = wr::MixBlendMode::Normal;
181
aManager->WrBridge()->AddWebRenderParentCommand(
182
OpUpdateAsyncImagePipeline(data->GetPipelineId().value(), scBounds,
183
scTransform, scaleToSize, filter,
184
mixBlendMode),
185
aBuilder.GetRenderRoot());
186
break;
187
}
188
case CanvasContextType::ImageBitmap: {
189
// TODO: Support ImageBitmap
190
break;
191
}
192
case CanvasContextType::NoContext:
193
return false;
194
}
195
return true;
196
}
197
198
virtual LayerState GetLayerState(
199
nsDisplayListBuilder* aBuilder, LayerManager* aManager,
200
const ContainerLayerParameters& aParameters) override {
201
if (HTMLCanvasElement::FromNode(mFrame->GetContent())
202
->ShouldForceInactiveLayer(aManager))
203
return LayerState::LAYER_INACTIVE;
204
205
// If compositing is cheap, just do that
206
if (aManager->IsCompositingCheap() ||
207
ActiveLayerTracker::IsContentActive(mFrame))
208
return mozilla::LayerState::LAYER_ACTIVE;
209
210
return LayerState::LAYER_INACTIVE;
211
}
212
213
// FirstContentfulPaint is supposed to ignore "white" canvases. We use
214
// MaybeModified (if GetContext() was called on the canvas) as a standin for
215
// "white"
216
virtual bool IsContentful() const override {
217
nsHTMLCanvasFrame* f = static_cast<nsHTMLCanvasFrame*>(Frame());
218
HTMLCanvasElement* canvas = HTMLCanvasElement::FromNode(f->GetContent());
219
return canvas->MaybeModified();
220
}
221
};
222
223
nsIFrame* NS_NewHTMLCanvasFrame(PresShell* aPresShell, ComputedStyle* aStyle) {
224
return new (aPresShell)
225
nsHTMLCanvasFrame(aStyle, aPresShell->GetPresContext());
226
}
227
228
NS_QUERYFRAME_HEAD(nsHTMLCanvasFrame)
229
NS_QUERYFRAME_ENTRY(nsHTMLCanvasFrame)
230
NS_QUERYFRAME_TAIL_INHERITING(nsContainerFrame)
231
232
NS_IMPL_FRAMEARENA_HELPERS(nsHTMLCanvasFrame)
233
234
void nsHTMLCanvasFrame::Init(nsIContent* aContent, nsContainerFrame* aParent,
235
nsIFrame* aPrevInFlow) {
236
nsContainerFrame::Init(aContent, aParent, aPrevInFlow);
237
238
// We can fill in the canvas before the canvas frame is created, in
239
// which case we never get around to marking the content as active. Therefore,
240
// we mark it active here when we create the frame.
241
ActiveLayerTracker::NotifyContentChange(this);
242
}
243
244
nsHTMLCanvasFrame::~nsHTMLCanvasFrame() {}
245
246
nsIntSize nsHTMLCanvasFrame::GetCanvasSize() {
247
nsIntSize size(0, 0);
248
HTMLCanvasElement* canvas = HTMLCanvasElement::FromNodeOrNull(GetContent());
249
if (canvas) {
250
size = canvas->GetSize();
251
MOZ_ASSERT(size.width >= 0 && size.height >= 0,
252
"we should've required <canvas> width/height attrs to be "
253
"unsigned (non-negative) values");
254
} else {
255
MOZ_ASSERT_UNREACHABLE("couldn't get canvas size");
256
}
257
258
return size;
259
}
260
261
/* virtual */
262
nscoord nsHTMLCanvasFrame::GetMinISize(gfxContext* aRenderingContext) {
263
// XXX The caller doesn't account for constraints of the height,
264
// min-height, and max-height properties.
265
bool vertical = GetWritingMode().IsVertical();
266
nscoord result;
267
if (StyleDisplay()->IsContainSize()) {
268
result = 0;
269
} else {
270
result = nsPresContext::CSSPixelsToAppUnits(
271
vertical ? GetCanvasSize().height : GetCanvasSize().width);
272
}
273
DISPLAY_MIN_INLINE_SIZE(this, result);
274
return result;
275
}
276
277
/* virtual */
278
nscoord nsHTMLCanvasFrame::GetPrefISize(gfxContext* aRenderingContext) {
279
// XXX The caller doesn't account for constraints of the height,
280
// min-height, and max-height properties.
281
bool vertical = GetWritingMode().IsVertical();
282
nscoord result;
283
if (StyleDisplay()->IsContainSize()) {
284
result = 0;
285
} else {
286
result = nsPresContext::CSSPixelsToAppUnits(
287
vertical ? GetCanvasSize().height : GetCanvasSize().width);
288
}
289
DISPLAY_PREF_INLINE_SIZE(this, result);
290
return result;
291
}
292
293
/* virtual */
294
IntrinsicSize nsHTMLCanvasFrame::GetIntrinsicSize() {
295
if (StyleDisplay()->IsContainSize()) {
296
return IntrinsicSize(0, 0);
297
}
298
return IntrinsicSizeFromCanvasSize(GetCanvasSize());
299
}
300
301
/* virtual */
302
AspectRatio nsHTMLCanvasFrame::GetIntrinsicRatio() {
303
if (StyleDisplay()->IsContainSize()) {
304
return AspectRatio();
305
}
306
return IntrinsicRatioFromCanvasSize(GetCanvasSize());
307
}
308
309
/* virtual */
310
LogicalSize nsHTMLCanvasFrame::ComputeSize(
311
gfxContext* aRenderingContext, WritingMode aWM, const LogicalSize& aCBSize,
312
nscoord aAvailableISize, const LogicalSize& aMargin,
313
const LogicalSize& aBorder, const LogicalSize& aPadding,
314
ComputeSizeFlags aFlags) {
315
IntrinsicSize intrinsicSize;
316
AspectRatio intrinsicRatio;
317
if (StyleDisplay()->IsContainSize()) {
318
intrinsicSize = IntrinsicSize(0, 0);
319
// intrinsicRatio is already implicitly zero via default ctor.
320
} else {
321
nsIntSize canvasSizeInPx = GetCanvasSize();
322
intrinsicSize = IntrinsicSizeFromCanvasSize(canvasSizeInPx);
323
intrinsicRatio = IntrinsicRatioFromCanvasSize(canvasSizeInPx);
324
}
325
326
return ComputeSizeWithIntrinsicDimensions(
327
aRenderingContext, aWM, intrinsicSize, intrinsicRatio, aCBSize, aMargin,
328
aBorder, aPadding, aFlags);
329
}
330
331
void nsHTMLCanvasFrame::Reflow(nsPresContext* aPresContext,
332
ReflowOutput& aMetrics,
333
const ReflowInput& aReflowInput,
334
nsReflowStatus& aStatus) {
335
MarkInReflow();
336
DO_GLOBAL_REFLOW_COUNT("nsHTMLCanvasFrame");
337
DISPLAY_REFLOW(aPresContext, this, aReflowInput, aMetrics, aStatus);
338
MOZ_ASSERT(aStatus.IsEmpty(), "Caller should pass a fresh reflow status!");
339
NS_FRAME_TRACE(
340
NS_FRAME_TRACE_CALLS,
341
("enter nsHTMLCanvasFrame::Reflow: availSize=%d,%d",
342
aReflowInput.AvailableWidth(), aReflowInput.AvailableHeight()));
343
344
MOZ_ASSERT(mState & NS_FRAME_IN_REFLOW, "frame is not in reflow");
345
346
WritingMode wm = aReflowInput.GetWritingMode();
347
LogicalSize finalSize = aReflowInput.ComputedSize();
348
349
// stash this away so we can compute our inner area later
350
mBorderPadding = aReflowInput.ComputedLogicalBorderPadding();
351
352
finalSize.ISize(wm) += mBorderPadding.IStartEnd(wm);
353
finalSize.BSize(wm) += mBorderPadding.BStartEnd(wm);
354
355
if (GetPrevInFlow()) {
356
nscoord y = GetContinuationOffset(&finalSize.ISize(wm));
357
finalSize.BSize(wm) -= y + mBorderPadding.BStart(wm);
358
finalSize.BSize(wm) = std::max(0, finalSize.BSize(wm));
359
}
360
361
aMetrics.SetSize(wm, finalSize);
362
aMetrics.SetOverflowAreasToDesiredBounds();
363
FinishAndStoreOverflow(&aMetrics);
364
365
// Reflow the single anon block child.
366
nsReflowStatus childStatus;
367
nsIFrame* childFrame = mFrames.FirstChild();
368
WritingMode childWM = childFrame->GetWritingMode();
369
LogicalSize availSize = aReflowInput.ComputedSize(childWM);
370
availSize.BSize(childWM) = NS_UNCONSTRAINEDSIZE;
371
NS_ASSERTION(!childFrame->GetNextSibling(), "HTML canvas should have 1 kid");
372
ReflowOutput childDesiredSize(aReflowInput.GetWritingMode());
373
ReflowInput childReflowInput(aPresContext, aReflowInput, childFrame,
374
availSize);
375
ReflowChild(childFrame, aPresContext, childDesiredSize, childReflowInput, 0,
376
0, 0, childStatus, nullptr);
377
FinishReflowChild(childFrame, aPresContext, childDesiredSize,
378
&childReflowInput, 0, 0, 0);
379
380
NS_FRAME_TRACE(NS_FRAME_TRACE_CALLS,
381
("exit nsHTMLCanvasFrame::Reflow: size=%d,%d",
382
aMetrics.ISize(wm), aMetrics.BSize(wm)));
383
NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics);
384
}
385
386
// FIXME taken from nsImageFrame, but then had splittable frame stuff
387
// removed. That needs to be fixed.
388
// XXXdholbert As in nsImageFrame, this function's clients should probably
389
// just be calling GetContentRectRelativeToSelf().
390
nsRect nsHTMLCanvasFrame::GetInnerArea() const {
391
nsMargin bp = mBorderPadding.GetPhysicalMargin(GetWritingMode());
392
nsRect r;
393
r.x = bp.left;
394
r.y = bp.top;
395
r.width = mRect.width - bp.left - bp.right;
396
r.height = mRect.height - bp.top - bp.bottom;
397
return r;
398
}
399
400
already_AddRefed<Layer> nsHTMLCanvasFrame::BuildLayer(
401
nsDisplayListBuilder* aBuilder, LayerManager* aManager,
402
nsDisplayItem* aItem,
403
const ContainerLayerParameters& aContainerParameters) {
404
nsRect area = GetContentRectRelativeToSelf() + aItem->ToReferenceFrame();
405
HTMLCanvasElement* element = static_cast<HTMLCanvasElement*>(GetContent());
406
nsIntSize canvasSizeInPx = GetCanvasSize();
407
408
nsPresContext* presContext = PresContext();
409
element->HandlePrintCallback(presContext->Type());
410
411
if (canvasSizeInPx.width <= 0 || canvasSizeInPx.height <= 0 || area.IsEmpty())
412
return nullptr;
413
414
CanvasLayer* oldLayer = static_cast<CanvasLayer*>(
415
aManager->GetLayerBuilder()->GetLeafLayerFor(aBuilder, aItem));
416
RefPtr<Layer> layer = element->GetCanvasLayer(aBuilder, oldLayer, aManager);
417
if (!layer) return nullptr;
418
419
IntrinsicSize intrinsicSize = IntrinsicSizeFromCanvasSize(canvasSizeInPx);
420
AspectRatio intrinsicRatio = IntrinsicRatioFromCanvasSize(canvasSizeInPx);
421
422
nsRect dest = nsLayoutUtils::ComputeObjectDestRect(
423
area, intrinsicSize, intrinsicRatio, StylePosition());
424
425
gfxRect destGFXRect = presContext->AppUnitsToGfxUnits(dest);
426
427
// Transform the canvas into the right place
428
gfxPoint p = destGFXRect.TopLeft() + aContainerParameters.mOffset;
429
Matrix transform = Matrix::Translation(p.x, p.y);
430
transform.PreScale(destGFXRect.Width() / canvasSizeInPx.width,
431
destGFXRect.Height() / canvasSizeInPx.height);
432
layer->SetBaseTransform(gfx::Matrix4x4::From2D(transform));
433
if (layer->GetType() == layers::Layer::TYPE_CANVAS) {
434
RefPtr<CanvasLayer> canvasLayer = static_cast<CanvasLayer*>(layer.get());
435
canvasLayer->SetSamplingFilter(
436
nsLayoutUtils::GetSamplingFilterForFrame(this));
437
nsIntRect bounds;
438
bounds.SetRect(0, 0, canvasSizeInPx.width, canvasSizeInPx.height);
439
canvasLayer->SetBounds(bounds);
440
} else if (layer->GetType() == layers::Layer::TYPE_IMAGE) {
441
RefPtr<ImageLayer> imageLayer = static_cast<ImageLayer*>(layer.get());
442
imageLayer->SetSamplingFilter(
443
nsLayoutUtils::GetSamplingFilterForFrame(this));
444
}
445
446
return layer.forget();
447
}
448
449
bool nsHTMLCanvasFrame::UpdateWebRenderCanvasData(
450
nsDisplayListBuilder* aBuilder, WebRenderCanvasData* aCanvasData) {
451
HTMLCanvasElement* element = static_cast<HTMLCanvasElement*>(GetContent());
452
return element->UpdateWebRenderCanvasData(aBuilder, aCanvasData);
453
}
454
455
void nsHTMLCanvasFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
456
const nsDisplayListSet& aLists) {
457
if (!IsVisibleForPainting()) return;
458
459
DisplayBorderBackgroundOutline(aBuilder, aLists);
460
461
uint32_t clipFlags =
462
nsStyleUtil::ObjectPropsMightCauseOverflow(StylePosition())
463
? 0
464
: DisplayListClipState::ASSUME_DRAWING_RESTRICTED_TO_CONTENT_RECT;
465
466
DisplayListClipState::AutoClipContainingBlockDescendantsToContentBox clip(
467
aBuilder, this, clipFlags);
468
469
aLists.Content()->AppendNewToTop<nsDisplayCanvas>(aBuilder, this);
470
471
DisplaySelectionOverlay(aBuilder, aLists.Content(),
472
nsISelectionDisplay::DISPLAY_IMAGES);
473
}
474
475
// get the offset into the content area of the image where aImg starts if it is
476
// a continuation. from nsImageFrame
477
nscoord nsHTMLCanvasFrame::GetContinuationOffset(nscoord* aWidth) const {
478
nscoord offset = 0;
479
if (aWidth) {
480
*aWidth = 0;
481
}
482
483
if (GetPrevInFlow()) {
484
for (nsIFrame* prevInFlow = GetPrevInFlow(); prevInFlow;
485
prevInFlow = prevInFlow->GetPrevInFlow()) {
486
nsRect rect = prevInFlow->GetRect();
487
if (aWidth) {
488
*aWidth = rect.width;
489
}
490
offset += rect.height;
491
}
492
offset -= mBorderPadding.GetPhysicalMargin(GetWritingMode()).top;
493
offset = std::max(0, offset);
494
}
495
return offset;
496
}
497
498
void nsHTMLCanvasFrame::AppendDirectlyOwnedAnonBoxes(
499
nsTArray<OwnedAnonBox>& aResult) {
500
MOZ_ASSERT(mFrames.FirstChild(), "Must have our canvas content anon box");
501
MOZ_ASSERT(!mFrames.FirstChild()->GetNextSibling(),
502
"Must only have our canvas content anon box");
503
aResult.AppendElement(OwnedAnonBox(mFrames.FirstChild()));
504
}
505
506
#ifdef ACCESSIBILITY
507
a11y::AccType nsHTMLCanvasFrame::AccessibleType() {
508
return a11y::eHTMLCanvasType;
509
}
510
#endif
511
512
#ifdef DEBUG_FRAME_DUMP
513
nsresult nsHTMLCanvasFrame::GetFrameName(nsAString& aResult) const {
514
return MakeFrameName(NS_LITERAL_STRING("HTMLCanvas"), aResult);
515
}
516
#endif