line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
###
|
3
|
|
|
|
|
|
|
# CSS::SAC::SelectorFactory - the default SelectorFactory
|
4
|
|
|
|
|
|
|
# Robin Berjon
|
5
|
|
|
|
|
|
|
# 24/02/2001
|
6
|
|
|
|
|
|
|
###
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package CSS::SAC::SelectorFactory;
|
9
|
2
|
|
|
2
|
|
13
|
use strict;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
223
|
|
10
|
2
|
|
|
2
|
|
13
|
use vars qw($VERSION);
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
143
|
|
11
|
|
|
|
|
|
|
$VERSION = $CSS::SAC::VERSION || '0.03';
|
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
1554
|
use CSS::SAC::Selector qw(:constants);
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
14
|
|
14
|
2
|
|
|
2
|
|
1325
|
use CSS::SAC::Selector::Descendant qw();
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
48
|
|
15
|
2
|
|
|
2
|
|
1719
|
use CSS::SAC::Selector::Sibling qw();
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
43
|
|
16
|
2
|
|
|
2
|
|
1540
|
use CSS::SAC::Selector::Simple qw();
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
92
|
|
17
|
2
|
|
|
2
|
|
1468
|
use CSS::SAC::Selector::CharacterData qw();
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
40
|
|
18
|
2
|
|
|
2
|
|
1457
|
use CSS::SAC::Selector::Conditional qw();
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
44
|
|
19
|
2
|
|
|
2
|
|
1590
|
use CSS::SAC::Selector::Element qw();
|
|
2
|
|
|
|
|
6
|
|
|
2
|
|
|
|
|
43
|
|
20
|
2
|
|
|
2
|
|
1268
|
use CSS::SAC::Selector::Negative qw();
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
45
|
|
21
|
2
|
|
|
2
|
|
1737
|
use CSS::SAC::Selector::ProcessingInstruction qw();
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
61
|
|
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
24
|
|
|
|
|
|
|
# build the fields for an array based object
|
25
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
26
|
2
|
|
|
2
|
|
13
|
use Class::ArrayObjects define => { fields => [] };
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
12
|
|
27
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
### Constructor #######################################################
|
32
|
|
|
|
|
|
|
# #
|
33
|
|
|
|
|
|
|
# #
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
37
|
|
|
|
|
|
|
# CSS::SAC::SelectorFactory->new
|
38
|
|
|
|
|
|
|
# creates a new sac selector factory
|
39
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
40
|
|
|
|
|
|
|
sub new {
|
41
|
2
|
50
|
|
2
|
1
|
12
|
my $class = ref($_[0])?ref(shift):shift;
|
42
|
2
|
|
|
|
|
24
|
return bless [], $class;
|
43
|
|
|
|
|
|
|
}
|
44
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
|
47
|
|
|
|
|
|
|
# #
|
48
|
|
|
|
|
|
|
# #
|
49
|
|
|
|
|
|
|
### Constructor #######################################################
|
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
### Factory Methods ###################################################
|
54
|
|
|
|
|
|
|
# #
|
55
|
|
|
|
|
|
|
# #
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# defined aliases
|
59
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createAnyNodeSelector = \&create_any_node_selector;
|
60
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createCdataSectionSelector = \&create_cdata_section_selector;
|
61
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createChildSelector = \&create_child_selector;
|
62
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createCommentSelector = \&create_comment_selector;
|
63
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createConditionalSelector = \&create_conditional_selector;
|
64
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createDescendantSelector = \&create_descendant_selector;
|
65
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createDirectAdjacentSelector = \&create_direct_adjacent_selector;
|
66
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createElementSelector = \&create_element_selector;
|
67
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createNegativeSelector = \&create_negative_selector;
|
68
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createProcessingInstructionSelector = \&create_processing_instruction_selector;
|
69
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createPseudoElementSelector = \&create_pseudo_element_selector;
|
70
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createRootNodeSelector = \&create_root_node_selector;
|
71
|
|
|
|
|
|
|
*CSS::SAC::SelectorFactory::createTextNodeSelector = \&create_text_node_selector;
|
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
|
74
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
75
|
|
|
|
|
|
|
# my $sel = $sf->create_any_node_selector
|
76
|
|
|
|
|
|
|
# creates a any-node selector
|
77
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
78
|
|
|
|
|
|
|
sub create_any_node_selector {
|
79
|
0
|
|
|
0
|
1
|
0
|
my $cf = shift;
|
80
|
0
|
|
|
|
|
0
|
return CSS::SAC::Selector::Simple->new(ANY_NODE_SELECTOR);
|
81
|
|
|
|
|
|
|
}
|
82
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
83
|
|
|
|
|
|
|
|
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
86
|
|
|
|
|
|
|
# my $sel = $sf->create_cdata_section_selector($data)
|
87
|
|
|
|
|
|
|
# creates a cdata selector
|
88
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
89
|
|
|
|
|
|
|
sub create_cdata_section_selector {
|
90
|
0
|
|
|
0
|
1
|
0
|
my $cf = shift;
|
91
|
0
|
|
|
|
|
0
|
my $data = shift;
|
92
|
|
|
|
|
|
|
|
93
|
0
|
|
|
|
|
0
|
return CSS::SAC::Selector::CharacterData->new(
|
94
|
|
|
|
|
|
|
CDATA_SECTION_NODE_SELECTOR,
|
95
|
|
|
|
|
|
|
$data
|
96
|
|
|
|
|
|
|
);
|
97
|
|
|
|
|
|
|
}
|
98
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
102
|
|
|
|
|
|
|
# my $sel = $sf->create_child_selector($parent_sel,$child_sel)
|
103
|
|
|
|
|
|
|
# creates a child selector
|
104
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
105
|
|
|
|
|
|
|
sub create_child_selector {
|
106
|
1
|
|
|
1
|
1
|
3
|
my $cf = shift;
|
107
|
1
|
|
|
|
|
2
|
my $parent_sel = shift;
|
108
|
1
|
|
|
|
|
3
|
my $child_sel = shift;
|
109
|
|
|
|
|
|
|
|
110
|
1
|
|
|
|
|
5
|
return CSS::SAC::Selector::Descendant->new(
|
111
|
|
|
|
|
|
|
CHILD_SELECTOR,
|
112
|
|
|
|
|
|
|
$parent_sel,
|
113
|
|
|
|
|
|
|
$child_sel
|
114
|
|
|
|
|
|
|
);
|
115
|
|
|
|
|
|
|
}
|
116
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
117
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
120
|
|
|
|
|
|
|
# my $sel = $sf->create_comment_selector($data)
|
121
|
|
|
|
|
|
|
# creates a comment selector
|
122
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
123
|
|
|
|
|
|
|
sub create_comment_selector {
|
124
|
0
|
|
|
0
|
1
|
0
|
my $cf = shift;
|
125
|
0
|
|
|
|
|
0
|
my $data = shift;
|
126
|
|
|
|
|
|
|
|
127
|
0
|
|
|
|
|
0
|
return CSS::SAC::Selector::CharacterData->new(
|
128
|
|
|
|
|
|
|
COMMENT_NODE_SELECTOR,
|
129
|
|
|
|
|
|
|
$data
|
130
|
|
|
|
|
|
|
);
|
131
|
|
|
|
|
|
|
}
|
132
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
|
135
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
136
|
|
|
|
|
|
|
# my $sel = $sf->create_conditional_selector($sel,$cond)
|
137
|
|
|
|
|
|
|
# creates a conditional selector
|
138
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
139
|
|
|
|
|
|
|
sub create_conditional_selector {
|
140
|
34
|
|
|
34
|
1
|
46
|
my $cf = shift;
|
141
|
34
|
|
|
|
|
43
|
my $sel = shift;
|
142
|
34
|
|
|
|
|
41
|
my $cond = shift;
|
143
|
|
|
|
|
|
|
|
144
|
34
|
|
|
|
|
132
|
return CSS::SAC::Selector::Conditional->new(
|
145
|
|
|
|
|
|
|
CONDITIONAL_SELECTOR,
|
146
|
|
|
|
|
|
|
$sel,
|
147
|
|
|
|
|
|
|
$cond
|
148
|
|
|
|
|
|
|
);
|
149
|
|
|
|
|
|
|
}
|
150
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
151
|
|
|
|
|
|
|
|
152
|
|
|
|
|
|
|
|
153
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
154
|
|
|
|
|
|
|
# my $sel = $sf->create_descendant_selector($parent_sel,$desc_sel)
|
155
|
|
|
|
|
|
|
# creates a descendant selector
|
156
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
157
|
|
|
|
|
|
|
sub create_descendant_selector {
|
158
|
1
|
|
|
1
|
1
|
3
|
my $cf = shift;
|
159
|
1
|
|
|
|
|
1
|
my $parent_sel = shift;
|
160
|
1
|
|
|
|
|
15
|
my $desc_sel = shift;
|
161
|
|
|
|
|
|
|
|
162
|
1
|
|
|
|
|
12
|
return CSS::SAC::Selector::Descendant->new(
|
163
|
|
|
|
|
|
|
DESCENDANT_SELECTOR,
|
164
|
|
|
|
|
|
|
$parent_sel,
|
165
|
|
|
|
|
|
|
$desc_sel
|
166
|
|
|
|
|
|
|
);
|
167
|
|
|
|
|
|
|
}
|
168
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
169
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
|
171
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
172
|
|
|
|
|
|
|
# my $sel = $sf->create_direct_adjacent_selector($node_type,$child,$adjacent)
|
173
|
|
|
|
|
|
|
# creates a direct adjacent selector
|
174
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
175
|
|
|
|
|
|
|
sub create_direct_adjacent_selector {
|
176
|
1
|
|
|
1
|
1
|
2
|
my $cf = shift;
|
177
|
1
|
|
|
|
|
3
|
my $node_type = shift;
|
178
|
1
|
|
|
|
|
2
|
my $child = shift;
|
179
|
1
|
|
|
|
|
3
|
my $adjacent = shift;
|
180
|
|
|
|
|
|
|
|
181
|
1
|
|
|
|
|
10
|
return CSS::SAC::Selector::Sibling->new(
|
182
|
|
|
|
|
|
|
DIRECT_ADJACENT_SELECTOR,
|
183
|
|
|
|
|
|
|
$node_type,
|
184
|
|
|
|
|
|
|
$child,
|
185
|
|
|
|
|
|
|
$adjacent
|
186
|
|
|
|
|
|
|
);
|
187
|
|
|
|
|
|
|
}
|
188
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
189
|
|
|
|
|
|
|
|
190
|
|
|
|
|
|
|
|
191
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
192
|
|
|
|
|
|
|
# my $sel = $sf->create_element_selector($ns,$lname)
|
193
|
|
|
|
|
|
|
# creates a element selector
|
194
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
195
|
|
|
|
|
|
|
sub create_element_selector {
|
196
|
48
|
|
|
48
|
1
|
68
|
my $cf = shift;
|
197
|
48
|
|
|
|
|
64
|
my $ns = shift;
|
198
|
48
|
|
|
|
|
59
|
my $lname = shift;
|
199
|
|
|
|
|
|
|
|
200
|
48
|
|
|
|
|
192
|
return CSS::SAC::Selector::Element->new(
|
201
|
|
|
|
|
|
|
ELEMENT_NODE_SELECTOR,
|
202
|
|
|
|
|
|
|
$ns,
|
203
|
|
|
|
|
|
|
$lname
|
204
|
|
|
|
|
|
|
);
|
205
|
|
|
|
|
|
|
}
|
206
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
207
|
|
|
|
|
|
|
|
208
|
|
|
|
|
|
|
|
209
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
210
|
|
|
|
|
|
|
# my $sel = $sf->create_negative_selector($sel)
|
211
|
|
|
|
|
|
|
# creates a negative selector
|
212
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
213
|
|
|
|
|
|
|
sub create_negative_selector {
|
214
|
0
|
|
|
0
|
1
|
0
|
my $cf = shift;
|
215
|
0
|
|
|
|
|
0
|
my $sel = shift;
|
216
|
|
|
|
|
|
|
|
217
|
0
|
|
|
|
|
0
|
return CSS::SAC::Selector::Negative->new(
|
218
|
|
|
|
|
|
|
NEGATIVE_SELECTOR,
|
219
|
|
|
|
|
|
|
$sel
|
220
|
|
|
|
|
|
|
);
|
221
|
|
|
|
|
|
|
}
|
222
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
223
|
|
|
|
|
|
|
|
224
|
|
|
|
|
|
|
|
225
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
226
|
|
|
|
|
|
|
# my $sel = $sf->create_processing_instruction_selector($target,$data)
|
227
|
|
|
|
|
|
|
# creates a pi selector
|
228
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
229
|
|
|
|
|
|
|
sub create_processing_instruction_selector {
|
230
|
0
|
|
|
0
|
1
|
0
|
my $cf = shift;
|
231
|
0
|
|
|
|
|
0
|
my $target = shift;
|
232
|
0
|
|
|
|
|
0
|
my $data = shift;
|
233
|
|
|
|
|
|
|
|
234
|
0
|
|
|
|
|
0
|
return CSS::SAC::Selector::ProcessingInstruction->new(
|
235
|
|
|
|
|
|
|
PROCESSING_INSTRUCTION_NODE_SELECTOR,
|
236
|
|
|
|
|
|
|
$target,
|
237
|
|
|
|
|
|
|
$data
|
238
|
|
|
|
|
|
|
);
|
239
|
|
|
|
|
|
|
}
|
240
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
241
|
|
|
|
|
|
|
|
242
|
|
|
|
|
|
|
|
243
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
244
|
|
|
|
|
|
|
# my $sel = $sf->create_pseudo_element_selector($ns,$lname)
|
245
|
|
|
|
|
|
|
# creates a pseudo-e selector
|
246
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
247
|
|
|
|
|
|
|
sub create_pseudo_element_selector {
|
248
|
2
|
|
|
2
|
1
|
5
|
my $cf = shift;
|
249
|
2
|
|
|
|
|
4
|
my $ns = shift;
|
250
|
2
|
|
|
|
|
6
|
my $lname = shift;
|
251
|
|
|
|
|
|
|
|
252
|
2
|
|
|
|
|
10
|
return CSS::SAC::Selector::Element->new(
|
253
|
|
|
|
|
|
|
PSEUDO_ELEMENT_SELECTOR,
|
254
|
|
|
|
|
|
|
$ns,
|
255
|
|
|
|
|
|
|
$lname
|
256
|
|
|
|
|
|
|
);
|
257
|
|
|
|
|
|
|
}
|
258
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
259
|
|
|
|
|
|
|
|
260
|
|
|
|
|
|
|
|
261
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
262
|
|
|
|
|
|
|
# my $sel = $sf->create_root_node_selector
|
263
|
|
|
|
|
|
|
# creates a root selector
|
264
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
265
|
|
|
|
|
|
|
sub create_root_node_selector {
|
266
|
0
|
|
|
0
|
1
|
0
|
my $cf = shift;
|
267
|
0
|
|
|
|
|
0
|
return CSS::SAC::Selector::Simple->new(ROOT_NODE_SELECTOR);
|
268
|
|
|
|
|
|
|
}
|
269
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
270
|
|
|
|
|
|
|
|
271
|
|
|
|
|
|
|
|
272
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
273
|
|
|
|
|
|
|
# my $sel = $sf->create_text_node_selector($data)
|
274
|
|
|
|
|
|
|
# creates a text selector
|
275
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
276
|
|
|
|
|
|
|
sub create_text_node_selector {
|
277
|
0
|
|
|
0
|
1
|
0
|
my $cf = shift;
|
278
|
0
|
|
|
|
|
0
|
my $data = shift;
|
279
|
|
|
|
|
|
|
|
280
|
0
|
|
|
|
|
0
|
return CSS::SAC::Selector::CharacterData->new(
|
281
|
|
|
|
|
|
|
TEXT_NODE_SELECTOR,
|
282
|
|
|
|
|
|
|
$data
|
283
|
|
|
|
|
|
|
);
|
284
|
|
|
|
|
|
|
}
|
285
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
286
|
|
|
|
|
|
|
|
287
|
|
|
|
|
|
|
|
288
|
|
|
|
|
|
|
# #
|
289
|
|
|
|
|
|
|
# #
|
290
|
|
|
|
|
|
|
### Factory Methods ###################################################
|
291
|
|
|
|
|
|
|
|
292
|
|
|
|
|
|
|
|
293
|
|
|
|
|
|
|
|
294
|
|
|
|
|
|
|
|
295
|
|
|
|
|
|
|
### EXPERIMENTAL Factory Methods ######################################
|
296
|
|
|
|
|
|
|
# #
|
297
|
|
|
|
|
|
|
# #
|
298
|
|
|
|
|
|
|
|
299
|
|
|
|
|
|
|
|
300
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
301
|
|
|
|
|
|
|
# my $sel = $sf->create_indirect_adjacent_selector($node_type,$child,$adjacent)
|
302
|
|
|
|
|
|
|
# creates an indirect adjacent selector
|
303
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
304
|
|
|
|
|
|
|
sub create_indirect_adjacent_selector {
|
305
|
1
|
|
|
1
|
0
|
3
|
my $cf = shift;
|
306
|
1
|
|
|
|
|
2
|
my $node_type = shift;
|
307
|
1
|
|
|
|
|
3
|
my $child = shift;
|
308
|
1
|
|
|
|
|
1
|
my $adjacent = shift;
|
309
|
|
|
|
|
|
|
|
310
|
1
|
|
|
|
|
23
|
return CSS::SAC::Selector::Sibling->new(
|
311
|
|
|
|
|
|
|
INDIRECT_ADJACENT_SELECTOR,
|
312
|
|
|
|
|
|
|
$node_type,
|
313
|
|
|
|
|
|
|
$child,
|
314
|
|
|
|
|
|
|
$adjacent
|
315
|
|
|
|
|
|
|
);
|
316
|
|
|
|
|
|
|
}
|
317
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
318
|
|
|
|
|
|
|
|
319
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
# #
|
321
|
|
|
|
|
|
|
# #
|
322
|
|
|
|
|
|
|
### EXPERIMENTAL Factory Methods ######################################
|
323
|
|
|
|
|
|
|
|
324
|
|
|
|
|
|
|
1;
|
325
|
|
|
|
|
|
|
|
326
|
|
|
|
|
|
|
=pod
|
327
|
|
|
|
|
|
|
|
328
|
|
|
|
|
|
|
=head1 NAME
|
329
|
|
|
|
|
|
|
|
330
|
|
|
|
|
|
|
CSS::SAC::SelectorFactory - the default SelectorFactory
|
331
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
333
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
fill this in later...
|
335
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
337
|
|
|
|
|
|
|
|
338
|
|
|
|
|
|
|
This is the default SelectorFactory for CSS::SAC. It creates
|
339
|
|
|
|
|
|
|
selectors of all types defined in SAC. You may wish to subclass or
|
340
|
|
|
|
|
|
|
replace the default SelectorFactory in order to get your own
|
341
|
|
|
|
|
|
|
selector objects.
|
342
|
|
|
|
|
|
|
|
343
|
|
|
|
|
|
|
I plan on adding more flexibility to this factory so that one could
|
344
|
|
|
|
|
|
|
tell it the classes to use for various selectors, that would avoid
|
345
|
|
|
|
|
|
|
enforcing subclassing/recoding for people that only want to replace
|
346
|
|
|
|
|
|
|
a family of factory methods.
|
347
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
I know that some of the method names are quite lengthy, but given the
|
349
|
|
|
|
|
|
|
great number of possible selectors it helps to have descriptive
|
350
|
|
|
|
|
|
|
names.
|
351
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
=head1 METHODS
|
353
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
All the C methods have a spec-style equivalent. Just remove
|
355
|
|
|
|
|
|
|
the _ and capitalize the next letter.
|
356
|
|
|
|
|
|
|
|
357
|
|
|
|
|
|
|
=over 4
|
358
|
|
|
|
|
|
|
|
359
|
|
|
|
|
|
|
=item * CSS::SAC::SelectorFactory->new or $cf->new
|
360
|
|
|
|
|
|
|
|
361
|
|
|
|
|
|
|
Creates a new condition factory object.
|
362
|
|
|
|
|
|
|
|
363
|
|
|
|
|
|
|
=item * $sf->create_any_node_selector
|
364
|
|
|
|
|
|
|
|
365
|
|
|
|
|
|
|
creates a any-node selector
|
366
|
|
|
|
|
|
|
|
367
|
|
|
|
|
|
|
=item * $sf->create_cdata_section_selector($data)
|
368
|
|
|
|
|
|
|
|
369
|
|
|
|
|
|
|
creates a cdata selector
|
370
|
|
|
|
|
|
|
|
371
|
|
|
|
|
|
|
=item * $sf->create_child_selector($parent_sel,$child_sel)
|
372
|
|
|
|
|
|
|
|
373
|
|
|
|
|
|
|
creates a child selector
|
374
|
|
|
|
|
|
|
|
375
|
|
|
|
|
|
|
=item * $sf->create_comment_selector($data)
|
376
|
|
|
|
|
|
|
|
377
|
|
|
|
|
|
|
creates a comment selector
|
378
|
|
|
|
|
|
|
|
379
|
|
|
|
|
|
|
=item * $sf->create_conditional_selector($sel,$cond)
|
380
|
|
|
|
|
|
|
|
381
|
|
|
|
|
|
|
creates a conditional selector
|
382
|
|
|
|
|
|
|
|
383
|
|
|
|
|
|
|
=item * $sf->create_descendant_selector($parent_sel,$desc_sel)
|
384
|
|
|
|
|
|
|
|
385
|
|
|
|
|
|
|
creates a descendant selector
|
386
|
|
|
|
|
|
|
|
387
|
|
|
|
|
|
|
=item * $sf->create_direct_adjacent_selector($node_type,$child,$adjacent)
|
388
|
|
|
|
|
|
|
|
389
|
|
|
|
|
|
|
creates a direct adjacent selector
|
390
|
|
|
|
|
|
|
|
391
|
|
|
|
|
|
|
=item * $sf->create_element_selector($ns,$lname)
|
392
|
|
|
|
|
|
|
|
393
|
|
|
|
|
|
|
creates a element selector
|
394
|
|
|
|
|
|
|
|
395
|
|
|
|
|
|
|
=item * $sf->create_negative_selector($sel)
|
396
|
|
|
|
|
|
|
|
397
|
|
|
|
|
|
|
creates a negative selector
|
398
|
|
|
|
|
|
|
|
399
|
|
|
|
|
|
|
=item * $sf->create_processing_instruction_selector($target,$data)
|
400
|
|
|
|
|
|
|
|
401
|
|
|
|
|
|
|
creates a pi selector
|
402
|
|
|
|
|
|
|
|
403
|
|
|
|
|
|
|
=item * $sf->create_pseudo_element_selector($ns,$lname)
|
404
|
|
|
|
|
|
|
|
405
|
|
|
|
|
|
|
creates a pseudo-e selector
|
406
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
=item * $sf->create_root_node_selector
|
408
|
|
|
|
|
|
|
|
409
|
|
|
|
|
|
|
creates a root selector
|
410
|
|
|
|
|
|
|
|
411
|
|
|
|
|
|
|
=item * $sf->create_text_node_selector($data)
|
412
|
|
|
|
|
|
|
|
413
|
|
|
|
|
|
|
creates a text selector
|
414
|
|
|
|
|
|
|
|
415
|
|
|
|
|
|
|
=back
|
416
|
|
|
|
|
|
|
|
417
|
|
|
|
|
|
|
=head1 AUTHOR
|
418
|
|
|
|
|
|
|
|
419
|
|
|
|
|
|
|
Robin Berjon
|
420
|
|
|
|
|
|
|
|
421
|
|
|
|
|
|
|
This module is licensed under the same terms as Perl itself.
|
422
|
|
|
|
|
|
|
|
423
|
|
|
|
|
|
|
=cut
|
424
|
|
|
|
|
|
|
|
425
|
|
|
|
|
|
|
|