line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CSS::DOM::Rule::FontFace; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = '0.16'; |
4
|
|
|
|
|
|
|
|
5
|
3
|
|
|
3
|
|
967
|
use warnings; no warnings qw 'utf8 parenthesis'; |
|
3
|
|
|
3
|
|
6
|
|
|
3
|
|
|
|
|
122
|
|
|
3
|
|
|
|
|
17
|
|
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
128
|
|
6
|
3
|
|
|
3
|
|
18
|
use strict; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
86
|
|
7
|
|
|
|
|
|
|
|
8
|
3
|
|
|
3
|
|
528
|
use CSS::DOM::Exception qw/ SYNTAX_ERR /; |
|
3
|
|
|
|
|
7
|
|
|
3
|
|
|
|
|
177
|
|
9
|
3
|
|
|
3
|
|
597
|
use CSS::DOM::Rule; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
174
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ISA = 'CSS::DOM::Rule'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use constant # Don't let this conflict with the superclass. |
14
|
3
|
|
|
3
|
|
18
|
styl => 2; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
187
|
|
15
|
3
|
|
|
3
|
|
16
|
{ no strict 'refs'; delete ${__PACKAGE__.'::'}{styl} } |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
759
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# overrides: |
18
|
|
|
|
|
|
|
|
19
|
6
|
|
|
6
|
1
|
29
|
sub type { CSS::DOM::Rule::FONT_FACE_RULE } |
20
|
|
|
|
|
|
|
sub cssText { |
21
|
8
|
|
|
8
|
1
|
22
|
my $self = shift; |
22
|
8
|
|
|
|
|
13
|
my $old; |
23
|
8
|
100
|
|
|
|
27
|
if(defined wantarray) { |
24
|
7
|
|
|
|
|
28
|
$old = "\@font-face { " |
25
|
|
|
|
|
|
|
. $self->[styl]->cssText ." }\n"; |
26
|
|
|
|
|
|
|
} |
27
|
8
|
100
|
|
|
|
39
|
if (@_) { |
28
|
2
|
|
|
|
|
12
|
require CSS::DOM::Parser; |
29
|
2
|
|
|
|
|
14
|
my $new_rule = $self->_parse(shift); |
30
|
1
|
|
|
|
|
12
|
@$self[styl] = @$new_rule[styl]; |
31
|
|
|
|
|
|
|
} |
32
|
7
|
|
|
|
|
37
|
$old; |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# CSSFontFaceRule interface: |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub style { |
39
|
10
|
|
66
|
10
|
1
|
509
|
$_[0]->[styl] ||= do { |
40
|
8
|
|
|
|
|
38
|
require CSS::DOM::Style; |
41
|
8
|
|
|
|
|
41
|
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.16 |
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 |