1CSS::DOM::Interface(3)User Contributed Perl DocumentationCSS::DOM::Interface(3)
2
3
4
6 CSS::DOM::Interface - A list of CSS::DOM's interface members in
7 machine-readable format
8
10 Version 0.17
11
13 use CSS::DOM::Interface ':all';
14
15 # name of DOM interface (CSSStyleRule):
16 $CSS::DOM::Interface{"CSS::DOM::Rule::Style"};
17
18 # interface it inherits from (CSSRule):
19 $CSS::DOM::Interface{CSSStyleRule}{_isa};
20
21 # whether this can be used as an array
22 $CSS::DOM::Interface{MediaList}{_array}; # true
23 # or hash
24 $CSS::DOM::Interface{MediaList}{_hash}; # false
25
26
27 # Properties and Methods
28
29 # list them all
30 grep !/^_/, keys %{ $CSS::DOM::Interface{CSSStyleSheet} };
31
32 # see whether a given property is supported
33 exists $CSS::DOM::Interface{CSSStyleSheet}{foo}; # false
34
35 # Is it a method?
36 $CSS::DOM::Interface{CSSStyleSheet}{cssRules} & METHOD; # false
37 $CSS::DOM::Interface{CSSStyleSheet}{insertRule} & METHOD; # true
38
39 # Does the method return nothing?
40 $CSS::DOM::Interface{MediaList}{deleteMedium} & VOID; # true
41
42 # Is a property read-only?
43 $CSS::DOM::Interface{StyleSheetList}{length} & READONLY; # true
44
45 # Data types of properties
46 ($CSS::DOM::Interface{CSSStyleSheet}{type} & TYPE)
47 == STR; # true
48 ($CSS::DOM::Interface{CSSStyleSheet}{disabled} & TYPE)
49 == BOOL; # true
50 ($CSS::DOM::Interface{CSSStyleSheet}{ownerNode} & TYPE)
51 == NUM; # false
52 ($CSS::DOM::Interface{CSSStyleSheet}{href} & TYPE)
53 == OBJ; # false
54
55 # and return types of methods:
56 ($CSS::DOM::Interface{MediaList}{item} & TYPE) == STR; # true
57 ($CSS::DOM::Interface{CSSMediaRule}
58 ->{insertRule} & TYPE) == BOOL; # false
59 ($CSS::DOM::Interface{CSSStyleDeclaration}
60 ->{getPropertyVaue} & TYPE) == NUM; # false
61 ($CSS::DOM::Interface{CSSStyleDeclaration}
62 ->{removeProperty} & TYPE) == OBJ; # false
63
64
65 # Constants
66
67 # list of constant names in the form "CSS::DOM::Node::STYLE_RULE";
68 @{ $CSS::DOM::Interface{CSSRule}{_constants} };
69
71 The synopsis should tell you almost everything you need to know. But be
72 warned that "$foo & TYPE" is meaningless when "$foo & METHOD" and "$foo
73 & VOID" are both true. For more gory details, look at the source code.
74 In fact, here it is:
75
76 our @EXPORT_OK = qw/METHOD VOID READONLY BOOL STR NUM OBJ TYPE/;
77 our %EXPORT_TAGS = (all => \@EXPORT_OK);
78
79 sub METHOD () { 1 }
80 sub VOID () { 0b10 } # for methods
81 sub READONLY () { 0b10 } # for properties
82 sub BOOL () { 0b0000 }
83 sub STR () { 0b0100 }
84 sub NUM () { 0b1000 }
85 sub OBJ () { 0b1100 }
86 sub TYPE () { 0b1100 } # only for use as a mask
87
88 %CSS::DOM::Interface = (
89 'CSS::DOM' => 'CSSStyleSheet',
90 'CSS::DOM::StyleSheetList' => 'StyleSheetList',
91 'CSS::DOM::MediaList' => 'MediaList',
92 'CSS::DOM::RuleList' => 'CSSRuleList',
93 'CSS::DOM::Rule' => 'CSSRule',
94 'CSS::DOM::Rule::Style' => 'CSSStyleRule',
95 'CSS::DOM::Rule::Media' => 'CSSMediaRule',
96 'CSS::DOM::Rule::FontFace' => 'CSSFontFaceRule',
97 'CSS::DOM::Rule::Page' => 'CSSPageRule',
98 'CSS::DOM::Rule::Import' => 'CSSImportRule',
99 'CSS::DOM::Rule::Charset' => 'CSSCharsetRule',
100 'CSS::DOM::Style' => 'CSSStyleDeclaration',
101 'CSS::DOM::Value' => 'CSSValue',
102 'CSS::DOM::Value::Primitive' => 'CSSPrimitiveValue',
103 'CSS::DOM::Value::List' => 'CSSValueList',
104 'CSS::DOM::Counter' => 'Counter',
105 StyleSheetList => {
106 _hash => 0,
107 _array => 1,
108 length => NUM | READONLY,
109 item => METHOD | OBJ,
110 },
111 MediaList => {
112 _hash => 0,
113 _array => 1,
114 mediaText => STR,
115 length => NUM | READONLY,
116 item => METHOD | STR,
117 deleteMedium => METHOD | VOID,
118 appendMedium => METHOD | VOID,
119 },
120 CSSRuleList => {
121 _hash => 0,
122 _array => 1,
123 length => NUM | READONLY,
124 item => METHOD | OBJ,
125 },
126 CSSRule => {
127 _hash => 0,
128 _array => 0,
129 _constants => [qw[
130 CSS::DOM::Rule::UNKNOWN_RULE
131 CSS::DOM::Rule::STYLE_RULE
132 CSS::DOM::Rule::CHARSET_RULE
133 CSS::DOM::Rule::IMPORT_RULE
134 CSS::DOM::Rule::MEDIA_RULE
135 CSS::DOM::Rule::FONT_FACE_RULE
136 CSS::DOM::Rule::PAGE_RULE
137 ]],
138 type => NUM | READONLY,
139 cssText => STR,
140 parentStyleSheet => OBJ | READONLY,
141 parentRule => OBJ | READONLY,
142 },
143 CSSStyleRule => {
144 _isa => 'CSSRule',
145 _hash => 0,
146 _array => 0,
147 selectorText => STR,
148 style => OBJ | READONLY,
149 },
150 CSSMediaRule => {
151 _isa => 'CSSRule',
152 _hash => 0,
153 _array => 0,
154 media => OBJ | READONLY,
155 cssRules => OBJ | READONLY,
156 insertRule => METHOD | NUM,
157 deleteRule => METHOD | VOID,
158 },
159 CSSFontFaceRule => {
160 _isa => 'CSSRule',
161 _hash => 0,
162 _array => 0,
163 style => OBJ | READONLY,
164 },
165 CSSPageRule => {
166 _isa => 'CSSRule',
167 _hash => 0,
168 _array => 0,
169 selectorText => STR,
170 style => OBJ | READONLY,
171 },
172 CSSImportRule => {
173 _isa => 'CSSRule',
174 _hash => 0,
175 _array => 0,
176 href => STR | READONLY,
177 media => OBJ | READONLY,
178 styleSheet => OBJ | READONLY,
179 },
180 CSSCharsetRule => {
181 _isa => 'CSSRule',
182 _hash => 0,
183 _array => 0,
184 encoding => STR,
185 },
186 CSSStyleDeclaration => {
187 _hash => 0,
188 _array => 1,
189 cssText => STR,
190 getPropertyValue => METHOD | STR,
191 getPropertyCSSValue => METHOD | OBJ,
192 removeProperty => METHOD | STR,
193 getPropertyPriority => METHOD | STR,
194 setProperty => METHOD | VOID,
195 length => NUM | READONLY,
196 item => METHOD | STR,
197 parentRule => OBJ | READONLY,
198 azimuth => STR,
199 background => STR,
200 backgroundAttachment => STR,
201 backgroundColor => STR,
202 backgroundImage => STR,
203 backgroundPosition => STR,
204 backgroundRepeat => STR,
205 border => STR,
206 borderCollapse => STR,
207 borderColor => STR,
208 borderSpacing => STR,
209 borderStyle => STR,
210 borderTop => STR,
211 borderRight => STR,
212 borderBottom => STR,
213 borderLeft => STR,
214 borderTopColor => STR,
215 borderRightColor => STR,
216 borderBottomColor => STR,
217 borderLeftColor => STR,
218 borderTopStyle => STR,
219 borderRightStyle => STR,
220 borderBottomStyle => STR,
221 borderLeftStyle => STR,
222 borderTopWidth => STR,
223 borderRightWidth => STR,
224 borderBottomWidth => STR,
225 borderLeftWidth => STR,
226 borderWidth => STR,
227 bottom => STR,
228 captionSide => STR,
229 clear => STR,
230 clip => STR,
231 color => STR,
232 content => STR,
233 counterIncrement => STR,
234 counterReset => STR,
235 cue => STR,
236 cueAfter => STR,
237 cueBefore => STR,
238 cursor => STR,
239 direction => STR,
240 display => STR,
241 elevation => STR,
242 emptyCells => STR,
243 cssFloat => STR,
244 font => STR,
245 fontFamily => STR,
246 fontSize => STR,
247 fontSizeAdjust => STR,
248 fontStretch => STR,
249 fontStyle => STR,
250 fontVariant => STR,
251 fontWeight => STR,
252 height => STR,
253 left => STR,
254 letterSpacing => STR,
255 lineHeight => STR,
256 listStyle => STR,
257 listStyleImage => STR,
258 listStylePosition => STR,
259 listStyleType => STR,
260 margin => STR,
261 marginTop => STR,
262 marginRight => STR,
263 marginBottom => STR,
264 marginLeft => STR,
265 markerOffset => STR,
266 marks => STR,
267 maxHeight => STR,
268 maxWidth => STR,
269 minHeight => STR,
270 minWidth => STR,
271 opacity => STR,
272 orphans => STR,
273 outline => STR,
274 outlineColor => STR,
275 outlineStyle => STR,
276 outlineWidth => STR,
277 overflow => STR,
278 padding => STR,
279 paddingTop => STR,
280 paddingRight => STR,
281 paddingBottom => STR,
282 paddingLeft => STR,
283 page => STR,
284 pageBreakAfter => STR,
285 pageBreakBefore => STR,
286 pageBreakInside => STR,
287 pause => STR,
288 pauseAfter => STR,
289 pauseBefore => STR,
290 pitch => STR,
291 pitchRange => STR,
292 playDuring => STR,
293 position => STR,
294 quotes => STR,
295 richness => STR,
296 right => STR,
297 size => STR,
298 speak => STR,
299 speakHeader => STR,
300 speakNumeral => STR,
301 speakPunctuation => STR,
302 speechRate => STR,
303 stress => STR,
304 tableLayout => STR,
305 textAlign => STR,
306 textDecoration => STR,
307 textIndent => STR,
308 textShadow => STR,
309 textTransform => STR,
310 top => STR,
311 unicodeBidi => STR,
312 verticalAlign => STR,
313 visibility => STR,
314 voiceFamily => STR,
315 volume => STR,
316 whiteSpace => STR,
317 widows => STR,
318 width => STR,
319 wordSpacing => STR,
320 zIndex => STR,
321 },
322 CSSValue => {
323 _hash => 0,
324 _array => 0,
325 _constants => [qw[
326 CSS::DOM::Value::CSS_INHERIT
327 CSS::DOM::Value::CSS_PRIMITIVE_VALUE
328 CSS::DOM::Value::CSS_VALUE_LIST
329 CSS::DOM::Value::CSS_CUSTOM
330 ]],
331 cssText => STR,
332 cssValueType => NUM | READONLY,
333 },
334 CSSPrimitiveValue => {
335 _isa => 'CSSValue',
336 _hash => 0,
337 _array => 0,
338 _constants => [qw[
339 CSS::DOM::Value::Primitive::CSS_UNKNOWN
340 CSS::DOM::Value::Primitive::CSS_NUMBER
341 CSS::DOM::Value::Primitive::CSS_PERCENTAGE
342 CSS::DOM::Value::Primitive::CSS_EMS
343 CSS::DOM::Value::Primitive::CSS_EXS
344 CSS::DOM::Value::Primitive::CSS_PX
345 CSS::DOM::Value::Primitive::CSS_CM
346 CSS::DOM::Value::Primitive::CSS_MM
347 CSS::DOM::Value::Primitive::CSS_IN
348 CSS::DOM::Value::Primitive::CSS_PT
349 CSS::DOM::Value::Primitive::CSS_PC
350 CSS::DOM::Value::Primitive::CSS_DEG
351 CSS::DOM::Value::Primitive::CSS_RAD
352 CSS::DOM::Value::Primitive::CSS_GRAD
353 CSS::DOM::Value::Primitive::CSS_MS
354 CSS::DOM::Value::Primitive::CSS_S
355 CSS::DOM::Value::Primitive::CSS_HZ
356 CSS::DOM::Value::Primitive::CSS_KHZ
357 CSS::DOM::Value::Primitive::CSS_DIMENSION
358 CSS::DOM::Value::Primitive::CSS_STRING
359 CSS::DOM::Value::Primitive::CSS_URI
360 CSS::DOM::Value::Primitive::CSS_IDENT
361 CSS::DOM::Value::Primitive::CSS_ATTR
362 CSS::DOM::Value::Primitive::CSS_COUNTER
363 CSS::DOM::Value::Primitive::CSS_RECT
364 CSS::DOM::Value::Primitive::CSS_RGBCOLOR
365 ]],
366 primitiveType => NUM | READONLY,
367 setFloatValue => METHOD | VOID,
368 getFloatValue => METHOD | NUM,
369 setStringValue => METHOD | VOID,
370 getStringValue => METHOD | STR,
371 # getCounterValue => METHOD | OBJ,
372 # getRectValue => METHOD | OBJ,
373 # getRGBColorValue => METHOD | OBJ,
374 red => OBJ | READONLY,
375 green => OBJ | READONLY,
376 blue => OBJ | READONLY,
377 alpha => OBJ | READONLY,
378 top => OBJ | READONLY,
379 right => OBJ | READONLY,
380 bottom => OBJ | READONLY,
381 left => OBJ | READONLY,
382 },
383 CSSValueList => {
384 _isa => 'CSSValue',
385 _hash => 0,
386 _array => 1,
387 length => NUM | READONLY,
388 item => METHOD | OBJ,
389 },
390 # Counter => {
391 # _hash => 0,
392 # _array => 0,
393 # identifier => STR | READONLY,
394 # listStyle => STR | READONLY,
395 # separator => STR | READONLY,
396 # },
397 CSSStyleSheet => {
398 type => STR | READONLY,
399 _hash => 0,
400 _array => 0,
401 disabled => BOOL,
402 ownerNode => OBJ | READONLY,
403 parentStyleSheet => OBJ | READONLY,
404 href => STR | READONLY,
405 title => STR | READONLY,
406 media => OBJ | READONLY,
407 ownerRule => OBJ | READONLY,
408 cssRules => OBJ | READONLY,
409 insertRule => METHOD | NUM,
410 deleteRule => METHOD | VOID,
411 },
412 );
413
414 __END__
415
417 CSS::DOM
418
419
420
421perl v5.38.0 2023-07-20 CSS::DOM::Interface(3)