Apply the patches submitted by Jan Thor in bug 714731. These patches remove attributes whose value equals its default value per the SVG specification, except if an element's parent node defines a non-default value explicitly, and add unit tests.

This commit is contained in:
Louis Simard 2011-02-10 19:48:53 -05:00
parent 2b68c7ed37
commit bdae2bafae
4 changed files with 236 additions and 64 deletions

View file

@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path style="fill-rule:evenodd;stroke-linecap:butt;stroke-width:1.00;stroke:#000" d="m1,1z"/>
<path style="fill-rule:nonzero;stroke-linecap:butt;stroke:#000" d="m1,1z"/>
<g style="stroke:#f00;marker:none">
<path style="marker-start:none;fill-rule:evenodd;stroke-linecap:butt" d="m1,1z"/>
<path style="fill-rule:nonzero" d="m1,1z"/>
<g style="fill:#f0f;text-anchor:stop;fill-rule:evenodd;stroke-linecap:round;marker:url(#nirvana)">
<path style="marker-start:none;fill-rule:evenodd;stroke-linecap:butt" d="m1,1z"/>
<path style="color:#000;fill-rule:nonzero;" d="m1,1z"/>
<path d="m1,1z"/>
</g>
<g style="fill:#f0f;text-anchor:stop;fill-rule:evenodd;stroke-linecap:round;marker:url(#nirvana)">
<path style="marker-start:none;fill-rule:evenodd;stroke-linecap:butt" d="m1,1z"/>
<path style="color:#000;fill-rule:nonzero;" d="m1,1z"/>
</g>
<g style="text-anchor:stop;fill-rule:nonzero;marker:none;stroke-linecap:butt">
<path style="marker-start:none;fill-rule:evenodd;stroke-linecap:butt" d="m1,1z"/>
<path style="fill-rule:nonzero;" d="m1,1z"/>
<path d="m1,1z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.3 KiB

View file

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg xmlns="http://www.w3.org/2000/svg">
<path style="fill: none; fill-rule: evenodd; fill-opacity: 0.5;" d="M 7.7592046,36.982095 C 7.8831049,40.873696 7.8339808,45.305308 7.8339808,49.436888 Z" />
<path style="fill: black; fill-rule: nonzero; fill-opacity: 0.5;" d="M 7.7592046,36.982095 C 7.8831049,40.873696 7.8339808,45.305308 7.8339808,49.436888 Z" />
<path style="fill: none; fill-rule: nonzero; fill-opacity: 0.5;" d="M 7.7592046,36.982095 C 7.8831049,40.873696 7.8339808,45.305308 7.8339808,49.436888 Z" />
<path style="fill: black; fill-rule: evenodd; fill-opacity: 0.5;" d="M 7.7592046,36.982095 C 7.8831049,40.873696 7.8339808,45.305308 7.8339808,49.436888 Z" />
</svg>

Before

Width:  |  Height:  |  Size: 429 B

After

Width:  |  Height:  |  Size: 429 B

Before After
Before After