line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::Zoom::Transform; |
2
|
|
|
|
|
|
|
|
3
|
15
|
|
|
15
|
|
84
|
use strictures 1; |
|
15
|
|
|
|
|
83
|
|
|
15
|
|
|
|
|
341
|
|
4
|
15
|
|
|
15
|
|
1180
|
use base qw(HTML::Zoom::SubObject); |
|
15
|
|
|
|
|
32
|
|
|
15
|
|
|
|
|
8802
|
|
5
|
15
|
|
|
15
|
|
13642
|
use HTML::Zoom::TransformedStream; |
|
15
|
|
|
|
|
44
|
|
|
15
|
|
|
|
|
4939
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
sub new { |
8
|
241
|
|
|
241
|
0
|
376
|
my ($class, $args) = @_; |
9
|
241
|
|
|
|
|
794
|
my $new = $class->SUPER::new($args); |
10
|
241
|
|
|
|
|
605
|
$new->{selector} = $args->{selector}; |
11
|
241
|
50
|
|
|
|
952
|
$new->{match} = $args->{match} if $args->{match}; |
12
|
241
|
|
50
|
|
|
724
|
$new->{filters} = $args->{filters}||[]; |
13
|
241
|
|
|
|
|
1171
|
$new; |
14
|
|
|
|
|
|
|
} |
15
|
|
|
|
|
|
|
|
16
|
246
|
|
|
246
|
0
|
900
|
sub selector { shift->{selector} } |
17
|
|
|
|
|
|
|
|
18
|
237
|
|
|
237
|
0
|
1402
|
sub filters { shift->{filters} } |
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
sub with_filter { |
21
|
120
|
|
|
120
|
0
|
292
|
my ($self, $filter) = @_; |
22
|
120
|
|
|
|
|
374
|
(ref $self)->new({ |
23
|
|
|
|
|
|
|
selector => $self->selector, |
24
|
|
|
|
|
|
|
($self->{match} ? (match => $self->{match}) : ()), |
25
|
120
|
50
|
|
|
|
633
|
filters => [ @{$self->filters}, $filter ] |
26
|
|
|
|
|
|
|
}); |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
sub match { |
30
|
120
|
|
|
120
|
0
|
300
|
my ($self) = @_; |
31
|
120
|
|
66
|
|
|
664
|
$self->{match} ||= |
32
|
|
|
|
|
|
|
$self->_zconfig |
33
|
|
|
|
|
|
|
->selector_parser |
34
|
|
|
|
|
|
|
->parse_selector($self->{selector}); |
35
|
|
|
|
|
|
|
} |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
sub apply_to_stream { |
38
|
120
|
|
|
120
|
0
|
202
|
my ($self, $stream) = @_; |
39
|
120
|
|
|
|
|
403
|
HTML::Zoom::TransformedStream->new({ |
40
|
|
|
|
|
|
|
stream => $stream, |
41
|
|
|
|
|
|
|
transform => $self, |
42
|
|
|
|
|
|
|
zconfig => $self->_zconfig, |
43
|
|
|
|
|
|
|
}); |
44
|
|
|
|
|
|
|
} |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
1; |