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