Bug 116589

Summary: SVG not rendered correctly in Writer (face fill)
Product: LibreOffice Reporter: kurt forrester <kurt.forrester.fec>
Component: WriterAssignee: Not Assigned <libreoffice-bugs>
Status: RESOLVED DUPLICATE    
Severity: normal CC: rb.henschel, vsfoote, xiscofauli
Priority: medium Keywords: bibisected, bisected, filter:svg, regression
Version: 4.4 all versions   
Hardware: All   
OS: Windows (All)   
Whiteboard:
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 88278    
Attachments: SVG created with matplotlib
with <style> in <defs>
without <style> in <defs>

Description kurt forrester 2018-03-23 16:42:44 UTC
Created attachment 140831 [details]
SVG created with matplotlib

When I insert an SVG into Writer (see attached SVG as an example) it is not correctly rendered (circle faces should be open). If the same SVG is opened in Chrome, Libreoffice Draw, Inkscape, ... it renders correctly.

Reporduce
1. Create new Writer document
2. Insert the attached image (via the file menu, Insert > Image...)
3. Circles on the vertexes are rendered with closed faces (filled) when they should be open.
4. Compare output in Chrome, Opera, Firefox, ...

Expected behaviour
1. Circles to be rendered correctly
Comment 1 V Stuart Foote 2018-03-23 19:47:57 UTC
Inserting the SVG exhibits the issue, opening the SVG (to Draw) renders the path correctly.
Comment 2 Regina Henschel 2018-03-24 12:18:13 UTC
Created attachment 140852 [details]
with <style> in <defs>
Comment 3 Regina Henschel 2018-03-24 12:20:24 UTC
Created attachment 140853 [details]
without <style> in <defs>

I have reduced the problem. The reason is in the <defs> element line#6 to #10 in the attached documents.
Comment 4 kurt forrester 2018-03-24 13:11:18 UTC
Excellent! Thanks for the diagnosis. Should this render correctly in Libreoffice or is it an illegal syntax/style element in the SVG format that I need matplotlib to look at?
Comment 5 kurt forrester 2018-03-24 13:28:11 UTC
Based on the comments thus far I have refined the issue further. It appears to be an issue with the * preceding the style definition.

Original

<defs>
  <style type="text/css">
*{stroke-linecap:butt;stroke-linejoin:round;}
  </style>
 </defs>

Fixed

<defs>
  <style type="text/css">
{stroke-linecap:butt;stroke-linejoin:round;}
  </style>
 </defs>
Comment 6 Regina Henschel 2018-03-24 13:43:00 UTC
According to https://validator.w3.org/#validate_by_upload all attached files are valid.

Indeed exchanging the selector * with selector 'path' solves the problem.

We have already bug 100198 about the selector *, so likely duplicate.
Comment 7 kurt forrester 2018-03-24 14:29:33 UTC
Thank you. I will manually edit the files to work around the issue and follow the bug you referenced to see when it is resolved.
Comment 8 Xisco FaulĂ­ 2018-03-26 20:37:10 UTC
Regression introduced by e17a730c0076b10678c860ae3285bc8a98282415 which is the same as in bug 99115
The problem is indeed the *

*** This bug has been marked as a duplicate of bug 99115 ***