Bug 149880 - LibreOffice not showing correctly SVG
Summary: LibreOffice not showing correctly SVG
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
7.0 all versions
Hardware: All All
: medium normal
Assignee: Xisco Faulí
URL:
Whiteboard: target:7.5.0 target:7.4.0.0.beta2 tar...
Keywords: filter:svg
Depends on:
Blocks:
 
Reported: 2022-07-06 10:49 UTC by rafael.linux.user
Modified: 2022-07-08 03:16 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:
Regression By:


Attachments
Simple SVG with text filled with stripped bars (17.47 KB, image/svg+xml)
2022-07-06 10:52 UTC, rafael.linux.user
Details
As it is showed removing quotation marks (68.94 KB, image/jpeg)
2022-07-06 15:00 UTC, rafael.linux.user
Details

Note You need to log in before you can comment on or make changes to this bug.
Description rafael.linux.user 2022-07-06 10:49:21 UTC
Description:
I designed a SVG simple file, with stripped lines inside. LibreOffice (Writer and Draw) are not able to show the filled pattern.

Steps to Reproduce:
1.Insert "Rotulo.svg" in any new Impress or Draw document


Actual Results:
SVG content is incomplete

Expected Results:
To show all SVG content


Reproducible: Always


User Profile Reset: No


OpenGL enabled: Yes

Additional Info:
INKscape, Firefox, Chrome, Edge show correctly this SVG content
LibreOffice and Scribus DON'T show correctly this SVG content

Version: 7.3.4.2 / LibreOffice Community
Build ID: 30(Build:2)
CPU threads: 8; OS: Linux 5.18; UI render: default; VCL: kf5 (cairo+xcb)
Locale: es-ES (es_ES.UTF-8); UI: es-ES
Calc: threaded
Comment 1 rafael.linux.user 2022-07-06 10:52:19 UTC
Created attachment 181135 [details]
Simple SVG with text filled with stripped bars

Visible correctly in Firefox, Chromium, Edge for Linux
Incorrectly displayed in LibreOffice, Scribus
Correctly displayed and editable in Inkscape
Comment 2 rafael.linux.user 2022-07-06 10:53:52 UTC
Comment on attachment 181135 [details]
Simple SVG with text filled with stripped bars

Incorrectly displayed in LibreOffice and Scribus
Correctly displayed in any web browser and Inkscape.
Comment 3 Xisco Faulí 2022-07-06 12:02:23 UTC
Reproduced in

Version: 7.5.0.0.alpha0+ / LibreOffice Community
Build ID: e4066a41406b1ddd454901b4fa718cf9be2746c4
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3
Locale: es-ES (es_ES.UTF-8); UI: en-US
Calc: threaded

and

Version: 6.4.0.0.alpha1+
Build ID: 9bc848cf0d301aa57eabcffa101a1cf87bad6470
CPU threads: 8; OS: Linux 5.10; UI render: default; VCL: gtk3; 
Locale: ja-JP (es_ES.UTF-8); UI-Language: en-US
Calc: threaded
Comment 4 Xisco Faulí 2022-07-06 12:16:38 UTC
The problem seems to be the path inside the pattern
Comment 5 Xisco Faulí 2022-07-06 12:41:37 UTC
Actually the problem is with the reference naming fill='url("#rough-1609495203056042")' it works if it's changed to
fill='url(#rough-1609495203056042)'
taking
Comment 6 rafael.linux.user 2022-07-06 15:00:15 UTC
Created attachment 181140 [details]
As it is showed removing quotation marks

Screenshot showing attached SVG file as it is showed in LibreOffice after applying the workaround of removing quotation marks on that line.
Comment 7 Xisco Faulí 2022-07-06 15:02:41 UTC
Fix in gerrit : https://gerrit.libreoffice.org/c/core/+/136847
Regarding the black lines, that is another issue
Comment 8 rafael.linux.user 2022-07-06 15:15:51 UTC
Ok, thank you. Maybe is a "black background" ....
Comment 9 Commit Notification 2022-07-06 18:35:16 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d291957dce7a5af17717125cce974a2d2dd9d5b0

tdf#149880: handle url when it's inside the quotation marks

It will be available in 7.5.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 10 Commit Notification 2022-07-06 19:31:52 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-4":

https://git.libreoffice.org/core/commit/460d3689956410d8e2d03cf3fe29ab570e24e865

tdf#149880: handle url when it's inside the quotation marks

It will be available in 7.4.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 11 Mike Kaganski 2022-07-07 08:25:16 UTC
Just FTR:

SVG spec defines that the <paint> type [1] (the value of fill attribute) uses <url> type as defined in CSS [2]; and the latter explicitly shows the *quoted* syntax in the first example, and describes the unquoted syntax as "alternative".

[1] https://www.w3.org/TR/SVG/painting.html#SpecifyingPaint
[2] https://www.w3.org/TR/css3-values/#url-value
Comment 12 Mike Kaganski 2022-07-07 08:51:09 UTC
Also note that the 'readLocalUrl' is not standard-copliant even after the fix. The relevant standard procedure is described in 'Consume an ident-like token' [1] and 'Consume a url token' [2], and includes case-insensitive "url" literal match; consuming up to three whitespace characters (having a strictly specified set of codepoints) between opening parenthesis and the quotation marks (and unlimited whitespace before unquoted url token); and allowing apostrophe as quotation mark.

[1] https://www.w3.org/TR/css-syntax-3/#consume-an-ident-like-token
[2] https://www.w3.org/TR/css-syntax-3/#consume-a-url-token
Comment 13 Xisco Faulí 2022-07-07 09:14:55 UTC
(In reply to Xisco Faulí from comment #7)
> Fix in gerrit : https://gerrit.libreoffice.org/c/core/+/136847
> Regarding the black lines, that is another issue

The other issue is reported in bug 149890
Comment 14 Xisco Faulí 2022-07-07 09:15:38 UTC
(In reply to Mike Kaganski from comment #12)
> Also note that the 'readLocalUrl' is not standard-copliant even after the
> fix. The relevant standard procedure is described in 'Consume an ident-like
> token' [1] and 'Consume a url token' [2], and includes case-insensitive
> "url" literal match; consuming up to three whitespace characters (having a
> strictly specified set of codepoints) between opening parenthesis and the
> quotation marks (and unlimited whitespace before unquoted url token); and
> allowing apostrophe as quotation mark.
> 
> [1] https://www.w3.org/TR/css-syntax-3/#consume-an-ident-like-token
> [2] https://www.w3.org/TR/css-syntax-3/#consume-a-url-token

My take to it: https://gerrit.libreoffice.org/c/core/+/136877
Comment 15 Commit Notification 2022-07-08 03:16:46 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-7-3":

https://git.libreoffice.org/core/commit/4cf8c7e715fa9d1d142b86af9735eb6d5125ac84

tdf#149880: handle url when it's inside the quotation marks

It will be available in 7.3.6.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.