line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Zoom::Transform; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
73
|
use strictures 1; |
|
15
|
|
|
|
|
90
|
|
|
15
|
|
|
|
|
341
|
|
4
|
15
|
|
|
15
|
|
934
|
use base qw(HTML::Zoom::SubObject); |
|
15
|
|
|
|
|
25
|
|
|
15
|
|
|
|
|
6262
|
|
5
|
15
|
|
|
15
|
|
5664
|
use HTML::Zoom::TransformedStream; |
|
15
|
|
|
|
|
40
|
|
|
15
|
|
|
|
|
4211
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
296
|
|
|
296
|
0
|
325
|
my ($class, $args) = @_; |
9
|
296
|
|
|
|
|
676
|
my $new = $class->SUPER::new($args); |
10
|
296
|
|
|
|
|
463
|
$new->{selector} = $args->{selector}; |
11
|
296
|
50
|
|
|
|
486
|
$new->{match} = $args->{match} if $args->{match}; |
12
|
296
|
|
50
|
|
|
621
|
$new->{filters} = $args->{filters}||[]; |
13
|
296
|
|
|
|
|
982
|
$new; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
266
|
|
|
266
|
0
|
647
|
sub selector { shift->{selector} } |
17
|
|
|
|
|
|
|
|
18
|
257
|
|
|
257
|
0
|
778
|
sub filters { shift->{filters} } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub with_filter { |
21
|
130
|
|
|
130
|
0
|
157
|
my ($self, $filter) = @_; |
22
|
130
|
|
|
|
|
222
|
(ref $self)->new({ |
23
|
|
|
|
|
|
|
selector => $self->selector, |
24
|
|
|
|
|
|
|
($self->{match} ? (match => $self->{match}) : ()), |
25
|
130
|
50
|
|
|
|
280
|
filters => [ @{$self->filters}, $filter ] |
26
|
|
|
|
|
|
|
}); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub match { |
30
|
130
|
|
|
130
|
0
|
153
|
my ($self) = @_; |
31
|
130
|
|
66
|
|
|
769
|
$self->{match} ||= |
32
|
|
|
|
|
|
|
$self->_zconfig |
33
|
|
|
|
|
|
|
->selector_parser |
34
|
|
|
|
|
|
|
->parse_selector($self->{selector}); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub apply_to_stream { |
38
|
130
|
|
|
130
|
0
|
143
|
my ($self, $stream) = @_; |
39
|
130
|
|
|
|
|
340
|
HTML::Zoom::TransformedStream->new({ |
40
|
|
|
|
|
|
|
stream => $stream, |
41
|
|
|
|
|
|
|
transform => $self, |
42
|
|
|
|
|
|
|
zconfig => $self->_zconfig, |
43
|
|
|
|
|
|
|
}); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |