removeDefaultAttributeValue: Special-case order attribute

Scour tried to handle "order" attribute as a SVGLength.  However, the
"order" attribute *can* consist of two integers according to the
[SVG 1.1 Specification] and SVGLength is not designed to handle that.

With this change, we now pretend that "order" is a string, which side
steps this issue.

[SVG 1.1 Specification]: https://www.w3.org/TR/SVG11/single-page.html#filters-feConvolveMatrixElementOrderAttribute

Closes: #189
Signed-off-by: Niels Thykier <niels@thykier.net>
This commit is contained in:
Niels Thykier 2018-04-17 19:05:52 +00:00
parent 8ddb7d8913
commit a459d629c1
3 changed files with 27 additions and 1 deletions

View file

@ -1570,6 +1570,16 @@ class RemoveDefaultGradFYValue(unittest.TestCase):
'fy matching cy not removed')
class RemoveDefaultAttributeOrderSVGLengthCrash(unittest.TestCase):
# Triggered a crash in v0.36
def runTest(self):
try:
scourXmlFile('unittests/remove-default-attr-order.svg')
except AttributeError:
self.fail("Processing the order attribute triggered an AttributeError ")
class CDATAInXml(unittest.TestCase):
def runTest(self):