HTML::Object::DOM::Element::Object - HTML Object DOM Object Class
use HTML::Object::DOM::Element::Object; my $object = HTML::Object::DOM::Element::Object->new || die( HTML::Object::DOM::Element::Object->error, "\n" );
v0.2.0
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.
<object
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>
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +------------------------------------+ | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Object | +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +------------------------------------+
Inherits properties from its parent HTML::Object::DOM::Element
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.
left
right
justify
center
See also Mozilla documentation
Is a string that reflects the archive HTML attribute, containing a list of archives for resources for this object.
Is a string that reflects the border HTML attribute, specifying the width of a border around the object.
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.
Is a string that reflects the codebase HTML attribute, specifying the base path to use to resolve relative URIs.
Is a string that reflects the codetype HTML attribute, specifying the content type of the data.
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.
undef
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.
WindowProxy
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.
Is a boolean value that reflects the declare HTML attribute, indicating that this is a declaration, not an instantiation, of the object.
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>
Returns a string that reflects the height HTML attribute, specifying the displayed height of the resource in CSS pixels.
Is a long representing the horizontal space in pixels around the control.
Returns a string that reflects the name HTML attribute, specifying the name of the browsing context.
<object data="document.pdf" width="300" height="200" name="board_resolution">Alternate text.</object>
Is a string that reflects the standby HTML attribute, specifying a message to display while the object loads.
Is a string that reflects the type HTML attribute, specifying the MIME type of the resource.
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.
typemustmatch
<object data="flashFile.swf" type="image/png" width="550" height="450" typemustmatch></object>
Is a string that reflects the usemap HTML attribute, specifying a <map> element to use.
<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>
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.
my $String = HTMLObjectElement->validationMessage;
Returns a HTML::Object::DOM::ValidityState with the validity states that this element is in.
Is a string that reflects the width HTML attribute, specifying the displayed width of the resource in CSS pixels.
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.
Inherits methods from its parent HTML::Object::DOM::Element
Under JavaScript, this returns a boolean value that always is true, because object objects are never candidates for constraint validation.
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
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(); }
Jacques Deguest <jack@deguest.jp>
Mozilla documentation, Mozilla documentation on object element
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.
To install HTML::Object, copy and paste the appropriate command in to your terminal.
cpanm
cpanm HTML::Object
CPAN shell
perl -MCPAN -e shell install HTML::Object
For more information on module installation, please visit the detailed CPAN module installation guide.