line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
###
|
3
|
|
|
|
|
|
|
# CSS::SAC::Selector::Descendant - SAC DescendantSelector
|
4
|
|
|
|
|
|
|
# Robin Berjon
|
5
|
|
|
|
|
|
|
# 24/02/2001
|
6
|
|
|
|
|
|
|
###
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package CSS::SAC::Selector::Descendant;
|
9
|
2
|
|
|
2
|
|
11
|
use strict;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
132
|
|
10
|
2
|
|
|
2
|
|
11
|
use vars qw($VERSION);
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
104
|
|
11
|
|
|
|
|
|
|
$VERSION = $CSS::SAC::VERSION || '0.03';
|
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
12
|
use base qw(CSS::SAC::Selector);
|
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
230
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
17
|
|
|
|
|
|
|
# build the fields for an array based object
|
18
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
19
|
2
|
|
|
|
|
17
|
use Class::ArrayObjects extend => {
|
20
|
|
|
|
|
|
|
class => 'CSS::SAC::Selector',
|
21
|
|
|
|
|
|
|
with => [qw(
|
22
|
|
|
|
|
|
|
_ancestor_
|
23
|
|
|
|
|
|
|
_simple_
|
24
|
|
|
|
|
|
|
)],
|
25
|
2
|
|
|
2
|
|
49
|
};
|
|
2
|
|
|
|
|
4
|
|
26
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
### Constructor #######################################################
|
32
|
|
|
|
|
|
|
# #
|
33
|
|
|
|
|
|
|
# #
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
37
|
|
|
|
|
|
|
# CSS::SAC::Selector::Descendant->new($type,$ancestor_sel,$simple_sel)
|
38
|
|
|
|
|
|
|
# creates a new sac DescendantSelector object
|
39
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
40
|
|
|
|
|
|
|
sub new {
|
41
|
2
|
50
|
|
2
|
1
|
7
|
my $class = ref($_[0])?ref(shift):shift;
|
42
|
2
|
|
|
|
|
4
|
my $type = shift;
|
43
|
2
|
|
|
|
|
3
|
my $ancestor_sel = shift;
|
44
|
2
|
|
|
|
|
3
|
my $simple_sel = shift;
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# create a selector
|
47
|
2
|
|
|
|
|
14
|
my $dsel = $class->SUPER::new($type);
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# add our fields
|
50
|
2
|
|
|
|
|
11
|
$dsel->[_ancestor_] = $ancestor_sel;
|
51
|
2
|
|
|
|
|
5
|
$dsel->[_simple_] = $simple_sel;
|
52
|
|
|
|
|
|
|
|
53
|
2
|
|
|
|
|
11
|
return $dsel;
|
54
|
|
|
|
|
|
|
}
|
55
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# #
|
59
|
|
|
|
|
|
|
# #
|
60
|
|
|
|
|
|
|
### Constructor #######################################################
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
### Accessors #########################################################
|
65
|
|
|
|
|
|
|
# #
|
66
|
|
|
|
|
|
|
# #
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
*CSS::SAC::Selector::Descendant::getAncestorSelector = \&AncestorSelector;
|
69
|
|
|
|
|
|
|
*CSS::SAC::Selector::Descendant::getSimpleSelector = \&SimpleSelector;
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
72
|
|
|
|
|
|
|
# my $ancestor_sel = $dsel->AncestorSelector()
|
73
|
|
|
|
|
|
|
# $dsel->AncestorSelector($ancestor_sel)
|
74
|
|
|
|
|
|
|
# get/set the selector's ancestor selector
|
75
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
76
|
|
|
|
|
|
|
sub AncestorSelector {
|
77
|
2
|
50
|
|
2
|
1
|
30
|
(@_==2) ? $_[0]->[_ancestor_] = $_[1] :
|
78
|
|
|
|
|
|
|
$_[0]->[_ancestor_];
|
79
|
|
|
|
|
|
|
}
|
80
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
84
|
|
|
|
|
|
|
# my $simple_sel = $dsel->SimpleSelector()
|
85
|
|
|
|
|
|
|
# $dsel->SimpleSelector($simple_sel)
|
86
|
|
|
|
|
|
|
# get/set the selector's simple selector
|
87
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
88
|
|
|
|
|
|
|
sub SimpleSelector {
|
89
|
2
|
50
|
|
2
|
1
|
16
|
(@_==2) ? $_[0]->[_simple_] = $_[1] :
|
90
|
|
|
|
|
|
|
$_[0]->[_simple_];
|
91
|
|
|
|
|
|
|
}
|
92
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
93
|
|
|
|
|
|
|
|
94
|
|
|
|
|
|
|
|
95
|
|
|
|
|
|
|
# #
|
96
|
|
|
|
|
|
|
# #
|
97
|
|
|
|
|
|
|
### Accessors #########################################################
|
98
|
|
|
|
|
|
|
|
99
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
101
|
|
|
|
|
|
|
1;
|
102
|
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
=pod
|
104
|
|
|
|
|
|
|
|
105
|
|
|
|
|
|
|
=head1 NAME
|
106
|
|
|
|
|
|
|
|
107
|
|
|
|
|
|
|
CSS::SAC::Selector::Descendant - SAC DescendantSelector
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
see CSS::SAC::Selector
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This is a subclass of CSS::SAC::Selector, look there for more
|
116
|
|
|
|
|
|
|
documentation. This class adds the following methods (which also exist
|
117
|
|
|
|
|
|
|
in spec style, simply prepend them with 'get'):
|
118
|
|
|
|
|
|
|
|
119
|
|
|
|
|
|
|
=head1 METHODS
|
120
|
|
|
|
|
|
|
|
121
|
|
|
|
|
|
|
=over
|
122
|
|
|
|
|
|
|
|
123
|
|
|
|
|
|
|
=item * CSS::SAC::Selector::Descendant->new($type,$ancestor_sel,$simple_sel)
|
124
|
|
|
|
|
|
|
=item * $dsel->new($type,$ancestor_sel,$simple_sel)
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Creates a new descendant selector.
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item * $dsel->AncestorSelector([$ancestor_sel])
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
get/set the selector's ancestor selector
|
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item * $dsel->SimpleSelector([$simple_sel])
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
get/set the selector's simple selector
|
135
|
|
|
|
|
|
|
|
136
|
|
|
|
|
|
|
=back
|
137
|
|
|
|
|
|
|
|
138
|
|
|
|
|
|
|
=head1 AUTHOR
|
139
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
Robin Berjon
|
141
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
This module is licensed under the same terms as Perl itself.
|
143
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
=cut
|
145
|
|
|
|
|
|
|
|
146
|
|
|
|
|
|
|
|