Package cssutils :: Package css :: Module property :: Class Property
[hide private]
[frames] | no frames]

Class Property

source code

object --+    
         |    
 util.Base --+
             |
            Property

(cssutils) a CSS property in a StyleDeclaration of a CSSStyleRule

Properties

cssText
a parsable textual representation of this property
name
of the property
normalname
normalized name of the property, e.g. "color" when name is "color"
cssValue
the relevant CSSValue instance for this property
value
the string value of the property, same as cssValue.cssText
priority
of the property (currently only "!important" or None)
seqs
combination of a list for seq of name, a CSSValue object, and a list for seq of priority (empty or [!important] currently)
valid
if this Property is valid
wellformed
if this Property is syntactically ok

Format

property = name
  : IDENT S*
  ;

expr = value
  : term [ operator term ]*
  ;
term
  : unary_operator?
    [ NUMBER S* | PERCENTAGE S* | LENGTH S* | EMS S* | EXS S* | ANGLE S* |
      TIME S* | FREQ S* | function ]
  | STRING S* | IDENT S* | URI S* | hexcolor
  ;
function
  : FUNCTION S* expr ')' S*
  ;
/*
 * There is a constraint on the color that it must
 * have either 3 or 6 hex-digits (i.e., [0-9a-fA-F])
 * after the "#"; e.g., "#000" is OK, but "#abcd" is not.
 */
hexcolor
  : HASH S*
  ;

prio
  : IMPORTANT_SYM S*
  ;


Nested Classes [hide private]

Inherited from util.Base (private): _prods

Instance Methods [hide private]
 
__init__(self, name=None, value=None, priority=None, _mediaQuery=False)
inits property
source code
 
_getCssText(self)
returns serialized property cssText
source code
 
_setCssText(self, cssText)
DOMException on setting
source code
 
_getName(self) source code
 
_setName(self, name)
DOMException on setting
source code
 
_getCSSValue(self) source code
 
_setCSSValue(self, cssText)
see css.CSSValue
source code
 
_getValue(self) source code
 
_setValue(self, value) source code
 
_getPriority(self) source code
 
_setPriority(self, priority)
a string
source code
 
__repr__(self)
repr(x)
source code
 
__str__(self)
str(x)
source code

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): _SHORTHANDPROPERTIES, _log

Properties [hide private]
  cssText
A parsable textual representation.
  name
(cssutils) Name of this property
  cssValue
(cssutils) CSSValue object of this property
  value
The textual value of this Properties cssValue.
  priority
(cssutils) Priority of this property

Inherited from object: __class__

Method Details [hide private]

__init__(self, name=None, value=None, priority=None, _mediaQuery=False)
(Constructor)

source code 

inits property

name
a property name string
value
a property value string
priority
an optional priority string
_mediaQuery boolean
if True value is optional as used by MediaQuery objects
Overrides: object.__init__

_setCssText(self, cssText)

source code 

DOMException on setting

  • NO_MODIFICATION_ALLOWED_ERR: (CSSRule) Raised if the rule is readonly.
  • SYNTAX_ERR: (self) Raised if the specified CSS string value has a syntax error and is unparsable.

_setName(self, name)

source code 

DOMException on setting

  • SYNTAX_ERR: (self) Raised if the specified name has a syntax error and is unparsable.

_setCSSValue(self, cssText)

source code 

see css.CSSValue

DOMException on setting?

  • SYNTAX_ERR: (self) Raised if the specified CSS string value has a syntax error (according to the attached property) or is unparsable.
  • TODO: INVALID_MODIFICATION_ERR: Raised if the specified CSS string value represents a different type of values than the values allowed by the CSS property.

_setPriority(self, priority)

source code 
priority
a string

Format

prio
  : IMPORTANT_SYM S*
  ;

"!"{w}"important"   {return IMPORTANT_SYM;}

DOMException on setting

  • SYNTAX_ERR: (self) Raised if the specified priority has a syntax error and is unparsable. In this case a priority not equal to None, "" or "!{w}important".

__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]

cssText

A parsable textual representation.
Get Method:
cssutils.css.property.Property._getCssText(self) - returns serialized property cssText
Set Method:
cssutils.css.property.Property._setCssText(self, cssText) - DOMException on setting
Delete Method:
None

name

(cssutils) Name of this property
Get Method:
cssutils.css.property.Property._getName(self)
Set Method:
cssutils.css.property.Property._setName(self, name) - DOMException on setting
Delete Method:
None

cssValue

(cssutils) CSSValue object of this property
Get Method:
cssutils.css.property.Property._getCSSValue(self)
Set Method:
cssutils.css.property.Property._setCSSValue(self, cssText) - see css.CSSValue
Delete Method:
None

value

The textual value of this Properties cssValue.
Get Method:
cssutils.css.property.Property._getValue(self)
Set Method:
cssutils.css.property.Property._setValue(self, value)
Delete Method:
None

priority

(cssutils) Priority of this property
Get Method:
cssutils.css.property.Property._getPriority(self)
Set Method:
cssutils.css.property.Property._setPriority(self, priority) - a string
Delete Method:
None