SVG which includes mask does not display correctly in any browser/viewer except Inkscape

Bug #1481302 reported by Jean-Sebastien
26
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Inkscape
Confirmed
Medium
Unassigned

Bug Description

Inkscape version: 0.91 r13725
OS/platform: Windows 7 x64

I have a basic SVG image that represents a checkbox which is checked. The SVG is simple: it contains a box and a checkmark. The checkmark was built using rectangles and an opacity mask.

Whenever I try to display the image in a browser, only the box is displayed (not the checkmark). However the checkmark is visible when viewed in Inkscape.

Any idea why?

See attachments for screenshots and SVG file.

Revision history for this message
Jean-Sebastien (jean-sebastien-lemay) wrote :
Revision history for this message
Jean-Sebastien (jean-sebastien-lemay) wrote :

Screenshot #2: as seen in Google Chrome

Revision history for this message
Jean-Sebastien (jean-sebastien-lemay) wrote :

The actual SVG file

Revision history for this message
su_v (suv-lp) wrote :

Please add information about OS/platform and Inkscape version to the bug description, thank you.

Changed in inkscape:
status: New → Incomplete
description: updated
Revision history for this message
Jean-Sebastien (jean-sebastien-lemay) wrote :

Changed status to "New" after adding missing information

Changed in inkscape:
status: Incomplete → New
Revision history for this message
su_v (suv-lp) wrote :

Steps to reproduce (from scratch):

1) launch Inkscape 0.91 (default new doc, default prefs)
2) draw a rectangle with geometry 100x100px
3) change rectangle style to blue fill, no stroke
4) position at the bottom left corner of the A4 page
5) draw a circle on-top of the rectangle (use node snapping to rectangle corners)
6) change circle style to white fill, no stroke
7) convert circle to path (Shift+Ctrl+C)
8) select all, apply mask
Save, view in browser: ok
8) open Document properties, resize page to drawing
Save, view in browser: the masked object is "gone"

AFAIU Inkscape's mask definition with maskUnits="userSpaceOnUse" should compensate the offset (translate() transformation) of the parent group of the masked object (this offset gets added to all top-level objects including layers when resizing the page to drawing content) via x, y coordinates for the off-screen buffer (or maybe apply the transformation to the mask content instead (?)); otherwise other SVG viewers (Chromium, Firefox, Batik, librsvg) seem to render the mask at the "wrong" location, and the masked object "disappears" (it is masked out because the offset mask in is "transparent" in the area of the masked object).

Related earlier report:
Bug #404009 “rendering different in inkscape than FF/Baltik with masked objects”

As possible workarounds for affected users:
a) resize the page first, and only add content on a layer newly added after having resized the page, or
b) with use cases like the example attached in this report: draw the initial object aligned with its top-left corner to the top-left corner of the page instead of positioning the bottom-left corner of the object at the bottom-left one of the page (step 4).

Proposing to link as duplicate to bug #404009.

tags: added: svg transformations
Changed in inkscape:
importance: Undecided → Medium
status: New → Confirmed
Revision history for this message
su_v (suv-lp) wrote :

See also (simpler) steps to reproduce in duplicate bug #1507565.

Revision history for this message
Jabiertxof (jabiertxof) wrote :

If you apply mask item parent transform to mask, render ok. Not sure if is the best method.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.