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