self._log.error(u'CSSStyleRule: No style declaration or "}" found: %r' % self._valuestr(cssText))
else:
braceorEOFtoken = styletokens.pop()
val = self._tokenvalue(braceorEOFtoken)
typ = self._type(braceorEOFtoken)
if val != u'}' and typ != 'EOF':
ok = False
self._log.error(u'CSSStyleRule: No "}" after style declaration found: %r' % self._valuestr(cssText))
elif 'EOF' == typ:
styletokens.append(braceorEOFtoken)
try:
self.style.cssText = styletokens
except:
self.selectorList._absorb(oldselector)
raise
if not ok or not (self.wellformed):
self.selectorList._absorb(oldselector)
self.style._absorb(oldstyle)
cssText = property(_getCssText, _setCssText, doc = '(DOM) The parsable textual representation of this rule.')
def __getNamespaces(self):
try:
return self.parentStyleSheet.namespaces
except AttributeError:
return self.selectorList._namespaces
_namespaces = property(__getNamespaces, doc = 'If this Rule is attached to a CSSStyleSheet the namespaces of that sheet are mirrored here. While the Rule is not attached the namespaces of selectorList are used.')
def _setSelectorList(self, selectorList):
self._checkReadonly()
selectorList._parentRule = self
self._selectorList = selectorList
selectorList = property((lambda self: self._selectorList), _setSelectorList, doc = 'The SelectorList of this rule.')
def _setSelectorText(self, selectorText):
self._checkReadonly()
self._selectorList.selectorText = selectorText
selectorText = property((lambda self: self._selectorList.selectorText), _setSelectorText, doc = '(DOM) The textual representation of the selector for the rule set.')
def _setStyle(self, style):
self._checkReadonly()
if isinstance(style, basestring):
self._style.cssText = style
else:
style._parentRule = self
self._style = style
style = property((lambda self: self._style), _setStyle, doc = '(DOM) The declaration-block of this rule set.')
type = property((lambda self: self.STYLE_RULE), doc = 'The type of this rule, as defined by a CSSRule type constant.')