line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package CSS::DOM::Constants; |
2
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
$VERSION = '0.15'; |
4
|
|
|
|
|
|
|
|
5
|
29
|
|
|
29
|
|
86180
|
use Exporter 5.57 'import'; |
|
29
|
|
|
|
|
798
|
|
|
29
|
|
|
|
|
2444
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
my $exception_constants; |
8
|
29
|
|
|
|
|
7614
|
use constant 1.03 $exception_constants = { |
9
|
|
|
|
|
|
|
# DOMException: |
10
|
|
|
|
|
|
|
INDEX_SIZE_ERR => 1, |
11
|
|
|
|
|
|
|
DOMSTRING_SIZE_ERR => 2, |
12
|
|
|
|
|
|
|
HIERARCHY_REQUEST_ERR => 3, |
13
|
|
|
|
|
|
|
WRONG_DOCUMENT_ERR => 4, |
14
|
|
|
|
|
|
|
INVALID_CHARACTER_ERR => 5, |
15
|
|
|
|
|
|
|
NO_DATA_ALLOWED_ERR => 6, |
16
|
|
|
|
|
|
|
NO_MODIFICATION_ALLOWED_ERR => 7, |
17
|
|
|
|
|
|
|
NOT_FOUND_ERR => 8, |
18
|
|
|
|
|
|
|
NOT_SUPPORTED_ERR => 9, |
19
|
|
|
|
|
|
|
INUSE_ATTRIBUTE_ERR => 10, |
20
|
|
|
|
|
|
|
INVALID_STATE_ERR => 11, |
21
|
|
|
|
|
|
|
SYNTAX_ERR => 12, |
22
|
|
|
|
|
|
|
INVALID_MODIFICATION_ERR => 13, |
23
|
|
|
|
|
|
|
NAMESPACE_ERR => 14, |
24
|
|
|
|
|
|
|
INVALID_ACCESS_ERR => 15, |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
## EventException: |
27
|
|
|
|
|
|
|
# UNSPECIFIED_EVENT_TYPE_ERR => 0, |
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
29
|
|
|
29
|
|
179
|
}; |
|
29
|
|
|
|
|
637
|
|
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
my @rule_constants; |
33
|
29
|
|
|
|
|
65
|
use constant do { |
34
|
29
|
|
|
|
|
713
|
my $x = 0; |
35
|
29
|
|
|
|
|
5424
|
+{ map +($_ => $x++), @rule_constants = qw/ |
36
|
|
|
|
|
|
|
UNKNOWN_RULE |
37
|
|
|
|
|
|
|
STYLE_RULE |
38
|
|
|
|
|
|
|
CHARSET_RULE |
39
|
|
|
|
|
|
|
IMPORT_RULE |
40
|
|
|
|
|
|
|
MEDIA_RULE |
41
|
|
|
|
|
|
|
FONT_FACE_RULE |
42
|
|
|
|
|
|
|
PAGE_RULE |
43
|
|
|
|
|
|
|
/ } |
44
|
29
|
|
|
29
|
|
700
|
}; |
|
29
|
|
|
|
|
56
|
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
my @val_constants; |
47
|
29
|
|
|
|
|
53
|
use constant do { |
48
|
29
|
|
|
|
|
93
|
my $x = 0; |
49
|
29
|
|
|
|
|
11280
|
+{ map +($_ => $x++), @val_constants = qw/ |
50
|
|
|
|
|
|
|
CSS_INHERIT |
51
|
|
|
|
|
|
|
CSS_PRIMITIVE_VALUE |
52
|
|
|
|
|
|
|
CSS_VALUE_LIST |
53
|
|
|
|
|
|
|
CSS_CUSTOM |
54
|
|
|
|
|
|
|
/} |
55
|
29
|
|
|
29
|
|
170
|
}; |
|
29
|
|
|
|
|
55
|
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
my @prim_constants; |
58
|
29
|
|
|
|
|
63
|
use constant do { |
59
|
29
|
|
|
|
|
79
|
my $x = 0; |
60
|
29
|
|
|
|
|
29108
|
+{ map +($_ => $x++), @ prim_constants = qw/ |
61
|
|
|
|
|
|
|
CSS_UNKNOWN |
62
|
|
|
|
|
|
|
CSS_NUMBER |
63
|
|
|
|
|
|
|
CSS_PERCENTAGE |
64
|
|
|
|
|
|
|
CSS_EMS |
65
|
|
|
|
|
|
|
CSS_EXS |
66
|
|
|
|
|
|
|
CSS_PX |
67
|
|
|
|
|
|
|
CSS_CM |
68
|
|
|
|
|
|
|
CSS_MM |
69
|
|
|
|
|
|
|
CSS_IN |
70
|
|
|
|
|
|
|
CSS_PT |
71
|
|
|
|
|
|
|
CSS_PC |
72
|
|
|
|
|
|
|
CSS_DEG |
73
|
|
|
|
|
|
|
CSS_RAD |
74
|
|
|
|
|
|
|
CSS_GRAD |
75
|
|
|
|
|
|
|
CSS_MS |
76
|
|
|
|
|
|
|
CSS_S |
77
|
|
|
|
|
|
|
CSS_HZ |
78
|
|
|
|
|
|
|
CSS_KHZ |
79
|
|
|
|
|
|
|
CSS_DIMENSION |
80
|
|
|
|
|
|
|
CSS_STRING |
81
|
|
|
|
|
|
|
CSS_URI |
82
|
|
|
|
|
|
|
CSS_IDENT |
83
|
|
|
|
|
|
|
CSS_ATTR |
84
|
|
|
|
|
|
|
CSS_COUNTER |
85
|
|
|
|
|
|
|
CSS_RECT |
86
|
|
|
|
|
|
|
CSS_RGBCOLOR |
87
|
|
|
|
|
|
|
/} |
88
|
29
|
|
|
29
|
|
222
|
}; |
|
29
|
|
|
|
|
53
|
|
89
|
|
|
|
|
|
|
|
90
|
|
|
|
|
|
|
our %EXPORT_TAGS = ( |
91
|
|
|
|
|
|
|
exception => [keys %$exception_constants], |
92
|
|
|
|
|
|
|
rule => \@rule_constants, |
93
|
|
|
|
|
|
|
value => \@val_constants, |
94
|
|
|
|
|
|
|
primitive => \@prim_constants, |
95
|
|
|
|
|
|
|
); |
96
|
|
|
|
|
|
|
our @EXPORT_OK = ('%SuffixToConst', map @$_, values %EXPORT_TAGS); |
97
|
|
|
|
|
|
|
$EXPORT_TAGS{all} = \@EXPORT_OK; |
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
{package |
100
|
|
|
|
|
|
|
CSS::DOM::Exception; |
101
|
|
|
|
|
|
|
CSS::DOM::Constants->import(':exception'); |
102
|
|
|
|
|
|
|
package |
103
|
|
|
|
|
|
|
CSS::DOM::Rule; |
104
|
|
|
|
|
|
|
CSS::DOM::Constants->import(':rule'); |
105
|
|
|
|
|
|
|
package |
106
|
|
|
|
|
|
|
CSS::DOM::Value; |
107
|
|
|
|
|
|
|
CSS::DOM::Constants->import(':value'); |
108
|
|
|
|
|
|
|
package |
109
|
|
|
|
|
|
|
CSS::DOM::Value::Primitive; |
110
|
|
|
|
|
|
|
CSS::DOM::Constants->import(':primitive'); |
111
|
|
|
|
|
|
|
} |
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
%SuffixToConst = ( # dimension suffix -> CSSPrimitiveValue type constant |
114
|
|
|
|
|
|
|
'em' => CSS_EMS, |
115
|
|
|
|
|
|
|
'ex' => CSS_EXS, |
116
|
|
|
|
|
|
|
'px' => CSS_PX, |
117
|
|
|
|
|
|
|
'cm' => CSS_CM, |
118
|
|
|
|
|
|
|
'mm' => CSS_MM, |
119
|
|
|
|
|
|
|
'in' => CSS_IN, |
120
|
|
|
|
|
|
|
'pt' => CSS_PT, |
121
|
|
|
|
|
|
|
'pc' => CSS_PC, |
122
|
|
|
|
|
|
|
deg => CSS_DEG, |
123
|
|
|
|
|
|
|
rad => CSS_RAD, |
124
|
|
|
|
|
|
|
grad => CSS_GRAD, |
125
|
|
|
|
|
|
|
'ms' => CSS_MS, |
126
|
|
|
|
|
|
|
's' => CSS_S, |
127
|
|
|
|
|
|
|
'hz' => CSS_HZ, |
128
|
|
|
|
|
|
|
khz => CSS_KHZ, |
129
|
|
|
|
|
|
|
); |
130
|
|
|
|
|
|
|
|
131
|
|
|
|
|
|
|
!()__END__()! |
132
|
|
|
|
|
|
|
|
133
|
|
|
|
|
|
|
=head1 NAME |
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
CSS::DOM::Constants - Constants for CSS::DOM |
136
|
|
|
|
|
|
|
|
137
|
|
|
|
|
|
|
=head1 VERSION |
138
|
|
|
|
|
|
|
|
139
|
|
|
|
|
|
|
Version 0.15 |
140
|
|
|
|
|
|
|
|
141
|
|
|
|
|
|
|
=head1 SYNOPSIS |
142
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
use CSS::DOM::Constants ':all'; |
144
|
|
|
|
|
|
|
|
145
|
|
|
|
|
|
|
# or |
146
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
use CSS::DOM::Constants ':rule'; |
148
|
|
|
|
|
|
|
|
149
|
|
|
|
|
|
|
# or individually |
150
|
|
|
|
|
|
|
|
151
|
|
|
|
|
|
|
use CSS::DOM::Constants 'SYNTAX_ERR', ...; |
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
=head1 DESCRIPTION |
154
|
|
|
|
|
|
|
|
155
|
|
|
|
|
|
|
This module provides all the constants used by |
156
|
|
|
|
|
|
|
L<CSS::DOM>. |
157
|
|
|
|
|
|
|
|
158
|
|
|
|
|
|
|
=head1 EXPORTS |
159
|
|
|
|
|
|
|
|
160
|
|
|
|
|
|
|
You can import individual constants by name, or all of them with the ':all' |
161
|
|
|
|
|
|
|
tag. In addition, you can specify one of the following tags, to import a |
162
|
|
|
|
|
|
|
group of constants (which can also be imported from other CSS::DOM |
163
|
|
|
|
|
|
|
modules): |
164
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
=over |
166
|
|
|
|
|
|
|
|
167
|
|
|
|
|
|
|
=item :exception |
168
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
All the constants listed under L<CSS::DOM::Exception/EXPORTS>. |
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
=item :rule |
172
|
|
|
|
|
|
|
|
173
|
|
|
|
|
|
|
All the constants listed under L<CSS::DOM::Rule/EXPORTS>. |
174
|
|
|
|
|
|
|
|
175
|
|
|
|
|
|
|
=item :value |
176
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
All the constants listed under L<CSS::DOM::Value/CONSTANTS>. |
178
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
=item :primitive |
180
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
All the constants listed under L<CSS::DOM::Value::Primitive/CONSTANTS>. |
182
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
=back |
184
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
There is also a C<%SuffixToConst> hash which maps dimension suffixes (such |
186
|
|
|
|
|
|
|
as 'px'; all lowercase) to CSSPrimitiveValue type constants (such as |
187
|
|
|
|
|
|
|
C<CSS_PX>). This is included in the |
188
|
|
|
|
|
|
|
':all' tag. |
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
=head1 SEE ALSO |
191
|
|
|
|
|
|
|
|
192
|
|
|
|
|
|
|
L<CSS::DOM> |
193
|
|
|
|
|
|
|
|
194
|
|
|
|
|
|
|
L<CSS::DOM::Exception> |
195
|
|
|
|
|
|
|
|
196
|
|
|
|
|
|
|
L<CSS::DOM::Rule> |