diff --git a/scour.py b/scour.py index fd63de6..adab447 100755 --- a/scour.py +++ b/scour.py @@ -44,6 +44,9 @@ # * Process quadratic Bezier curves # * Collapse all group based transformations +# Suggestion from Richard Hutch: +# * Put id attributes first in the serialization (or make the d attribute last) + # Next Up: # + fix bug when removing stroke styles # - Convert all colors to #RRGGBB format diff --git a/testscour.py b/testscour.py index 92d62b3..d1612c8 100755 --- a/testscour.py +++ b/testscour.py @@ -340,6 +340,18 @@ class RemoveStrokeDashoffsetWhenStrokeNone(unittest.TestCase): self.assertEquals(doc.getElementsByTagNameNS(SVGNS, 'path')[0].getAttribute('stroke-dashoffset'), '', "stroke-dashoffset attribute not emptied when no stroke" ) +class RemoveFillRuleWhenFillNone(unittest.TestCase): + def runTest(self): + doc = scour.scourXmlFile('unittests/fill-none.svg') + self.assertEquals(doc.getElementsByTagNameNS(SVGNS, 'path')[0].getAttribute('fill-rule'), '', + "fill-rule attribute not emptied when no fill" ) + +class RemoveFillOpacityWhenFillNone(unittest.TestCase): + def runTest(self): + doc = scour.scourXmlFile('unittests/fill-none.svg') + self.assertEquals(doc.getElementsByTagNameNS(SVGNS, 'path')[0].getAttribute('fill-opacity'), '', + "fill-opacity attribute not emptied when no fill" ) + #class RemoveUnreferencedFonts(unittest.TestCase): # def runTest(self): # doc = scour.scourXmlFile('unittests/unreferenced-font.svg') diff --git a/unittests/fill-none.svg b/unittests/fill-none.svg new file mode 100644 index 0000000..1f16076 --- /dev/null +++ b/unittests/fill-none.svg @@ -0,0 +1,3 @@ + + + \ No newline at end of file