line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::WidgetValidator; |
2
|
45
|
|
|
45
|
|
3047747
|
use warnings; |
|
45
|
|
|
|
|
121
|
|
|
45
|
|
|
|
|
1294
|
|
3
|
45
|
|
|
45
|
|
224
|
use strict; |
|
45
|
|
|
|
|
80
|
|
|
45
|
|
|
|
|
1220
|
|
4
|
45
|
|
|
45
|
|
23931
|
use HTML::WidgetValidator::HTMLParser; |
|
45
|
|
|
|
|
139
|
|
|
45
|
|
|
|
|
1440
|
|
5
|
45
|
|
|
45
|
|
29806
|
use HTML::WidgetValidator::WidgetContainer; |
|
45
|
|
|
|
|
152
|
|
|
45
|
|
|
|
|
531
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.0.3'; |
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
sub new { |
10
|
1
|
|
|
1
|
0
|
12
|
my ($class, %args) = @_; |
11
|
1
|
|
|
|
|
12
|
my $self = bless { |
12
|
|
|
|
|
|
|
parser => HTML::WidgetValidator::HTMLParser->new, |
13
|
|
|
|
|
|
|
container => HTML::WidgetValidator::WidgetContainer->new(%args), |
14
|
|
|
|
|
|
|
}, $class; |
15
|
1
|
|
|
|
|
9
|
return $self; |
16
|
|
|
|
|
|
|
} |
17
|
|
|
|
|
|
|
|
18
|
|
|
|
|
|
|
sub add { |
19
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
20
|
0
|
|
|
|
|
|
$self->{container}->add(@_); |
21
|
|
|
|
|
|
|
} |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
sub validate { |
24
|
0
|
|
|
0
|
0
|
|
my ($self, $html) = @_; |
25
|
0
|
|
|
|
|
|
my $result; |
26
|
0
|
|
|
|
|
|
my $elements = $self->{parser}->parse($html); |
27
|
0
|
|
|
|
|
|
return $self->{container}->match($elements, $html); |
28
|
|
|
|
|
|
|
} |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
sub widgets { |
31
|
0
|
|
|
0
|
0
|
|
my $self = shift; |
32
|
0
|
|
|
|
|
|
return $self->{container}->widgets; |
33
|
|
|
|
|
|
|
} |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
1; |
36
|
|
|
|
|
|
|
__END__ |