NAME
HTML::Object::DOM::Element::Object - HTML Object DOM Object Class
SYNOPSIS
use HTML::Object::DOM::Element::Object;
my $object = HTML::Object::DOM::Element::Object->new ||
die( HTML::Object::DOM::Element::Object->error, "\n" );
VERSION
v0.2.0
DESCRIPTION
This interface provides special properties and methods (beyond those on the HTML::Object::Element interface it also has available to it by inheritance) for manipulating the layout and presentation of <object
> element, representing external resources.
It is now deprecated and similarly to <video|HTML::Object::DOM::Element::Video> and <audio|HTML::Object::DOM::Element::Audio> tags, HTML object tag was used to enable embedding multimedia files into the web page, such as audio, video, Flash, PDF, ActiveX, and Java Applets.
<object width="300" height="200" data="https://example.org/some/where/image.png" type="image/png">Image not found.</object>
<object data="document.pdf" width="500" height="350" type="application/pdf"></object>
INHERITANCE
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +------------------------------------+
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Object |
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +------------------------------------+
PROPERTIES
Inherits properties from its parent HTML::Object::DOM::Element
align
Is a string representing an enumerated property indicating alignment of the element's contents with respect to the surrounding context. The possible values are left
, right
, justify
, and center
.
See also Mozilla documentation
archive
Is a string that reflects the archive HTML attribute, containing a list of archives for resources for this object.
See also Mozilla documentation
border
Is a string that reflects the border HTML attribute, specifying the width of a border around the object.
See also Mozilla documentation
code
Is a string representing the name of an applet class file, containing either the applet's subclass, or the path to get to the class, including the class file itself.
See also Mozilla documentation
codeBase
Is a string that reflects the codebase HTML attribute, specifying the base path to use to resolve relative URIs.
See also Mozilla documentation
codeType
Is a string that reflects the codetype HTML attribute, specifying the content type of the data.
See also Mozilla documentation
contentDocument
Normally this is a read-only property, but under perl, you can set or get a HTML::Object::DOM::Document object.
Under JavaScript, this returns a Document representing the active document of the object element's nested browsing context, if any; otherwise undef
.
See also Mozilla documentation
contentWindow
Normally this returns undef
under perl, but you can set it to a HTML::Object::DOM::WindowProxy object.
Under JavaScript, this is a read-only property that returns a WindowProxy
representing the window proxy of the object element's nested browsing context, if any; otherwise undef
.
See also Mozilla documentation
data
Sets or gets an URI object.
This returns a string, turned into an URI, that reflects the data HTML attribute, specifying the address of a resource's data.
See also Mozilla documentation
declare
Is a boolean value that reflects the declare HTML attribute, indicating that this is a declaration, not an instantiation, of the object.
See also Mozilla documentation
form
Read-only.
Returns a HTML::Object::DOM::Element::Form representing the object element's form owner, or undef
if there is not one.
Example:
<form action="/some/where/script.pl" id="form1">
Email: <input type="text" name="email" /><br />
<input type="submit" value="Submit" />
</form>
<object form="form1" width="300" height="200" data="https://example.org/some/where/image.png" type="image/png">Image not found.</object>
See also Mozilla documentation
height
Returns a string that reflects the height HTML attribute, specifying the displayed height of the resource in CSS pixels.
See also Mozilla documentation
hspace
Is a long representing the horizontal space in pixels around the control.
See also Mozilla documentation
name
Returns a string that reflects the name HTML attribute, specifying the name of the browsing context.
Example:
<object data="document.pdf" width="300" height="200" name="board_resolution">Alternate text.</object>
See also Mozilla documentation
standby
Is a string that reflects the standby HTML attribute, specifying a message to display while the object loads.
See also Mozilla documentation
type
Is a string that reflects the type HTML attribute, specifying the MIME type of the resource.
See also Mozilla documentation
typemustmatch
typemustmatch
indicates that the resource should only be embedded if the value of the type attribute matches with the type of the resource provided in the data attribute.
<object data="flashFile.swf" type="image/png" width="550" height="450" typemustmatch></object>
useMap
Is a string that reflects the usemap HTML attribute, specifying a <map> element to use.
Example:
<img src="image.png" width="320" height="320" alt="Dinosaurs" usemap="#dinosaursmap" />
<map name="dinosaursmap">
<area shape="rect" coords="34,44,270,350" alt="Pterodactyl" href="https://example.org/tag/Pterodactyl" />
<area shape="rect" coords="290,172,333,250" alt="Triceratop" href="https://example.org/tag/Triceratop" />
<area shape="circle" coords="337,300,44" alt="Tyrannosaurus" href="https://example.org/tag/Tyrannosaurus" />
</map>
See also Mozilla documentation
validationMessage
Normally this is read-only, but under perl you can set whatever string value you want.
Under JavaScript, this returns a string representing a localized message that describes the validation constraints that the control does not satisfy (if any). This is the empty string if the control is not a candidate for constraint validation (willValidate is false), or it satisfies its constraints.
Example:
my $String = HTMLObjectElement->validationMessage;
See also Mozilla documentation
validity
Read-only.
Returns a HTML::Object::DOM::ValidityState with the validity states that this element is in.
See also Mozilla documentation
vspace
Is a long representing the horizontal space in pixels around the control.
See also Mozilla documentation
width
Is a string that reflects the width HTML attribute, specifying the displayed width of the resource in CSS pixels.
See also Mozilla documentation
willValidate
Normally this is read-only, but under perl you can set whatever boolean value you want.
Under JavaScript, this returns a boolean value that indicates whether the element is a candidate for constraint validation. Always false for HTML::Object::DOM::Element::Object objects.
See also Mozilla documentation
METHODS
Inherits methods from its parent HTML::Object::DOM::Element
checkValidity
Normally this is read-only, but under perl you can set whatever boolean value you want.
Under JavaScript, this returns a boolean value that always is true, because object objects are never candidates for constraint validation.
See also Mozilla documentation
setCustomValidity
Sets a custom validity message for the element. If this message is not the empty string, then the element is suffering from a custom validity error, and does not validate.
Returns a scalar object
Example:
use feature 'signatures';
sub validate( $inputID )
{
my $input = $doc->getElementById( $inputID );
my $validityState = $input->validity;
if( $validityState->valueMissing )
{
$input->setCustomValidity( 'You gotta fill this out, yo!' );
}
elsif( $validityState->rangeUnderflow )
{
$input->setCustomValidity( 'We need a higher number!' );
}
elsif( $validityState->rangeOverflow )
{
$input->setCustomValidity( 'Thats too high!' );
}
else
{
$input->setCustomValidity( '' );
}
$input->reportValidity();
}
See also Mozilla documentation
AUTHOR
Jacques Deguest <jack@deguest.jp>
SEE ALSO
Mozilla documentation, Mozilla documentation on object element
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.