Activity log for bug #368716

Date Who What changed Old value New value Message
2009-04-28 17:05:32 codedread bug added bug
2009-04-28 17:06:43 codedread description Scour doesn't yet handle <style> elements well. There are two sub-bugs with this: 1) if a CSS selector references an element, scour doesn't detect this so in the following file: <svg> <defs> <style> .foo { filter: url(#myfilter); } </style> <filter id="myfilter" .../> </defs> <rect class="foo" ... /> </svg> The myfilter filter will get removed because scour doesn't think it's referenced anywhere. I'll need to build a crude CSS parser for scour to deal with this. 2) conversion from style properties to XML attributes presents a problem with a <style> element: <svg> <style> rect { fill: blue; } </style> <rect style="fill:red" .../> </svg> In this case, scour will convert the rect's style to: <rect fill="red"... />. This probably isn't what is intended because the <style>'s rect rule (fill:blue) overrides the fill attribute. So the rectangle is blue in the scoured SVG, though the original SVG file has the rectangle as red. Scour doesn't yet handle <style> elements well. There are two sub-bugs with this: 1) if a CSS selector references an element, scour doesn't detect this so in the following file: <svg> <defs> <style> .foo { filter: url(#myfilter); } </style> <filter id="myfilter" .../> </defs> <rect class="foo" ... /> </svg> The myfilter filter will get removed because scour doesn't think it's referenced anywhere. I'll need to build a crude CSS parser for scour to deal with this. 2) conversion from style properties to XML attributes presents a problem with a <style> element: <svg> <style> rect { fill: blue; } </style> <rect style="fill:red" .../> </svg> In this case, scour will convert the rect's style to: <rect fill="red"... />. This probably isn't what is intended because the <style>'s rect rule (fill:blue) overrides the fill attribute. So the rectangle is blue in the scoured SVG, though the original SVG file has the rectangle as red. Note for the second problem that you can use the new option --disable-style-to-xml to prevent the style properties from being converted into XML attributes. However, it would be nice if scour prevented the conversion automatically somehow.
2009-07-28 14:29:09 codedread scour: status New Confirmed
2009-08-31 05:19:59 codedread scour: status Confirmed Fix Committed
2009-08-31 05:19:59 codedread scour: assignee codedread (codedread)
2009-09-11 12:37:41 codedread scour: status Fix Committed Fix Released