line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::DOM::View; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
15519
|
use warnings; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
143
|
|
4
|
5
|
|
|
5
|
|
15
|
use strict; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
102
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
16
|
use Scalar::Util qw'weaken'; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
238
|
|
7
|
5
|
|
|
5
|
|
372
|
use HTML::DOM::_FieldHash; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
940
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
fieldhashes \my %doc; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.056'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# -------- DOM ATTRIBUTES -------- # |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub document { |
16
|
36
|
|
|
36
|
1
|
87
|
my $old = $doc{my $self = shift}; |
17
|
36
|
100
|
|
|
|
84
|
$doc{$self} = shift if @_; |
18
|
36
|
100
|
|
|
|
80
|
defined $old ? $old :(); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub getComputedStyle { |
22
|
23
|
|
|
23
|
1
|
946
|
my($view, $elem, $pseudo) = @_; |
23
|
23
|
|
|
|
|
35
|
my($ua,$u) = map eval{$view->${\"u$_\_style_sheet"}}, 'a','ser'; |
|
46
|
|
|
|
|
79
|
|
|
46
|
|
|
|
|
123
|
|
24
|
23
|
|
|
|
|
67
|
my $doc = $view->document; |
25
|
|
|
|
|
|
|
|
26
|
23
|
|
|
|
|
90
|
require CSS::DOM; CSS::DOM->VERSION(.06); |
|
23
|
|
|
|
|
294
|
|
27
|
23
|
50
|
|
|
|
96
|
return CSS::DOM'compute_style( |
28
|
|
|
|
|
|
|
#medium => ... |
29
|
|
|
|
|
|
|
#height => $view->innerHeight; |
30
|
|
|
|
|
|
|
#width => $view->innerWidth; |
31
|
|
|
|
|
|
|
#ppi => ... |
32
|
|
|
|
|
|
|
ua_sheet => $ua, |
33
|
|
|
|
|
|
|
user_sheet => $u , |
34
|
|
|
|
|
|
|
defined $doc ? |
35
|
|
|
|
|
|
|
(author_sheets => scalar $doc->styleSheets ) : (), |
36
|
|
|
|
|
|
|
element => $elem, |
37
|
|
|
|
|
|
|
pseudo => $pseudo, |
38
|
|
|
|
|
|
|
); |
39
|
|
|
|
|
|
|
} |
40
|
|
|
|
|
|
|
|
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
|
43
|
|
|
|
|
|
|
1 |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
__END__ |