cssText = property(_getCssText, _setCssText, doc = '(DOM) The parsable textual representation of this rule.')
def _setStyle(self, style):
self._checkReadonly()
if isinstance(style, basestring):
self._style.cssText = style
else:
self._style = style
self._style.parentRule = self
style = property((lambda self: self._style), _setStyle, doc = '(DOM) The declaration-block of this rule set, a :class:`~cssutils.css.CSSStyleDeclaration`.')
type = property((lambda self: self.FONT_FACE_RULE), doc = 'The type of this rule, as defined by a CSSRule type constant.')
def _getValid(self):
needed = [
'font-family',
'src']
for p in self.style.getProperties(all = True):
if not p.valid:
return False
try:
needed.remove(p.name)
continue
except ValueError:
p.valid
p.valid
continue
return not bool(needed)
valid = property(_getValid, doc = 'CSSFontFace is valid if properties `font-family` and `src` are set and all properties are valid.')