HTML::Object::DOM::Element::Link - HTML Object DOM Link Class
use HTML::Object::DOM::Element::Link; my $link = HTML::Object::DOM::Element::Link->new || die( HTML::Object::DOM::Element::Link->error, "\n" );
v0.2.0
The LinkElement interface represents reference information for external resources and the relationship of those resources to a document and vice-versa (corresponds to <link> element; not to be confused with <a>, which is represented by HTML::Object::DOM::Element::Anchor). This object inherits all of the properties and methods of the HTML::Object::DOM::Element interface.
LinkElement
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +----------------------------------+ | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Link | +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +----------------------------------+
Inherits properties from its parent HTML::Object::DOM::DOM::Element
A string representing the type of content being loaded by the HTML link.
Example:
<link rel="preload" href="myFont.woff2" as="font" type="font/woff2" crossorigin="anonymous">
See also Mozilla documentation
A string that corresponds to the CORS setting for this link element. See CORS settings attributes for details.
A boolean value which represents whether the link is disabled; currently only used with style sheet links.
If the boolean value provided is false, the disabled property will be removed altogether. If it is true, it will be set to an empty value.
my $link = $doc->createElement( 'link' ); $link->disabled = 1; # <link disabled="" /> $link->disabled = 0; # <link />
A string representing the URI for the target resource.
A string representing the language code for the linked resource.
A string representing a list of one or more media formats to which the resource applies.
<link href="print.css" rel="stylesheet" media="print" /> <link href="mobile.css" rel="stylesheet" media="screen and (max-width: 600px)" />
A string that reflects the referrerpolicy HTML attribute indicating which referrer to use.
A string representing the forward relationship of the linked resource from the document to the resource.
Read-only.
A HTML::Object::TokenList that reflects the rel HTML attribute, as a list of tokens.
A HTML::Object::TokenList that reflects the sizes HTML attribute, as a list of tokens.
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="apple-icon-114.png" type="image/png">
This currently always returns undef. Maybe in the future this would return a CSS::Object object.
undef
Normally, under JavaScript environment, this would return the StyleSheet object associated with the given element, or undef if there is none.
See also Mozilla documentation and also the CSSObject documentation
A string representing the MIME type of the linked resource.
No specific method; inherits methods from its parent, HTML::Object::DOM::DOM::Element
Jacques Deguest <jack@deguest.jp>
Mozilla documentation, specification on link
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.