Bug 155651

Summary: Add SVG 2 attribute values "context-stroke" and "context-fill"
Product: LibreOffice Reporter: Richard Mortimer <richm+libreoffice>
Component: filters and storageAssignee: Xisco Faulí <xiscofauli>
Status: VERIFIED FIXED    
Severity: enhancement CC: 79045_79045, karl.hoffmann, LibreOffice, rb.henschel, richm+libreoffice, stephane.guillou, xiscofauli
Priority: medium Keywords: filter:svg
Version: 7.6.0.0 alpha1+   
Hardware: All   
OS: All   
URL: https://www.w3.org/TR/SVG2/painting.html
Whiteboard: target:24.8.0 target:24.2.4 inReleaseNotes:24.2
Crash report or crash signature: Regression By:
Bug Depends on:    
Bug Blocks: 88278    
Attachments: Writer document with the SVGs and their equivalent PDFs imported
PDF of writer document with sample SVG/PDFs imported
Inkscape 1.2 arrows SVG
Inkscape 1.2 arrows PDF
Inkscape 1.1.2 arrows SVG
Inkscape 1.1.2 arrows PDF
Inkscape 1.0.2 arrows SVG
Inkscape 1.0.2 arrows PDF
Inkscape 0.92 arrows SVG
Inkscape 0.92 arrows PDF
Screnshot from Chromium
sample file
context-fill sample

Description Richard Mortimer 2023-06-02 18:06:52 UTC
Created attachment 187670 [details]
Writer document with the SVGs and their equivalent PDFs imported

The SVG images produced by recent (version 1.2 onwards) versions of Inkscape do not display arrows correctly, if at all. Earlier versions of Inkscape (0.92, 1.0.x and 1.1.x) import correctly.

The SVG images produced by Inkscape display correctly in Firefox and Chrome so it seems that it is Libreoffice that is not importing/displaying correctly.

Tested in Libreoffice 7.2.7.2, 7.5.3.2 and 7.6.0.0 alpha1 (1/June/2023) with the same results.

I can export the SVGs from Inkscape as PDF and the imported PDF documents display correctly. Attached to the bug are example SVGs generated with different versions of Inkscape and PDF exports from that version of Inkscape. Also a writer document with all of the SVGs and PDFs imported to show the issue.
Comment 1 Richard Mortimer 2023-06-02 18:07:55 UTC
Created attachment 187671 [details]
PDF of writer document with sample SVG/PDFs imported
Comment 2 Richard Mortimer 2023-06-02 18:08:21 UTC
Created attachment 187672 [details]
Inkscape 1.2 arrows SVG
Comment 3 Richard Mortimer 2023-06-02 18:08:48 UTC
Created attachment 187673 [details]
Inkscape 1.2 arrows PDF
Comment 4 Richard Mortimer 2023-06-02 18:09:16 UTC
Created attachment 187674 [details]
Inkscape 1.1.2 arrows SVG
Comment 5 Richard Mortimer 2023-06-02 18:09:38 UTC
Created attachment 187675 [details]
Inkscape 1.1.2 arrows PDF
Comment 6 Richard Mortimer 2023-06-02 18:10:00 UTC
Created attachment 187676 [details]
Inkscape 1.0.2 arrows SVG
Comment 7 Richard Mortimer 2023-06-02 18:10:25 UTC
Created attachment 187677 [details]
Inkscape 1.0.2 arrows PDF
Comment 8 Richard Mortimer 2023-06-02 18:10:49 UTC
Created attachment 187678 [details]
Inkscape 0.92 arrows SVG
Comment 9 Richard Mortimer 2023-06-02 18:11:10 UTC
Created attachment 187679 [details]
Inkscape 0.92 arrows PDF
Comment 10 Rainer Bielefeld Retired 2023-06-03 16:59:53 UTC
> The SVG images produced by Inkscape display correctly in Firefox and Chrome 

Not in Chromium Version 97.0.4692.7
Not in FF 115.0a1 (2023-06-03) (64-Bit)

We need some proof that the .SVG have correct syntax
Comment 11 Rainer Bielefeld Retired 2023-06-03 17:12:59 UTC
Created attachment 187699 [details]
Screnshot from Chromium

Also Chromium Version 116.0.5810.0 (Entwickler-Build) (64-Bit) shows SVG different from PDF exported from Inkscape.
Comment 12 Regina Henschel 2023-06-03 19:53:40 UTC
Problem is the value fill:context-stroke in the style attribute of the marker. The attribute value "context-stroke" does not belong to SVG 1.1. It is only in the working draft for SVG 2. LibreOffice does not support this value.
Comment 13 Roman Kuznetsov 2023-06-04 18:06:31 UTC
Set to NEW by Comment 12

Thanks Regina
Comment 14 Regina Henschel 2023-06-07 13:45:43 UTC
Same for attribute 'context-fill'.
Comment 15 Xisco Faulí 2024-04-30 11:30:31 UTC
*** Bug 160832 has been marked as a duplicate of this bug. ***
Comment 16 Xisco Faulí 2024-04-30 13:25:29 UTC
Created attachment 193907 [details]
sample file
Comment 17 Commit Notification 2024-05-03 09:51:14 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

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

tdf#155651: Add support for "context-stroke"

It will be available in 24.8.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 18 Commit Notification 2024-05-03 16:27:30 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

tdf#155651: Add support for "context-stroke"

It will be available in 24.2.4.

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 19 Xisco Faulí 2024-05-06 14:46:57 UTC
Created attachment 194004 [details]
context-fill sample
Comment 20 Commit Notification 2024-05-06 20:02:23 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3b0f96a0773f19f7d5bdb5725ff9667eb4809215

tdf#155651: Add support for "context-fill"

It will be available in 24.8.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 21 Commit Notification 2024-05-18 20:30:25 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-24-2":

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

tdf#155651: Add support for "context-fill"

It will be available in 24.2.4.

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 22 Stéphane Guillou (stragu) 2024-05-20 03:05:08 UTC
Thanks Richard, Regina and Xisco!

Verified in:

Version: 24.8.0.0.alpha1+ (X86_64) / LibreOffice Community
Build ID: 5e23cac5767c164b93491d46deef039409ea286c
CPU threads: 8; OS: Linux 6.5; UI render: default; VCL: gtk3
Locale: en-AU (en_AU.UTF-8); UI: en-US
Calc: CL threaded

Added to 24.2 release notes:

https://wiki.documentfoundation.org/index.php?title=ReleaseNotes%2F24.2&type=revision&diff=751489&oldid=750269
Comment 23 Richard Mortimer 2024-05-21 15:22:15 UTC
Thank you all.

I have tested my original documents and can confirm that the arrows now show.

Version: 24.8.0.0.alpha1 (X86_64) / LibreOffice Community
Build ID: a17e39caaf73108bee692d6f64a44c62f4066f1d
CPU threads: 2; OS: Windows 10 X86_64 (10.0 build 19045); UI render: Skia/Raster; VCL: win
Locale: en-GB (en_GB); UI: en-US
Calc: threaded