Skip to content

AttributeError: Element instance has no attribute 'matchesNode' #10

@a1s

Description

@a1s

I get the following error when xhtml2pdf is run with debug option:

Traceback (most recent call last):
  File "C:\Python27\lib\site-packages\sx\pisa3\pisa_parser.py", line 231, in CSSCollect
cssAttrMap[cssAttrName] = node.getCSSAttr(c.cssCascade, cssAttrName)
  File "C:\Python27\lib\site-packages\sx\pisa3\pisa_parser.py", line 195, in getCSSAttr
result = cssCascade.findStyleFor(self.cssElement, attrName, default)
  File "C:\Python27\lib\site-packages\sx\w3c\css.py", line 133, in findStyleFor
rule = self.findCSSRulesFor(element, attrName)
  File "C:\Python27\lib\site-packages\sx\w3c\css.py", line 153, in findCSSRulesFor
rules += ruleset.findCSSRuleFor(element, attrName)
  File "C:\Python27\lib\site-packages\sx\w3c\css.py", line 504, in findCSSRuleFor
return self.findCSSRulesFor(*args, **kw)[-1:]
  File "C:\Python27\lib\site-packages\sx\w3c\css.py", line 496, in findCSSRulesFor
if (attrName in declarations) and (nodeFilter.matches(element)):
  File "C:\Python27\lib\site-packages\sx\w3c\css.py", line 272, in matches
if not qualifier.matches(element):
  File "C:\Python27\lib\site-packages\sx\w3c\css.py", line 463, in matches
return selector.matches(element.getPreviousSibling())
  File "C:\Python27\lib\site-packages\sx\w3c\css.py", line 268, in matches
if not element.matchesNode(self.fullName):
AttributeError: Element instance has no attribute 'matchesNode'

should CSSDOMElementInterface.getPreviousSibling() return a CSSElementInterfaceAbstract instance, or should CSSSelectorBase.matches() accept unwrapped DOM elements?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions