Last modified: 2013-11-25 12:15:40 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T55899, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 53899 - SVG masks fail to render (or even display)
SVG masks fail to render (or even display)
Status: REOPENED
Product: Wikimedia
Classification: Unclassified
SVG rendering (Other open bugs)
unspecified
All All
: Normal normal (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-09-08 01:54 UTC by kelvinsong10
Modified: 2013-11-25 12:15 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Test file (2.71 KB, image/svg+xml)
2013-09-08 01:54 UTC, kelvinsong10
Details
The original test case with default attributes filled in (2.76 KB, image/svg+xml)
2013-09-09 17:12 UTC, Bawolff (Brian Wolff)
Details
patch to librsvg to change default mask size (754 bytes, text/plain)
2013-11-25 12:15 UTC, Bawolff (Brian Wolff)
Details

Description kelvinsong10 2013-09-08 01:54:17 UTC
Created attachment 13256 [details]
Test file

Any SVG element that has an SVG mask will disappear silently.

See https://commons.wikimedia.org/wiki/File:SVG_mask.svg for an example—there should be a pink rectangle with an opacity gradient (not a square, not a solid color, and certainly not nothing at all). Try viewing in Inkscape or Firefox to see the correct version.
Comment 1 Bawolff (Brian Wolff) 2013-09-08 13:23:31 UTC
Upstream issue with rsvg
Comment 2 PRO 2013-09-08 19:18:25 UTC
Thats not true, RSVG supports simple mask fully. Mask with gradients only partialy. For example https://commons.wikimedia.org/wiki/File:SVG_mask_gradient_bug.svg
Comment 3 kelvinsong10 2013-09-08 19:40:07 UTC
So, the same thing that can be achieved with Clipping paths. The whole point of masks is so you can apply opacity gradients/blurs!!! As it stands, the RSVG-supported masks are useless.
Comment 4 PRO 2013-09-08 19:44:24 UTC
I removed the maskUnits="userSpaceOnUse" (in the mask tag) and the mask is working for this file!?

W3C cite: "If attribute ‘maskUnits’ is not specified, then the effect is as if a value of 'objectBoundingBox' were specified."
Comment 5 kelvinsong10 2013-09-08 20:32:09 UTC
Okay, I tried what you did, and it works!!! (The reason I reverted you at the file is because you didn't fix the mask—you flattened the masks and applied the opacity gradient directly to the pink rectangle). Sounds like an Inkscape bug then, as mask behavior doesn't seem to be seriously affected by removal of this property.
Comment 6 Andre Klapper 2013-09-09 14:01:51 UTC
(In reply to comment #5)
> Sounds like an Inkscape bug then

In that case, upstreaming it with a testcase would be welcome:
http://inkscape.org/report_bugs.php
Comment 7 Bawolff (Brian Wolff) 2013-09-09 17:12:22 UTC
Created attachment 13260 [details]
The original test case with default attributes filled in


> 
> In that case, upstreaming it with a testcase would be welcome:
> http://inkscape.org/report_bugs.php

Re-opening. maskUnits is part of the spec, the fact its broken in rsvg is a bug in rsvg.

The fact that in this particular svg, the unit types in use don't make much of a difference doesn't mean this isn't a bug.
------

It appears rsvg does not have the correct defaults for the x, y, width and height attribute on <mask> when using userSpaceOnUse. According to the spec, I believe the correct defaults are -10%, -10%, 120%, 120% respectively. [1] (Assuming I interpreted spec correctly. I'm not really all that familiar with the details of the svg spec)

Attaching an svg with these defaults filled in, appears to make the file work fine for rsvg.

[1] http://www.w3.org/TR/SVG11/masking.html#MaskElementMaskUnitsAttribute
Comment 9 Bawolff (Brian Wolff) 2013-09-09 22:35:34 UTC
(In reply to comment #7)

> 
> It appears rsvg does not have the correct defaults for the x, y, width and
> height attribute on <mask> when using userSpaceOnUse. According to the spec,
> I
> believe the correct defaults are -10%, -10%, 120%, 120% respectively. [1]
> (Assuming I interpreted spec correctly. I'm not really all that familiar with
> the details of the svg spec)

I have a 4 line patch to rsvg that I think fixes the issue (Think being the operative word. I'm a c newb). I just spent 4 hours trying to make the thing compile at all, so I'm going to sleep on it, and then test it a bunch to make sure it actually works like I think it does. If so I'll file a bug/patch upstream and see what happens.
Comment 10 Andre Klapper 2013-09-18 17:24:04 UTC
(In reply to comment #9)
> I have a 4 line patch to rsvg that I think fixes the issue (Think being the
> operative word. I'm a c newb). I just spent 4 hours trying to make the thing
> compile at all, so I'm going to sleep on it, and then test it a bunch to make
> sure it actually works like I think it does. If so I'll file a bug/patch
> upstream and see what happens.

bawolff: Did you have time for that? Is there an upstream URL?
Comment 11 Bawolff (Brian Wolff) 2013-09-18 23:04:07 UTC
(In reply to comment #10)
> (In reply to comment #9)
> > I have a 4 line patch to rsvg that I think fixes the issue (Think being the
> > operative word. I'm a c newb). I just spent 4 hours trying to make the thing
> > compile at all, so I'm going to sleep on it, and then test it a bunch to make
> > sure it actually works like I think it does. If so I'll file a bug/patch
> > upstream and see what happens.
> 
> bawolff: Did you have time for that? Is there an upstream URL?

Sorry not yet. Ill try to do that soon. My free time to do wiki stuff has somewhat evaporated.
Comment 12 Andre Klapper 2013-11-22 15:37:51 UTC
bawolff: Understanding that you're busy, could you please share your untested four lines here so someone else would have the chance to test / improve a potential patch?
Comment 13 Bawolff (Brian Wolff) 2013-11-25 12:15:40 UTC
Created attachment 13897 [details]
patch to librsvg to change default mask size

(In reply to comment #12)
> bawolff: Understanding that you're busy, could you please share your untested
> four lines here so someone else would have the chance to test / improve a
> potential patch?

Sorry, I meant to get back to this bug way before now, but I kind of forgot about this.


See the relavent section of the svg spec for where the numbers I chose came from.

Before submitting this upstream, I wanted to compile the patch on rsvg master (I was having trouble generating the build script, although I haven't put much effort into that. I did test on a modified version of the librsvg-2.39.0 tarball and it seemed to work well).

I also wanted to create a minimal test case for this before submitting upstream, which I haven't gotten around to yet.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links