line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CSS::DOM::Rule::Charset; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = '0.16'; |
4
|
|
|
|
|
|
|
|
5
|
4
|
|
|
4
|
|
903
|
use warnings; no warnings qw 'utf8 parenthesis'; |
|
4
|
|
|
4
|
|
10
|
|
|
4
|
|
|
|
|
146
|
|
|
4
|
|
|
|
|
22
|
|
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
149
|
|
6
|
4
|
|
|
4
|
|
21
|
use strict; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
108
|
|
7
|
|
|
|
|
|
|
|
8
|
4
|
|
|
4
|
|
556
|
use CSS::DOM::Util 'escape'; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
250
|
|
9
|
4
|
|
|
4
|
|
551
|
use CSS::DOM::Rule; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
225
|
|
10
|
|
|
|
|
|
|
|
11
|
|
|
|
|
|
|
our @ISA = 'CSS::DOM::Rule'; |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
use constant # Don't let this conflict with the superclass. |
14
|
4
|
|
|
4
|
|
25
|
cset => 2; |
|
4
|
|
|
|
|
10
|
|
|
4
|
|
|
|
|
236
|
|
15
|
4
|
|
|
4
|
|
22
|
{ no strict 'refs'; delete ${__PACKAGE__.'::'}{cset} } |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
932
|
|
16
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
# overrides: |
18
|
|
|
|
|
|
|
|
19
|
5
|
|
|
5
|
1
|
30
|
sub type { CSS::DOM::Rule::CHARSET_RULE } |
20
|
|
|
|
|
|
|
sub cssText { |
21
|
8
|
|
|
8
|
1
|
20
|
my $self = shift; |
22
|
8
|
|
|
|
|
87
|
my $old; |
23
|
8
|
100
|
|
|
|
28
|
if(defined wantarray) { |
24
|
6
|
|
|
|
|
25
|
$old = "\@charset \"" |
25
|
|
|
|
|
|
|
. escape($self->[cset],'"') ."\";\n"; |
26
|
|
|
|
|
|
|
} |
27
|
8
|
100
|
|
|
|
32
|
if (@_) { |
28
|
3
|
|
|
|
|
20
|
require CSS::DOM::Parser; |
29
|
3
|
|
|
|
|
25
|
my $new_rule = $self->_parse(shift); |
30
|
2
|
|
|
|
|
17
|
@$self[cset] = @$new_rule[cset]; |
31
|
|
|
|
|
|
|
} |
32
|
7
|
|
|
|
|
35
|
$old; |
33
|
|
|
|
|
|
|
}; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
# CSSCharsetRule interface: |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
sub encoding { |
39
|
27
|
|
|
27
|
0
|
458
|
my $old = (my $self = shift)->[cset]; |
40
|
27
|
100
|
|
|
|
109
|
@_ and $$self[cset] = shift; |
41
|
27
|
|
|
|
|
84
|
$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.16 |
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. It inherits |
67
|
|
|
|
|
|
|
from |
68
|
|
|
|
|
|
|
L 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 |
85
|
|
|
|
|
|
|
|
86
|
|
|
|
|
|
|
L |
87
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
L |