line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
|
2
|
|
|
|
|
|
|
###
|
3
|
|
|
|
|
|
|
# CSS::SAC::Selector::Element - SAC ElementSelector
|
4
|
|
|
|
|
|
|
# Robin Berjon
|
5
|
|
|
|
|
|
|
# 24/02/2001
|
6
|
|
|
|
|
|
|
###
|
7
|
|
|
|
|
|
|
|
8
|
|
|
|
|
|
|
package CSS::SAC::Selector::Element;
|
9
|
2
|
|
|
2
|
|
11
|
use strict;
|
|
2
|
|
|
|
|
5
|
|
|
2
|
|
|
|
|
83
|
|
10
|
2
|
|
|
2
|
|
10
|
use vars qw($VERSION);
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
110
|
|
11
|
|
|
|
|
|
|
$VERSION = $CSS::SAC::VERSION || '0.03';
|
12
|
|
|
|
|
|
|
|
13
|
2
|
|
|
2
|
|
12
|
use base qw(CSS::SAC::Selector::Simple);
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
208
|
|
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
17
|
|
|
|
|
|
|
# build the fields for an array based object
|
18
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
19
|
2
|
|
|
|
|
15
|
use Class::ArrayObjects extend => {
|
20
|
|
|
|
|
|
|
class => 'CSS::SAC::Selector::Simple',
|
21
|
|
|
|
|
|
|
with => [qw(
|
22
|
|
|
|
|
|
|
_local_name_
|
23
|
|
|
|
|
|
|
_ns_uri_
|
24
|
|
|
|
|
|
|
)],
|
25
|
2
|
|
|
2
|
|
12
|
};
|
|
2
|
|
|
|
|
5
|
|
26
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
27
|
|
|
|
|
|
|
|
28
|
|
|
|
|
|
|
|
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
|
31
|
|
|
|
|
|
|
### Constructor #######################################################
|
32
|
|
|
|
|
|
|
# #
|
33
|
|
|
|
|
|
|
# #
|
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
37
|
|
|
|
|
|
|
# CSS::SAC::Selector::Element->new($type,$ns_uri,$local_name)
|
38
|
|
|
|
|
|
|
# creates a new sac ElementSelector object
|
39
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
40
|
|
|
|
|
|
|
sub new {
|
41
|
50
|
50
|
|
50
|
1
|
103
|
my $class = ref($_[0])?ref(shift):shift;
|
42
|
50
|
|
|
|
|
53
|
my $type = shift;
|
43
|
50
|
|
|
|
|
54
|
my $ns_uri = shift;
|
44
|
50
|
|
|
|
|
56
|
my $local_name = shift;
|
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
# create a selector
|
47
|
50
|
|
|
|
|
188
|
my $esel = $class->SUPER::new($type);
|
48
|
|
|
|
|
|
|
|
49
|
|
|
|
|
|
|
# add our fields
|
50
|
50
|
100
|
|
|
|
132
|
$esel->[_local_name_] = $local_name if $local_name;
|
51
|
50
|
100
|
|
|
|
109
|
$esel->[_ns_uri_] = $ns_uri if defined $ns_uri;
|
52
|
|
|
|
|
|
|
|
53
|
50
|
|
|
|
|
246
|
return $esel;
|
54
|
|
|
|
|
|
|
}
|
55
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
# #
|
59
|
|
|
|
|
|
|
# #
|
60
|
|
|
|
|
|
|
### Constructor #######################################################
|
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
|
64
|
|
|
|
|
|
|
### Accessors #########################################################
|
65
|
|
|
|
|
|
|
# #
|
66
|
|
|
|
|
|
|
# #
|
67
|
|
|
|
|
|
|
|
68
|
|
|
|
|
|
|
*CSS::SAC::Selector::Element::getLocalName = \&LocalName;
|
69
|
|
|
|
|
|
|
*CSS::SAC::Selector::Element::getNamespaceURI = \&NamespaceURI;
|
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
72
|
|
|
|
|
|
|
# my $lname = $esel->LocalName()
|
73
|
|
|
|
|
|
|
# $esel->LocalName($lname)
|
74
|
|
|
|
|
|
|
# get/set the selector's local name
|
75
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
76
|
|
|
|
|
|
|
sub LocalName {
|
77
|
50
|
50
|
|
50
|
1
|
512
|
(@_==2) ? $_[0]->[_local_name_] = $_[1] :
|
78
|
|
|
|
|
|
|
$_[0]->[_local_name_];
|
79
|
|
|
|
|
|
|
}
|
80
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
81
|
|
|
|
|
|
|
|
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
84
|
|
|
|
|
|
|
# my $ns = $esel->NamespaceURI()
|
85
|
|
|
|
|
|
|
# $esel->NamespaceURI($ns)
|
86
|
|
|
|
|
|
|
# get/set the selector's ns
|
87
|
|
|
|
|
|
|
#---------------------------------------------------------------------#
|
88
|
|
|
|
|
|
|
sub NamespaceURI {
|
89
|
48
|
50
|
|
48
|
1
|
402
|
(@_==2) ? $_[0]->[_ns_uri_] = $_[1] :
|
90
|
|
|
|
|
|
|
$_[0]->[_ns_uri_];
|
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::Element - SAC ElementSelector
|
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
=head1 SYNOPSIS
|
110
|
|
|
|
|
|
|
|
111
|
|
|
|
|
|
|
see CSS::SAC::Selector
|
112
|
|
|
|
|
|
|
|
113
|
|
|
|
|
|
|
=head1 DESCRIPTION
|
114
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
This is a subclass of CSS::SAC::Selector::Simple, 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::Element->new($type,$local_name,$ns_uri)
|
124
|
|
|
|
|
|
|
=item * $esel->new($type,$local_name,$ns_uri)
|
125
|
|
|
|
|
|
|
|
126
|
|
|
|
|
|
|
Creates a new element selector.
|
127
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
=item * $esel->LocalName([$lname])
|
129
|
|
|
|
|
|
|
|
130
|
|
|
|
|
|
|
get/set the selector's local name
|
131
|
|
|
|
|
|
|
|
132
|
|
|
|
|
|
|
=item * $esel->NamespaceURI([$ns])
|
133
|
|
|
|
|
|
|
|
134
|
|
|
|
|
|
|
get/set the selector's ns
|
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
|
|
|
|
|
|
|
|