def ident(expected, seq, token, tokenizer=None):
            # a property

            tokens = self._tokensupto2(tokenizer, starttoken=token, semicolon=True)
            if self._tokenvalue(tokens[-1]) == u";":
                tokens.pop()
            property = Property(parent=self)
            property.cssText = tokens
            if property.wellformed:
                seq.append(property, "Property")
            else:
                self._log.error(u"CSSStyleDeclaration: Syntax Error in " u"Property: %s" % self._valuestr(tokens))
            # does not matter in this case
            return expected
        def ident(expected, seq, token, tokenizer=None):
            # a property

            tokens = self._tokensupto2(tokenizer,
                                       starttoken=token,
                                       semicolon=True)
            if self._tokenvalue(tokens[-1]) == u';':
                tokens.pop()
            property = Property(parent=self)
            property.cssText = tokens
            if property.wellformed:
                seq.append(property, 'Property')
            else:
                self._log.error(u'CSSStyleDeclaration: Syntax Error in '
                                u'Property: %s' % self._valuestr(tokens))
            # does not matter in this case
            return expected
        def ident(expected, seq, token, tokenizer=None):
            # a property
            if new['char']:
                # maybe an IE hack?
                token = (token[0], u'%s%s' % (new['char'], token[1]), 
                         token[2], token[3])

            tokens = self._tokensupto2(tokenizer, starttoken=token,
                                       semicolon=True)
            if self._tokenvalue(tokens[-1]) == u';':
                tokens.pop()
            property = Property()
            property.cssText = tokens
            if property.wellformed:
                seq.append(property)
            else:
                self._log.error(u'CSSStyleDeclaration: Syntax Error in Property: %s'
                                % self._valuestr(tokens))

            new['char'] = None
            return expected
Beispiel #4
0
        def ident(expected, seq, token, tokenizer=None):
            # a property
            if new['char']:
                # maybe an IE hack?
                token = (token[0], u'%s%s' % (new['char'], token[1]), token[2],
                         token[3])

            tokens = self._tokensupto2(tokenizer,
                                       starttoken=token,
                                       semicolon=True)
            if self._tokenvalue(tokens[-1]) == u';':
                tokens.pop()
            property = Property()
            property.cssText = tokens
            if property.wellformed:
                seq.append(property)
            else:
                self._log.error(
                    u'CSSStyleDeclaration: Syntax Error in Property: %s' %
                    self._valuestr(tokens))

            new['char'] = None
            return expected