File Coverage

lib/HTML/Object/DOM/Element/Base.pm
Criterion Covered Total %
statement 27 27 100.0
branch 2 4 50.0
condition n/a
subroutine 9 9 100.0
pod 1 1 100.0
total 39 41 95.1


line stmt bran cond sub pod time code
1             ##----------------------------------------------------------------------------
2             ## HTML Object - ~/lib/HTML/Object/DOM/Element/Base.pm
3             ## Version v0.2.0
4             ## Copyright(c) 2021 DEGUEST Pte. Ltd.
5             ## Author: Jacques Deguest <jack@deguest.jp>
6             ## Created 2021/12/26
7             ## Modified 2022/09/18
8             ## All rights reserved
9             ##
10             ##
11             ## This program is free software; you can redistribute it and/or modify it
12             ## under the same terms as Perl itself.
13             ##----------------------------------------------------------------------------
14             package HTML::Object::DOM::Element::Base;
15             BEGIN
16             {
17 2     2   1846 use strict;
  2         6  
  2         77  
18 2     2   16 use warnings;
  2         47  
  2         89  
19 2     2   17 use parent qw( HTML::Object::DOM::Element );
  2         8  
  2         13  
20 2     2   168 use vars qw( $VERSION );
  2         12  
  2         105  
21 2     2   18 use HTML::Object::DOM::Element::Shared qw( :base );
  2         4  
  2         324  
22 2     2   59 our $VERSION = 'v0.2.0';
23             };
24              
25 2     2   12 use strict;
  2         2  
  2         38  
26 2     2   10 use warnings;
  2         6  
  2         258  
27              
28             sub init
29             {
30 1     1 1 86 my $self = shift( @_ );
31 1         151 $self->{_init_strict_use_sub} = 1;
32 1 50       9 $self->SUPER::init( @_ ) || return( $self->pass_error );
33 1 50       5 $self->{tag} = 'base' if( !CORE::length( "$self->{tag}" ) );
34 1         9 return( $self );
35             }
36              
37             # Note: property href inherited
38              
39             # Note: property target inherited
40              
41             1;
42             # NOTE: POD
43             __END__
44              
45             =encoding utf-8
46              
47             =head1 NAME
48              
49             HTML::Object::DOM::Element::Base - HTML Object
50              
51             =head1 SYNOPSIS
52              
53             use HTML::Object::DOM::Element::Base;
54             my $base = HTML::Object::DOM::Element::Base->new ||
55             die( HTML::Object::DOM::Element::Base->error, "\n" );
56              
57             =head1 VERSION
58              
59             v0.2.0
60              
61             =head1 DESCRIPTION
62              
63             This interface contains the base URI for a document. This object inherits all of the properties and methods as described in the L<HTML::Object::Element> interface.
64              
65             =head1 INHERITANCE
66              
67             +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +----------------------------------+
68             | HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Element | --> | HTML::Object::DOM::Element::Base |
69             +-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ +----------------------------------+
70              
71             =head1 PROPERTIES
72              
73             Inherits properties from its parent L<HTML::Object::DOM::Element>
74              
75             =head2 href
76              
77             Is a string that reflects the href HTML attribute, containing a base URL for relative URLs in the document.
78              
79             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLBaseElement/href>
80              
81             =head2 target
82              
83             Is a string that reflects the target HTML attribute, containing a default target browsing context or frame for elements that do not have a target reference specified.
84              
85             See also L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLBaseElement/target>
86              
87             =head1 METHODS
88              
89             Inherits methods from its parent L<HTML::Object::DOM::Element>
90              
91             =head1 AUTHOR
92              
93             Jacques Deguest E<lt>F<jack@deguest.jp>E<gt>
94              
95             =head1 SEE ALSO
96              
97             L<Mozilla documentation|https://developer.mozilla.org/en-US/docs/Web/API/HTMLBaseElement>, L<Mozilla documentation on base element|https://developer.mozilla.org/en-US/docs/Web/HTML/Element/base>
98              
99             =head1 COPYRIGHT & LICENSE
100              
101             Copyright(c) 2021 DEGUEST Pte. Ltd.
102              
103             All rights reserved
104              
105             This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
106              
107             =cut