| CSS-SAC documentation | Contained in the CSS-SAC distribution. |
CSS::SAC::Selector::Descendant - SAC DescendantSelector
see CSS::SAC::Selector
This is a subclass of CSS::SAC::Selector, look there for more documentation. This class adds the following methods (which also exist in spec style, simply prepend them with 'get'):
Creates a new descendant selector.
get/set the selector's ancestor selector
get/set the selector's simple selector
Robin Berjon <robin@knowscape.com>
This module is licensed under the same terms as Perl itself.
| CSS-SAC documentation | Contained in the CSS-SAC distribution. |
### # CSS::SAC::Selector::Descendant - SAC DescendantSelector # Robin Berjon <robin@knowscape.com> # 24/02/2001 ### package CSS::SAC::Selector::Descendant; use strict; use vars qw($VERSION); $VERSION = $CSS::SAC::VERSION || '0.03'; use base qw(CSS::SAC::Selector); #---------------------------------------------------------------------# # build the fields for an array based object #---------------------------------------------------------------------# use Class::ArrayObjects extend => { class => 'CSS::SAC::Selector', with => [qw( _ancestor_ _simple_ )], }; #---------------------------------------------------------------------# ### Constructor ####################################################### # # # # #---------------------------------------------------------------------# # CSS::SAC::Selector::Descendant->new($type,$ancestor_sel,$simple_sel) # creates a new sac DescendantSelector object #---------------------------------------------------------------------# sub new { my $class = ref($_[0])?ref(shift):shift; my $type = shift; my $ancestor_sel = shift; my $simple_sel = shift; # create a selector my $dsel = $class->SUPER::new($type); # add our fields $dsel->[_ancestor_] = $ancestor_sel; $dsel->[_simple_] = $simple_sel; return $dsel; } #---------------------------------------------------------------------# # # # # ### Constructor ####################################################### ### Accessors ######################################################### # # # # *CSS::SAC::Selector::Descendant::getAncestorSelector = \&AncestorSelector; *CSS::SAC::Selector::Descendant::getSimpleSelector = \&SimpleSelector; #---------------------------------------------------------------------# # my $ancestor_sel = $dsel->AncestorSelector() # $dsel->AncestorSelector($ancestor_sel) # get/set the selector's ancestor selector #---------------------------------------------------------------------# sub AncestorSelector { (@_==2) ? $_[0]->[_ancestor_] = $_[1] : $_[0]->[_ancestor_]; } #---------------------------------------------------------------------# #---------------------------------------------------------------------# # my $simple_sel = $dsel->SimpleSelector() # $dsel->SimpleSelector($simple_sel) # get/set the selector's simple selector #---------------------------------------------------------------------# sub SimpleSelector { (@_==2) ? $_[0]->[_simple_] = $_[1] : $_[0]->[_simple_]; } #---------------------------------------------------------------------# # # # # ### Accessors ######################################################### 1;