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