line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CSS::DOM::Rule::FontFace; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = '0.17'; |
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
1168
|
use warnings; no warnings qw 'utf8 parenthesis'; |
|
3
|
|
|
3
|
|
7
|
|
|
3
|
|
|
|
|
114
|
|
|
3
|
|
|
|
|
13
|
|
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
102
|
|
6
|
3
|
|
|
3
|
|
14
|
use strict; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
74
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
346
|
use CSS::DOM::Exception qw/ SYNTAX_ERR /; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
140
|
|
9
|
3
|
|
|
3
|
|
353
|
use CSS::DOM::Rule; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
138
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ISA = 'CSS::DOM::Rule'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use constant # Don't let this conflict with the superclass. |
14
|
3
|
|
|
3
|
|
14
|
styl => 2; |
|
3
|
|
|
|
|
4
|
|
|
3
|
|
|
|
|
148
|
|
15
|
3
|
|
|
3
|
|
14
|
{ no strict 'refs'; delete ${__PACKAGE__.'::'}{styl} } |
|
3
|
|
|
|
|
17
|
|
|
3
|
|
|
|
|
571
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# overrides: |
18
|
|
|
|
|
|
|
|
19
|
6
|
|
|
6
|
1
|
25
|
sub type { CSS::DOM::Rule::FONT_FACE_RULE } |
20
|
|
|
|
|
|
|
sub cssText { |
21
|
8
|
|
|
8
|
1
|
17
|
my $self = shift; |
22
|
8
|
|
|
|
|
9
|
my $old; |
23
|
8
|
100
|
|
|
|
19
|
if(defined wantarray) { |
24
|
7
|
|
|
|
|
19
|
$old = "\@font-face { " |
25
|
|
|
|
|
|
|
. $self->[styl]->cssText ." }\n"; |
26
|
|
|
|
|
|
|
} |
27
|
8
|
100
|
|
|
|
16
|
if (@_) { |
28
|
2
|
|
|
|
|
9
|
require CSS::DOM::Parser; |
29
|
2
|
|
|
|
|
8
|
my $new_rule = $self->_parse(shift); |
30
|
1
|
|
|
|
|
9
|
@$self[styl] = @$new_rule[styl]; |
31
|
|
|
|
|
|
|
} |
32
|
7
|
|
|
|
|
26
|
$old; |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# CSSFontFaceRule interface: |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub style { |
39
|
10
|
|
66
|
10
|
1
|
545
|
$_[0]->[styl] ||= do { |
40
|
8
|
|
|
|
|
27
|
require CSS::DOM::Style; |
41
|
8
|
|
|
|
|
21
|
new CSS::DOM::Style shift |
42
|
|
|
|
|
|
|
}; |
43
|
|
|
|
|
|
|
} |
44
|
|
|
|
|
|
|
|
45
|
|
|
|
|
|
|
!()__END__()! |
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
=head1 NAME |
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
CSS::DOM::Rule::FontFace - CSS @font-face rule class for CSS::DOM |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
=head1 VERSION |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
Version 0.17 |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
=head1 SYNOPSIS |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
use CSS::DOM; |
58
|
|
|
|
|
|
|
my $font_face_rule = CSS::DOM->parse( |
59
|
|
|
|
|
|
|
'@font-face { font-family: "bm"; src: url(blackmoor.ttf) }' |
60
|
|
|
|
|
|
|
)->cssRules->[0]; |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
$page_rule->style; # a CSS::DOM::Style object |
63
|
|
|
|
|
|
|
$page_rule->style->src; # 'url(blackmoor.ttf)' |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 DESCRIPTION |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
This module implements CSS @font-face rules for L. It inherits |
68
|
|
|
|
|
|
|
from |
69
|
|
|
|
|
|
|
L and implements |
70
|
|
|
|
|
|
|
the CSSFontFaceRule DOM interface. |
71
|
|
|
|
|
|
|
|
72
|
|
|
|
|
|
|
=head1 THE METHOD |
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
=over 4 |
75
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
=item style |
77
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
Returns the CSS::DOM::Style object representing the declaration block |
79
|
|
|
|
|
|
|
of this rule. |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=back |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
=head1 SEE ALSO |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
L |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
L |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
L |