Package cssutils :: Package css :: Module selector :: Class Selector
[hide private]
[frames] | no frames]

Class Selector

source code

object --+    
         |    
 util.Base --+
             |
            Selector

(cssutils) a single selector in a SelectorList of a CSSStyleRule

Properties

selectorText
textual representation of this Selector
namespaces
a set which namespaces have been used in this selector
seq
sequence of Selector parts including comments

Format

combinator
: PLUS S* | GREATER S* | S+ ;
selector
: simple_selector [ combinator simple_selector ]* ;
simple_selector
: element_name [ HASH | class | attrib | pseudo ]* | [ HASH | class | attrib | pseudo ]+ ;
class
: '.' IDENT ;
element_name
: IDENT | '*' ;
attrib
: '[' S* IDENT S* [ [ '=' | INCLUDES | DASHMATCH ] S* [ IDENT | STRING ] S* ]? ']' ;
pseudo
: ':' [ IDENT | FUNCTION S* IDENT? S* ')' ] ;

plus some from http://www.w3.org/TR/css3-selectors/



Nested Classes [hide private]

Inherited from util.Base (private): _ttypes

Instance Methods [hide private]
 
__init__(self, selectorText=None, readonly=False)
initial value of this selector
source code
 
_getSelectorText(self)
returns serialized format
source code
 
_setSelectorText(self, selectorText)
DOMException on setting
source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code

Inherited from util.Base (private): _checkReadonly, _tokenize, _tokensupto, _valuestr

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__

Static Methods [hide private]

Inherited from util.Base (private): _normalize

Class Variables [hide private]

Inherited from util.Base (private): _log

Properties [hide private]
  selectorText
(DOM) The parsable textual representation of the selector.

Inherited from object: __class__

Method Details [hide private]

__init__(self, selectorText=None, readonly=False)
(Constructor)

source code 
selectorText
initial value of this selector
readonly
default to False
Overrides: object.__init__

_setSelectorText(self, selectorText)

source code 

DOMException on setting

  • INVALID_MODIFICATION_ERR: (self)
  • INVALID_MODIFICATION_ERR: (self) Raised if the specified CSS string value represents a different type than the current one, e.g. a SelectorList.
  • NO_MODIFICATION_ALLOWED_ERR: (self) Raised if this rule is readonly.
  • SYNTAX_ERR: (self) Raised if the specified CSS string value has a syntax error and is unparsable.

__repr__(self)
(Representation operator)

source code 
repr(x)
Overrides: object.__repr__
(inherited documentation)

__str__(self)
(Informal representation operator)

source code 
str(x)
Overrides: object.__str__
(inherited documentation)

Property Details [hide private]

selectorText

(DOM) The parsable textual representation of the selector.
Get Method:
cssutils.css.selector.Selector._getSelectorText(self) - returns serialized format
Set Method:
cssutils.css.selector.Selector._setSelectorText(self, selectorText) - DOMException on setting
Delete Method:
None