line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Tags::HTML; |
2
|
|
|
|
|
|
|
|
3
|
7
|
|
|
7
|
|
138348
|
use strict; |
|
7
|
|
|
|
|
52
|
|
|
7
|
|
|
|
|
202
|
|
4
|
7
|
|
|
7
|
|
33
|
use warnings; |
|
7
|
|
|
|
|
17
|
|
|
7
|
|
|
|
|
199
|
|
5
|
|
|
|
|
|
|
|
6
|
7
|
|
|
7
|
|
3093
|
use Class::Utils qw(set_params); |
|
7
|
|
|
|
|
59139
|
|
|
7
|
|
|
|
|
163
|
|
7
|
7
|
|
|
7
|
|
427
|
use Error::Pure qw(err); |
|
7
|
|
|
|
|
15
|
|
|
7
|
|
|
|
|
305
|
|
8
|
7
|
|
|
7
|
|
47
|
use Scalar::Util qw(blessed); |
|
7
|
|
|
|
|
13
|
|
|
7
|
|
|
|
|
5014
|
|
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
our $VERSION = 0.08; |
11
|
|
|
|
|
|
|
|
12
|
|
|
|
|
|
|
# Constructor. |
13
|
|
|
|
|
|
|
sub new { |
14
|
14
|
|
|
14
|
1
|
15188
|
my ($class, @params) = @_; |
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# Create object. |
17
|
14
|
|
|
|
|
79
|
my $self = bless {}, $class; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
# 'CSS::Struct::Output' object. |
20
|
14
|
|
|
|
|
52
|
$self->{'css'} = undef; |
21
|
|
|
|
|
|
|
|
22
|
|
|
|
|
|
|
# No CSS support. |
23
|
14
|
|
|
|
|
29
|
$self->{'no_css'} = 0; |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# 'Tags::Output' object. |
26
|
14
|
|
|
|
|
25
|
$self->{'tags'} = undef; |
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
# Process params. |
29
|
14
|
|
|
|
|
53
|
set_params($self, @params); |
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
# Check to 'CSS::Struct::Output' object. |
32
|
14
|
100
|
100
|
|
|
266
|
if (! $self->{'no_css'} && defined $self->{'css'} |
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
33
|
|
|
|
|
|
|
&& (! blessed($self->{'css'}) || ! $self->{'css'}->isa('CSS::Struct::Output'))) { |
34
|
|
|
|
|
|
|
|
35
|
3
|
|
|
|
|
37
|
err "Parameter 'css' must be a 'CSS::Struct::Output::*' class."; |
36
|
|
|
|
|
|
|
} |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
# Check to 'Tags' object. |
39
|
11
|
100
|
100
|
|
|
78
|
if (defined $self->{'tags'} |
|
|
|
100
|
|
|
|
|
40
|
|
|
|
|
|
|
&& (! blessed($self->{'tags'}) || ! $self->{'tags'}->isa('Tags::Output'))) { |
41
|
|
|
|
|
|
|
|
42
|
3
|
|
|
|
|
57
|
err "Parameter 'tags' must be a 'Tags::Output::*' class."; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
# Object. |
46
|
8
|
|
|
|
|
40
|
return $self; |
47
|
|
|
|
|
|
|
} |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# Cleanup after dynamic part. |
50
|
|
|
|
|
|
|
sub cleanup { |
51
|
1
|
|
|
1
|
1
|
8
|
my ($self, @params) = @_; |
52
|
|
|
|
|
|
|
|
53
|
1
|
|
|
|
|
3
|
$self->_cleanup(@params); |
54
|
|
|
|
|
|
|
|
55
|
1
|
|
|
|
|
2
|
return; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# Initialize in dynamic part. |
59
|
|
|
|
|
|
|
sub init { |
60
|
1
|
|
|
1
|
1
|
6
|
my ($self, @params) = @_; |
61
|
|
|
|
|
|
|
|
62
|
1
|
|
|
|
|
3
|
$self->_init(@params); |
63
|
|
|
|
|
|
|
|
64
|
1
|
|
|
|
|
2
|
return; |
65
|
|
|
|
|
|
|
} |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
# Initialize in preparation phase. |
68
|
|
|
|
|
|
|
sub prepare { |
69
|
0
|
|
|
0
|
1
|
0
|
my ($self, @params) = @_; |
70
|
|
|
|
|
|
|
|
71
|
0
|
|
|
|
|
0
|
$self->_prepare(@params); |
72
|
|
|
|
|
|
|
|
73
|
0
|
|
|
|
|
0
|
return; |
74
|
|
|
|
|
|
|
} |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# Process 'Tags'. |
77
|
|
|
|
|
|
|
sub process { |
78
|
2
|
|
|
2
|
1
|
20
|
my ($self, @params) = @_; |
79
|
|
|
|
|
|
|
|
80
|
2
|
100
|
|
|
|
6
|
if (! defined $self->{'tags'}) { |
81
|
1
|
|
|
|
|
4
|
err "Parameter 'tags' isn't defined."; |
82
|
|
|
|
|
|
|
} |
83
|
|
|
|
|
|
|
|
84
|
1
|
|
|
|
|
5
|
$self->_process(@params); |
85
|
|
|
|
|
|
|
|
86
|
0
|
|
|
|
|
0
|
return; |
87
|
|
|
|
|
|
|
} |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
# Process 'CSS::Struct'. |
90
|
|
|
|
|
|
|
sub process_css { |
91
|
3
|
|
|
3
|
1
|
18
|
my ($self, @params) = @_; |
92
|
|
|
|
|
|
|
|
93
|
|
|
|
|
|
|
# No CSS support. |
94
|
3
|
100
|
|
|
|
8
|
if ($self->{'no_css'}) { |
95
|
1
|
|
|
|
|
5
|
return; |
96
|
|
|
|
|
|
|
} |
97
|
|
|
|
|
|
|
|
98
|
2
|
100
|
|
|
|
7
|
if (! defined $self->{'css'}) { |
99
|
1
|
|
|
|
|
5
|
err "Parameter 'css' isn't defined."; |
100
|
|
|
|
|
|
|
} |
101
|
|
|
|
|
|
|
|
102
|
1
|
|
|
|
|
5
|
$self->_process_css(@params); |
103
|
|
|
|
|
|
|
|
104
|
0
|
|
|
|
|
0
|
return; |
105
|
|
|
|
|
|
|
} |
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
sub _cleanup { |
108
|
1
|
|
|
1
|
|
2
|
my ($self, @params) = @_; |
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
# Default is no special code. |
111
|
|
|
|
|
|
|
|
112
|
1
|
|
|
|
|
2
|
return; |
113
|
|
|
|
|
|
|
} |
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
sub _init { |
116
|
1
|
|
|
1
|
|
4
|
my ($self, @params) = @_; |
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
# Default is no special code. |
119
|
|
|
|
|
|
|
|
120
|
1
|
|
|
|
|
2
|
return; |
121
|
|
|
|
|
|
|
} |
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
sub _prepare { |
124
|
0
|
|
|
0
|
|
0
|
my ($self, @params) = @_; |
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
# Default is no special code. |
127
|
|
|
|
|
|
|
|
128
|
0
|
|
|
|
|
0
|
return; |
129
|
|
|
|
|
|
|
} |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
sub _process { |
132
|
1
|
|
|
1
|
|
2
|
my ($self, @params) = @_; |
133
|
|
|
|
|
|
|
|
134
|
1
|
|
|
|
|
4
|
err "Need to be implemented in inherited class in _process() method."; |
135
|
|
|
|
|
|
|
|
136
|
0
|
|
|
|
|
0
|
return; |
137
|
|
|
|
|
|
|
} |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
sub _process_css { |
140
|
1
|
|
|
1
|
|
2
|
my ($self, @params) = @_; |
141
|
|
|
|
|
|
|
|
142
|
1
|
|
|
|
|
4
|
err "Need to be implemented in inherited class in _process_css() method."; |
143
|
|
|
|
|
|
|
|
144
|
0
|
|
|
|
|
|
return; |
145
|
|
|
|
|
|
|
} |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
1; |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
__END__ |