References to gradients in <style> are not considered as such; the gradients are removed

Bug #603994 reported by Louis Simard on 2010-07-10
This bug affects 1 person
Affects Status Importance Assigned to Milestone

Bug Description

The file fulltests/scantailor.svg, originally from Ubuntu 10.04's /usr/share/app-install/icons/scantailor.svg and added to trunk revision 181, renders incorrectly after being Scoured.

-- To reproduce --

Program version: trunk revision 180

Command line: ./ --shorten-ids --enable-id-stripping --create-groups --renderer-workaround --indent=none -i fulltests/scantailor.svg -o fulltests/scantailor.opt.svg

Changed in scour:
importance: Undecided → High

Even with the default command-line options, the fill:url(#idNUMBER) references in <style> aren't being considered as references and the gradients are getting removed from <defs>.

summary: - Bad render: fulltests/scantailor.svg
+ References to gradients in <style> are not considered as such; the
+ gradients are removed

Debug information added by this patch (not a solution for the bug!) makes the problem more obvious:

A CDATA node may be surrounded by Text nodes if CDATA is surrounded by whitespace, but findReferencedElements considers only the first child node of a <style> element. findReferencedElements therefore ignores the entire stylesheet in this test case.

Changed in scour:
status: New → Triaged
Changed in scour:
assignee: nobody → Cynthia Gauthier (louis-simard)
status: Triaged → In Progress

This patch has two facets:

1. Allow findReferencedElements to act on a CDATA stylesheet surrounded by whitespace Text nodes.
2. Allow renameID (for shortenIDs) to replace a stylesheet properly.

Unit tests have been written. The file now renders correctly, and the unit tests both pass.

This fix is in the trunk, revision 184.

Changed in scour:
status: In Progress → Fix Committed
codedread (codedread) on 2010-07-12
Changed in scour:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers