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,
parentRule=None,
cssText=u'',
readonly=False)
The CSS rule that contains this declaration block or
None if this CSSStyleDeclaration is not attached to a CSSRule. |
source code
|
|
|
|
__setattr__(self,
n,
v)
Prevent setting of unknown properties on CSSStyleDeclaration
which would not work anyway. |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
getPropertyCSSValue(self,
name)
(DOM)
Used to retrieve the object representation of the value of a CSS
property if it has been explicitly set within this declaration
block. |
source code
|
|
|
|
getPropertyValue(self,
name)
(DOM)
Used to retrieve the value of a CSS property if it has been
explicitly set 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
|
|
|
|
removeProperty(self,
name)
(DOM)
Used to remove a CSS property if it has been explicitly set within
this declaration block. |
source code
|
|
|
|
setProperty(self,
name,
value,
priority=None,
overwrite=True,
_seq=None)
(DOM)
Used to set a property value and priority within this declaration
block. |
source code
|
|
|
Inherited from object:
__delattr__,
__getattribute__,
__hash__,
__new__,
__reduce__,
__reduce_ex__,
__repr__,
__str__
|
|
|
cssText
(DOM) The parsable textual representation of the declaration block excluding the surrounding curly braces.
|
|
|
length
(DOM) the number of properties that have been explicitly set in this declaration block.
|
|
|
parentRule
(DOM) The CSS rule that contains this declaration block or None if this CSSStyleDeclaration is not attached to a CSSRule.
|
|
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 object:
__class__
|