line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::DOM::View; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
16381
|
use warnings; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
178
|
|
4
|
5
|
|
|
5
|
|
22
|
use strict; |
|
5
|
|
|
|
|
8
|
|
|
5
|
|
|
|
|
121
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
16
|
use Scalar::Util qw'weaken'; |
|
5
|
|
|
|
|
10
|
|
|
5
|
|
|
|
|
278
|
|
7
|
5
|
|
|
5
|
|
388
|
use HTML::DOM::_FieldHash; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
1121
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
fieldhashes \my %doc; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.057'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# -------- DOM ATTRIBUTES -------- # |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub document { |
16
|
36
|
|
|
36
|
1
|
103
|
my $old = $doc{my $self = shift}; |
17
|
36
|
100
|
|
|
|
107
|
$doc{$self} = shift if @_; |
18
|
36
|
100
|
|
|
|
87
|
defined $old ? $old :(); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub getComputedStyle { |
22
|
23
|
|
|
23
|
1
|
1246
|
my($view, $elem, $pseudo) = @_; |
23
|
23
|
|
|
|
|
34
|
my($ua,$u) = map eval{$view->${\"u$_\_style_sheet"}}, 'a','ser'; |
|
46
|
|
|
|
|
84
|
|
|
46
|
|
|
|
|
127
|
|
24
|
23
|
|
|
|
|
78
|
my $doc = $view->document; |
25
|
|
|
|
|
|
|
|
26
|
23
|
|
|
|
|
97
|
require CSS::DOM; CSS::DOM->VERSION(.06); |
|
23
|
|
|
|
|
293
|
|
27
|
23
|
50
|
|
|
|
104
|
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__ |