line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Zoom::Producer::BuiltIn; |
2
|
|
|
|
|
|
|
|
3
|
14
|
|
|
14
|
|
1095
|
use strictures 1; |
|
14
|
|
|
|
|
121
|
|
|
14
|
|
|
|
|
427
|
|
4
|
14
|
|
|
14
|
|
1160
|
use base qw(HTML::Zoom::SubObject); |
|
14
|
|
|
|
|
29
|
|
|
14
|
|
|
|
|
6437
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub html_from_stream { |
7
|
85
|
|
|
85
|
0
|
137
|
my ($self, $stream) = @_; |
8
|
|
|
|
|
|
|
return |
9
|
85
|
|
|
|
|
345
|
join '', |
10
|
|
|
|
|
|
|
map $self->event_to_html($_), |
11
|
|
|
|
|
|
|
$self->_zconfig->stream_utils->stream_to_array($stream) |
12
|
|
|
|
|
|
|
} |
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
sub html_from_events { |
15
|
2
|
|
|
2
|
0
|
5
|
my ($self, $events) = @_; |
16
|
2
|
|
|
|
|
8
|
join '', map $self->event_to_html($_), @$events; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub event_to_html { |
20
|
1243
|
|
|
1243
|
0
|
1662
|
my ($self, $evt) = @_; |
21
|
|
|
|
|
|
|
# big expression |
22
|
1243
|
100
|
|
|
|
12064
|
if (defined $evt->{raw}) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
23
|
1200
|
|
|
|
|
4041
|
$evt->{raw} |
24
|
|
|
|
|
|
|
} elsif ($evt->{type} eq 'OPEN') { |
25
|
|
|
|
|
|
|
'<' |
26
|
|
|
|
|
|
|
.$evt->{name} |
27
|
|
|
|
|
|
|
.(defined $evt->{raw_attrs} |
28
|
|
|
|
|
|
|
? $evt->{raw_attrs} |
29
|
38
|
100
|
|
|
|
124
|
: do { |
|
|
100
|
|
|
|
|
|
30
|
36
|
|
|
|
|
47
|
my @names = @{$evt->{attr_names}}; |
|
36
|
|
|
|
|
106
|
|
31
|
|
|
|
|
|
|
@names |
32
|
36
|
50
|
|
|
|
110
|
? join(' ', '', map qq{${_}="${\$evt->{attrs}{$_}}"}, @names) |
|
60
|
|
|
|
|
406
|
|
33
|
|
|
|
|
|
|
: '' |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
) |
36
|
|
|
|
|
|
|
.($evt->{is_in_place_close} ? ' /' : '') |
37
|
|
|
|
|
|
|
.'>' |
38
|
|
|
|
|
|
|
} elsif ($evt->{type} eq 'CLOSE') { |
39
|
4
|
|
|
|
|
20
|
''.$evt->{name}.'>' |
40
|
|
|
|
|
|
|
} elsif ($evt->{type} eq 'EMPTY') { |
41
|
1
|
|
|
|
|
3
|
'' |
42
|
|
|
|
|
|
|
} else { |
43
|
0
|
|
|
|
|
|
die "No raw value in event and no special handling for type ".$evt->{type}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |