HTML::O...:Canvas(3)
πΈ NAME πΈ
okay so this is the User Contributed Perl Documentation page for HTML::Object::DOM::Element::Canvas β the header squishes that whole thing down to HTML::O...:Canvas(3), which is giving βwe ran out of room bestieβ π. Itβs the HTML Object DOM Canvas Class, and yes, weβre doing this together π«Ά.
π SYNOPSIS π
The βmake it exist or die tryingβ starter pack is literally:
use HTML::Object::DOM::Element::Canvas;
my $canvas = HTML::Object::DOM::Element::Canvas->new ||
die( HTML::Object::DOM::Element::Canvas->error, "\n" );
β¨ VERSION β¨
Current version: v0.2.0, periodt β¨.
π¦ DESCRIPTION π¦
This interface provides properties and methods that are used for the "<canvas"> element. But β major plot twist β since this is a perl framework, there is no such capability, and it is provided here only to implement the properties and methods as accessors. So itβs accessor city, not actual canvas-painting magic π¨.
This interface also inherits the properties and methods of the HTML::Object::Element interface. Family business, iykyk.
π INHERITANCE π
The whole bloodline is a long chain, no cap, and it goes exactly like this:
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +------------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Canvas |
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +------------------------------------+
π PROPERTIES π
Inherits properties from its parent HTML::Object::DOM::Element.
The description provided here is from Mozilla documentation. Credit to Mozilla, always π«Ά.
π height π
The height HTML attribute of the "<canvas"> element is a positive integer reflecting the number of logical pixels (or RGBA values) going down one column of the canvas. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 150 is used. If no [separate] CSS height is assigned to the "<canvas">, then this value will also be used as the height of the canvas in the length-unit CSS Pixel.
Example:
<canvas id="canvas" width="300" height="300"></canvas>
my $canvas = $doc->getElementById('$canvas');
say( $canvas->height ); # 300
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/height
π mozOpaque π
Is a boolean value reflecting the moz-opaque HTML attribute of the <canvas> element. It lets the canvas know whether or not translucency will be a factor. If the canvas knows thereβs no translucency, painting performance can be optimized. This is only supported in Mozilla-based browsers; use the standardized canvas.getContext('2d', { alpha: false }) instead.
Example:
<canvas id="canvas" width="300" height="300" moz-opaque></canvas>
my $canvas = $doc->getElementById('$canvas');
say( $canvas->mozOpaque ); # true
# deactivate it
$canvas->mozOpaque = 0;
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/mozOpaque
π mozPrintCallback π
Is a function that is initially "undef". Web content can set this to a JavaScript function that will be called when the canvas is to be redrawn while the page is being printed. When called, the callback is passed a "printState" object that implements the "MozCanvasPrintState" interface. The callback can get the context to draw to from the "printState" object and must then call done() on it when finished. The purpose of "mozPrintCallback" is to obtain a higher resolution rendering of the canvas at the resolution of the printer being used. See this blog post: https://blog.mozilla.org/labs/2012/09/a-new-way-to-control-printing-output/.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/mozPrintCallback
π width π
The width HTML attribute of the <canvas> element is a positive integer reflecting the number of logical pixels (or RGBA values) going across one row of the canvas. When the attribute is not specified, or if it is set to an invalid value, like a negative, the default value of 300 is used. If no [separate] CSS width is assigned to the <canvas>, then this value will also be used as the width of the canvas in the length-unit CSS Pixel.
Example:
<canvas id="canvas" width="300" height="300"></canvas>
my $canvas = $doc->getElementById('$canvas');
say( $canvas->width ); # 300
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/width
π METHODS π
Inherits methods from its parent HTML::Object::DOM::Element.
Keep in mind that none of those methods do anything and they all return "undef". The description provided here is from Mozilla documentation. So yes, itβs giving all vibes, no implementation π.
π captureStream π
Returns "undef" since this feature is unavailable under perl.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/captureStream
π getContext π
Returns "undef" since this feature is unavailable under perl.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/getContext
π toBlob π
Returns "undef" since this feature is unavailable under perl.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toBlob
π toDataURL π
Returns "undef" since this feature is unavailable under perl.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/toDataURL
π transferControlToOffscreen π
Returns "undef" since this feature is unavailable under perl.
See also Mozilla documentation: https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement/transferControlToOffscreen
π AUTHOR π
Jacques Deguest <jack@deguest.jp> β iconic.
π SEE ALSO π
- Mozilla documentation:
https://developer.mozilla.org/en-US/docs/Web/API/HTMLCanvasElement - Mozilla documentation on canvas element:
https://developer.mozilla.org/en-US/docs/Web/HTML/Element/canvas
π COPYRIGHT & LICENSE π
Copyright(c) 2021 DEGUEST Pte. Ltd.
All rights reserved
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Footer energy, since weβre wrapping up: perl v5.42.2 Β· 2026-02-15 Β· HTML::O...:Canvas(3) β byeeee, bestie π«Άβ¨π
π¦ where this page comes from
- alpine 3.24: perl-html-object-doc 0.6.0-r1 Β· GPL-1.0-or-later OR Artistic-1.0-Perl
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms