line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Zoom::Producer::BuiltIn; |
2
|
|
|
|
|
|
|
|
3
|
13
|
|
|
13
|
|
665
|
use strictures 1; |
|
13
|
|
|
|
|
105
|
|
|
13
|
|
|
|
|
356
|
|
4
|
13
|
|
|
13
|
|
979
|
use base qw(HTML::Zoom::SubObject); |
|
13
|
|
|
|
|
24
|
|
|
13
|
|
|
|
|
5807
|
|
5
|
|
|
|
|
|
|
|
6
|
|
|
|
|
|
|
sub html_from_stream { |
7
|
74
|
|
|
74
|
0
|
151
|
my ($self, $stream) = @_; |
8
|
|
|
|
|
|
|
return |
9
|
74
|
|
|
|
|
343
|
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
|
|
|
|
|
9
|
join '', map $self->event_to_html($_), @$events; |
17
|
|
|
|
|
|
|
} |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
sub event_to_html { |
20
|
1102
|
|
|
1102
|
0
|
1525
|
my ($self, $evt) = @_; |
21
|
|
|
|
|
|
|
# big expression |
22
|
1102
|
100
|
|
|
|
2513
|
if (defined $evt->{raw}) { |
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
23
|
1071
|
|
|
|
|
3878
|
$evt->{raw} |
24
|
|
|
|
|
|
|
} elsif ($evt->{type} eq 'OPEN') { |
25
|
|
|
|
|
|
|
'<' |
26
|
|
|
|
|
|
|
.$evt->{name} |
27
|
|
|
|
|
|
|
.(defined $evt->{raw_attrs} |
28
|
|
|
|
|
|
|
? $evt->{raw_attrs} |
29
|
26
|
100
|
|
|
|
95
|
: do { |
|
|
100
|
|
|
|
|
|
30
|
24
|
|
|
|
|
33
|
my @names = @{$evt->{attr_names}}; |
|
24
|
|
|
|
|
73
|
|
31
|
|
|
|
|
|
|
@names |
32
|
24
|
100
|
|
|
|
102
|
? join(' ', '', map qq{${_}="${\$evt->{attrs}{$_}}"}, @names) |
|
31
|
|
|
|
|
264
|
|
33
|
|
|
|
|
|
|
: '' |
34
|
|
|
|
|
|
|
} |
35
|
|
|
|
|
|
|
) |
36
|
|
|
|
|
|
|
.($evt->{is_in_place_close} ? ' /' : '') |
37
|
|
|
|
|
|
|
.'>' |
38
|
|
|
|
|
|
|
} elsif ($evt->{type} eq 'CLOSE') { |
39
|
4
|
|
|
|
|
17
|
'</'.$evt->{name}.'>' |
40
|
|
|
|
|
|
|
} elsif ($evt->{type} eq 'EMPTY') { |
41
|
1
|
|
|
|
|
4
|
'' |
42
|
|
|
|
|
|
|
} else { |
43
|
0
|
|
|
|
|
|
die "No raw value in event and no special handling for type ".$evt->{type}; |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
} |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |