The CSSStyleDeclaration class represents a single CSS declaration
block. This class may be used to determine the style properties
currently set in a block or to set style properties explicitly
within the block.
While an implementation may not recognize all CSS properties within
a CSS declaration block, it is expected to provide access to all
specified properties in the style sheet through the
CSSStyleDeclaration interface.
Furthermore, implementations that support a specific level of CSS
should correctly handle CSS shorthand properties for that level. For
a further discussion of shorthand properties, see the CSS2Properties
interface.
Additionally the CSS2Properties interface is implemented.
|
|
__init__(self,
cssText=u'',
parentRule=None,
readonly=False)
Shortcut, sets CSSStyleDeclaration.cssText |
source code
|
|
|
|
|
|
|
__iter__(self)
iterator of set Property objects with different normalized names. |
source code
|
|
|
|
__setattr__(self,
n,
v)
Prevent setting of unknown properties on CSSStyleDeclaration
which would not work anyway. |
source code
|
|
|
|
__nnames(self)
returns iterator for all different names in order as set
if names are set twice the last one is used (double reverse!) |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
_getP(self,
CSSName)
(DOM CSS2Properties)
Overwritten here and effectively the same as
self.getPropertyValue(CSSname). |
source code
|
|
|
|
_setP(self,
CSSName,
value)
(DOM CSS2Properties)
Overwritten here and effectively the same as
self.setProperty(CSSname, value). |
source code
|
|
|
|
_delP(self,
CSSName)
(cssutils only)
Overwritten here and effectively the same as
self.removeProperty(CSSname). |
source code
|
|
|
|
_getCssText(self)
returns serialized property cssText |
source code
|
|
|
|
_setCssText(self,
cssText)
Setting this attribute will result in the parsing of the new value
and resetting of all the properties in the declaration block
including the removal or addition of properties. |
source code
|
|
|
|
getCssText(self,
separator=None)
returns serialized property cssText, each property separated by
given separator which may e.g. |
source code
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
getPropertyCSSValue(self,
name,
normalize=True)
Returns CSSValue, the value of the effective property if it has been
explicitly set for this declaration block. |
source code
|
|
|
|
getPropertyValue(self,
name,
normalize=True)
Returns the value of the effective property if it has been explicitly
set for this declaration block. |
source code
|
|
|
|
|
|
|
removeProperty(self,
name,
normalize=True)
(DOM)
Used to remove a CSS property if it has been explicitly set within
this declaration block. |
source code
|
|
|
|
setProperty(self,
name,
value=None,
priority=u'',
normalize=True)
(DOM)
Used to set a property value and priority within this declaration
block. |
source code
|
|
|
|
item(self,
index)
(DOM)
Used to retrieve the properties that have been explicitly set in
this declaration block. |
source code
|
|
|
|
|
|
|
|
Inherited from util.Base (private):
_checkReadonly,
_nexttoken,
_parse,
_splitNamespacesOff,
_stringtokenvalue,
_tokenize2,
_tokensupto2,
_tokenvalue,
_type,
_uritokenvalue,
_valuestr
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__
|
|
|
cssText
(DOM) A parsable textual representation of the declaration block excluding the surrounding curly braces.
|
|
|
parentRule
(DOM) The CSS rule that contains this declaration block or None if this CSSStyleDeclaration is not attached to a CSSRule.
|
|
|
length
(DOM) The number of distinct properties that have been explicitly in this declaration block.
|
|
Inherited from cssproperties.CSS2Properties:
azimuth,
background,
backgroundAttachment,
backgroundColor,
backgroundImage,
backgroundPosition,
backgroundRepeat,
border,
borderBottom,
borderBottomColor,
borderBottomStyle,
borderBottomWidth,
borderCollapse,
borderColor,
borderLeft,
borderLeftColor,
borderLeftStyle,
borderRight,
borderRightColor,
borderRightStyle,
borderRightWidth,
borderSpacing,
borderStyle,
borderTop,
borderTopColor,
borderTopStyle,
borderTopWidth,
borderWidth,
bottom,
captionSide,
clear,
clip,
color,
content,
counterIncrement,
counterReset,
cue,
cueAfter,
cueBefore,
cursor,
direction,
display,
elevation,
emptyCells,
float,
font,
fontFamily,
fontSize,
fontStyle,
fontVariant,
fontWeight,
height,
left,
letterSpacing,
lineHeight,
listStyle,
listStyleImage,
listStylePosition,
listStyleType,
margin,
marginBottom,
marginLeft,
marginRight,
marginTop,
maxHeight,
maxWidth,
minHeight,
minWidth,
orphans,
outline,
outlineColor,
outlineStyle,
outlineWidth,
overflow,
padding,
paddingBottom,
paddingLeft,
paddingRight,
paddingTop,
pageBreakAfter,
pageBreakBefore,
pageBreakInside,
pause,
pauseAfter,
pauseBefore,
pitch,
pitchRange,
playDuring,
position,
quotes,
richness,
right,
speak,
speakHeader,
speakNumeral,
speakPunctuation,
speechRate,
stress,
tableLayout,
textAlign,
textDecoration,
textIndent,
textTransform,
top,
unicodeBidi,
verticalAlign,
visibility,
voiceFamily,
volume,
whiteSpace,
widows,
width,
wordSpacing,
zIndex
Inherited from util.Base2:
seq
Inherited from object:
__class__
|