line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML5::DOM::CSS::Selector; |
2
|
3
|
|
|
3
|
|
21
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
90
|
|
3
|
3
|
|
|
3
|
|
16
|
use warnings; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
74
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
2225
|
use HTML5::DOM::CSS::Selector::Entry; |
|
3
|
|
|
|
|
10
|
|
|
3
|
|
|
|
|
202
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
use overload |
8
|
0
|
|
|
0
|
|
0
|
'""' => sub { shift->text }, |
9
|
0
|
|
|
0
|
|
0
|
'@{}' => sub { shift->array }, |
10
|
0
|
|
|
0
|
|
0
|
'bool' => sub { 1 }, |
11
|
3
|
|
|
3
|
|
31
|
fallback => 1; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
49
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
13
|
|
|
13
|
0
|
5108
|
my ($class, $text) = @_; |
15
|
13
|
|
|
|
|
643
|
return HTML5::DOM::CSS->new->parseSelector($text); |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
# TODO: implement in XS? |
19
|
|
|
|
|
|
|
sub array { |
20
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
21
|
0
|
|
|
|
|
|
my @tmp; |
22
|
0
|
|
|
|
|
|
my $l = $self->length; |
23
|
0
|
|
|
|
|
|
for (my $i = 0; $i < $l; ++$i) { |
24
|
0
|
|
|
|
|
|
push @tmp, $self->entry($i); |
25
|
|
|
|
|
|
|
} |
26
|
0
|
|
|
|
|
|
return \@tmp; |
27
|
|
|
|
|
|
|
} |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
1; |
30
|
|
|
|
|
|
|
__END__ |