line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML5::DOM::CSS::Selector; |
2
|
3
|
|
|
3
|
|
19
|
use strict; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
86
|
|
3
|
3
|
|
|
3
|
|
14
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
70
|
|
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
2132
|
use HTML5::DOM::CSS::Selector::Entry; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
200
|
|
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
|
|
19
|
fallback => 1; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
41
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
sub new { |
14
|
13
|
|
|
13
|
0
|
5087
|
my ($class, $text) = @_; |
15
|
13
|
|
|
|
|
666
|
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__ |