After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 748565 - svg with clippath defined after use does not clip properly
svg with clippath defined after use does not clip properly
Status: RESOLVED OBSOLETE
Product: librsvg
Classification: Core
Component: general
unspecified
Other Linux
: Normal normal
: ---
Assigned To: librsvg maintainers
librsvg maintainers
Depends on:
Blocks:
 
 
Reported: 2015-04-28 03:30 UTC by Thomas Caswell
Modified: 2017-12-13 18:08 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Thomas Caswell 2015-04-28 03:30:40 UTC
If the <def> block containing a <clippath> appears after any elements that use that clip path, they are not clipped.  There seems to be nothing in the svg spec which requires that the object refereed to appears above what refers to it.  The only place I could find anything about order mentioned was http://www.w3.org/TR/SVG/struct.html#DefsElement which only says that the <def> is 'encouraged' to be a direct child of an ancestor of the node that refers to it.

A simple example of this is (from https://github.com/ipython/ipython/issues/8133#issuecomment-93051239): 

<?xml version="1.0"?>
<svg width="120" height="120"
     viewPort="0 0 120 120" version="1.1"
     xmlns="http://www.w3.org/2000/svg">

    <rect x="10" y="10" width="100" height="100"
          clip-path="url(#myClip)"/>
    <defs>
        <clipPath id="myClip">
            <circle cx="30" cy="30" r="20"/>
            <circle cx="70" cy="70" r="20"/>
        </clipPath>
    </defs>


</svg>

or basically anything emitted by matplotlib's svg backend.

This bug has been reported to ubuntu (https://bugs.launchpad.net/ubuntu/+source/librsvg/+bug/1207538) and matplotlib (https://github.com/matplotlib/matplotlib/issues/4341, https://github.com/matplotlib/matplotlib/issues/4179, https://github.com/matplotlib/matplotlib/issues/2277) but apparently never made it upstream.
Comment 1 madbiologist 2015-07-28 16:00:34 UTC
Still occurring on Ubuntu 15.04 with librsvg2-2 2.40.9-1.
Comment 2 madbiologist 2017-04-17 12:04:31 UTC
Fixed on Ubuntu 17.04 with eog 3.24.0-0ubuntu1 and librsvg2-2 2.40.16-2~svn1
Comment 3 GNOME Infrastructure Team 2017-12-13 18:08:29 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/librsvg/issues/109.