line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
##---------------------------------------------------------------------------- |
2
|
|
|
|
|
|
|
## HTML Object - ~/lib/HTML/Object/DOM/Closing.pm |
3
|
|
|
|
|
|
|
## Version v0.2.0 |
4
|
|
|
|
|
|
|
## Copyright(c) 2021 DEGUEST Pte. Ltd. |
5
|
|
|
|
|
|
|
## Author: Jacques Deguest <jack@deguest.jp> |
6
|
|
|
|
|
|
|
## Created 2021/12/13 |
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::Closing; |
15
|
|
|
|
|
|
|
BEGIN |
16
|
|
|
|
|
|
|
{ |
17
|
28
|
|
|
28
|
|
283
|
use strict; |
|
28
|
|
|
|
|
119
|
|
|
28
|
|
|
|
|
1503
|
|
18
|
28
|
|
|
28
|
|
294
|
use warnings; |
|
28
|
|
|
|
|
116
|
|
|
28
|
|
|
|
|
2087
|
|
19
|
28
|
|
|
28
|
|
294
|
use parent qw( HTML::Object::Closing HTML::Object::DOM::Node ); |
|
28
|
|
|
|
|
126
|
|
|
28
|
|
|
|
|
384
|
|
20
|
28
|
|
|
28
|
|
2744
|
use vars qw( $VERSION ); |
|
28
|
|
|
|
|
86
|
|
|
28
|
|
|
|
|
2020
|
|
21
|
28
|
|
|
28
|
|
582
|
our $VERSION = 'v0.2.0'; |
22
|
|
|
|
|
|
|
}; |
23
|
|
|
|
|
|
|
|
24
|
28
|
|
|
28
|
|
189
|
use strict; |
|
28
|
|
|
|
|
68
|
|
|
28
|
|
|
|
|
587
|
|
25
|
28
|
|
|
28
|
|
2887
|
use warnings; |
|
28
|
|
|
|
|
83
|
|
|
28
|
|
|
|
|
9516
|
|
26
|
|
|
|
|
|
|
|
27
|
|
|
|
|
|
|
sub init |
28
|
|
|
|
|
|
|
{ |
29
|
244
|
|
|
244
|
1
|
21673
|
my $self = shift( @_ ); |
30
|
244
|
|
|
|
|
3641
|
$self->{_init_strict_use_sub} = 1; |
31
|
244
|
50
|
|
|
|
2372
|
$self->HTML::Object::Closing::init( @_ ) || return( $self->pass_error ); |
32
|
244
|
|
|
|
|
1120
|
return( $self ); |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
0
|
0
|
|
0
|
1
|
|
sub getAttributes { return( wantarray() ? () : [] ); } |
36
|
|
|
|
|
|
|
|
37
|
0
|
0
|
|
0
|
1
|
|
sub getChildNodes { return( wantarray() ? () : [] ); } |
38
|
|
|
|
|
|
|
|
39
|
0
|
|
|
0
|
1
|
|
sub getElementById { return; } |
40
|
|
|
|
|
|
|
|
41
|
0
|
|
|
0
|
1
|
|
sub getFirstChild { return; } |
42
|
|
|
|
|
|
|
|
43
|
0
|
|
|
0
|
1
|
|
sub getLastChild { return; } |
44
|
|
|
|
|
|
|
|
45
|
0
|
|
|
0
|
1
|
|
sub getParentNode { return( shift->parent ); } |
46
|
|
|
|
|
|
|
|
47
|
0
|
|
|
0
|
1
|
|
sub getRootNode { return( shift->parent->getRootNode ); } |
48
|
|
|
|
|
|
|
|
49
|
0
|
|
|
0
|
1
|
|
sub isAttributeNode { return(0); } |
50
|
|
|
|
|
|
|
|
51
|
0
|
|
|
0
|
1
|
|
sub isCommentNode { return(0); } |
52
|
|
|
|
|
|
|
|
53
|
0
|
|
|
0
|
1
|
|
sub isElementNode { return(0); } |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
sub isEqualNode |
56
|
|
|
|
|
|
|
{ |
57
|
0
|
|
|
0
|
1
|
|
my $self = shift( @_ ); |
58
|
0
|
|
0
|
|
|
|
my $e = shift( @_ ) || return( $self->error( "No html element was provided to insert." ) ); |
59
|
0
|
0
|
|
|
|
|
return( $self->error( "Element provided (", overload::StrVal( $e ), ") is not an HTML::Object::Element." ) ) if( !$self->_is_a( $e => 'HTML::Object::Element' ) ); |
60
|
0
|
0
|
|
|
|
|
return(0) if( !$self->_is_a( $e => 'HTML::Object::Closing' ) ); |
61
|
0
|
|
|
|
|
|
return( $self->tag eq $e->tag ); |
62
|
|
|
|
|
|
|
} |
63
|
0
|
|
|
0
|
1
|
|
sub isNamespaceNode { return(0); } |
64
|
|
|
|
|
|
|
|
65
|
0
|
|
|
0
|
1
|
|
sub isPINode { return(0); } |
66
|
|
|
|
|
|
|
|
67
|
0
|
|
|
0
|
1
|
|
sub isProcessingInstructionNode { return(0); } |
68
|
|
|
|
|
|
|
|
69
|
0
|
|
|
0
|
1
|
|
sub isTextNode { return(0); } |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
1; |
72
|
|
|
|
|
|
|
# NOTE: POD |
73
|
|
|
|
|
|
|
__END__ |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
=encoding utf-8 |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
=head1 NAME |
78
|
|
|
|
|
|
|
|
79
|
|
|
|
|
|
|
HTML::Object::DOM::Closing - HTML Object |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=head1 SYNOPSIS |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
use HTML::Object::DOM::Closing; |
84
|
|
|
|
|
|
|
my $this = HTML::Object::DOM::Closing->new( tag => 'div' ) || |
85
|
|
|
|
|
|
|
die( HTML::Object::DOM::Closing->error, "\n" ); |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
=head1 VERSION |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
v0.2.0 |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
=head1 DESCRIPTION |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
This module implements a closing tag for the DOM. It inherits from L<HTML::Object::Closing> and L<HTML::Object::DOM::Node> |
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
Closing tags exists, but are not part of the nodes, so they are transparent. |
96
|
|
|
|
|
|
|
|
97
|
|
|
|
|
|
|
=head1 INHERITANCE |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ |
100
|
|
|
|
|
|
|
| HTML::Object::Element | --> | HTML::Object::EventTarget | --> | HTML::Object::DOM::Node | --> | HTML::Object::DOM::Closing | |
101
|
|
|
|
|
|
|
+-----------------------+ +---------------------------+ +-------------------------+ +----------------------------+ |
102
|
|
|
|
|
|
|
| ^ |
103
|
|
|
|
|
|
|
| | |
104
|
|
|
|
|
|
|
v | |
105
|
|
|
|
|
|
|
+-----------------------+ | |
106
|
|
|
|
|
|
|
| HTML::Object::Closing | ------------------------------------------------------------------------+ |
107
|
|
|
|
|
|
|
+-----------------------+ |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 PROPERTIES |
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
There is no property. |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 METHODS |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
=head2 getAttributes |
116
|
|
|
|
|
|
|
|
117
|
|
|
|
|
|
|
Returns an empty list in list context, or an empty array reference in scalar context. |
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head2 getChildNodes |
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
Returns an empty list in list context, or an empty array reference in scalar context. |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=head2 getElementById |
124
|
|
|
|
|
|
|
|
125
|
|
|
|
|
|
|
Returns an empty list in list context, or C<undef> in scalar context. |
126
|
|
|
|
|
|
|
|
127
|
|
|
|
|
|
|
=head2 getFirstChild |
128
|
|
|
|
|
|
|
|
129
|
|
|
|
|
|
|
Returns an empty list in list context, or C<undef> in scalar context. |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
=head2 getLastChild |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
Returns an empty list in list context, or C<undef> in scalar context. |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
=head2 getParentNode |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
Returns the parent node, if any. |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
=head2 getRootNode |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
Returns the L<root node|HTML::Object::DOM::Document> |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
=head2 isAttributeNode |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
Returns false. |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
=head2 isCommentNode |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
Returns false. |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
=head2 isElementNode |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
Returns false. |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
=head2 isEqualNode |
156
|
|
|
|
|
|
|
|
157
|
|
|
|
|
|
|
Provided with another element object, and this returns true if both closing element have the same tag value, or false otherwise. |
158
|
|
|
|
|
|
|
|
159
|
|
|
|
|
|
|
=head2 isNamespaceNode |
160
|
|
|
|
|
|
|
|
161
|
|
|
|
|
|
|
Returns false. |
162
|
|
|
|
|
|
|
|
163
|
|
|
|
|
|
|
=head2 isPINode |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
Returns false. |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=head2 isProcessingInstructionNode |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
Returns false. |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=head2 isTextNode |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
Returns false. |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=head1 AUTHOR |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
Jacques Deguest E<lt>F<jack@deguest.jp>E<gt> |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=head1 SEE ALSO |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
L<HTML::Object::Element/close> |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=head1 COPYRIGHT & LICENSE |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
Copyright(c) 2021 DEGUEST Pte. Ltd. |
186
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
All rights reserved |
188
|
|
|
|
|
|
|
|
189
|
|
|
|
|
|
|
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. |
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
=cut |