line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package HTML::DOM::View; |
2
|
|
|
|
|
|
|
|
3
|
5
|
|
|
5
|
|
53075
|
use warnings; |
|
5
|
|
|
|
|
17
|
|
|
5
|
|
|
|
|
166
|
|
4
|
5
|
|
|
5
|
|
22
|
use strict; |
|
5
|
|
|
|
|
6
|
|
|
5
|
|
|
|
|
113
|
|
5
|
|
|
|
|
|
|
|
6
|
5
|
|
|
5
|
|
20
|
use Scalar::Util qw'weaken'; |
|
5
|
|
|
|
|
9
|
|
|
5
|
|
|
|
|
229
|
|
7
|
5
|
|
|
5
|
|
411
|
use HTML::DOM::_FieldHash; |
|
5
|
|
|
|
|
7
|
|
|
5
|
|
|
|
|
1064
|
|
8
|
|
|
|
|
|
|
|
9
|
|
|
|
|
|
|
fieldhashes \my %doc; |
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our $VERSION = '0.058'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
# -------- DOM ATTRIBUTES -------- # |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
sub document { |
16
|
36
|
|
|
36
|
1
|
99
|
my $old = $doc{my $self = shift}; |
17
|
36
|
100
|
|
|
|
91
|
$doc{$self} = shift if @_; |
18
|
36
|
100
|
|
|
|
92
|
defined $old ? $old :(); |
19
|
|
|
|
|
|
|
} |
20
|
|
|
|
|
|
|
|
21
|
|
|
|
|
|
|
sub getComputedStyle { |
22
|
23
|
|
|
23
|
1
|
1424
|
my($view, $elem, $pseudo) = @_; |
23
|
23
|
|
|
|
|
36
|
my($ua,$u) = map eval{$view->${\"u$_\_style_sheet"}}, 'a','ser'; |
|
46
|
|
|
|
|
100
|
|
|
46
|
|
|
|
|
148
|
|
24
|
23
|
|
|
|
|
92
|
my $doc = $view->document; |
25
|
|
|
|
|
|
|
|
26
|
23
|
|
|
|
|
100
|
require CSS::DOM; CSS::DOM->VERSION(.06); |
|
23
|
|
|
|
|
255
|
|
27
|
23
|
50
|
|
|
|
114
|
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__ |