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 634514 - Should ignore unknown elements and all sub-elements.
Should ignore unknown elements and all sub-elements.
Status: RESOLVED FIXED
Product: librsvg
Classification: Core
Component: general
2.32.x
Other All
: Normal normal
: ---
Assigned To: Federico Mena Quintero
librsvg maintainers
: 644582 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2010-11-10 14:07 UTC by Ahmed Harthi
Modified: 2017-08-29 13:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
zap.svg downloaded from Microsoft ie9 test drive (3.25 KB, image/svg+xml)
2010-11-10 14:07 UTC, Ahmed Harthi
  Details
634514.patch (907 bytes, patch)
2017-08-27 17:27 UTC, Federico Mena Quintero
none Details | Review

Description Ahmed Harthi 2010-11-10 14:07:29 UTC
Created attachment 174198 [details]
zap.svg downloaded from Microsoft ie9 test drive

A black rectangle appears when render <flowRoot> svg tag.. this is a similar bug to https://bugzilla.mozilla.org/show_bug.cgi?id=477171

Attached zap.svg for test.. compare it against Inkscape.
Comment 1 Felix Riemann 2010-11-12 22:06:40 UTC
Since librsvg handles the rendering of SVGs for eog this needs to be fixed over there. Reassigning.
Comment 2 Felix Riemann 2011-03-13 11:44:25 UTC
*** Bug 644582 has been marked as a duplicate of this bug. ***
Comment 3 André Klapper 2017-08-25 18:07:42 UTC
Downstream comments imply that flowroot was only defined in the deprecated SVG 1.2 draft and propose to WONTFIX this. See
https://phabricator.wikimedia.org/T43424#1269474
and followup comments.
Comment 4 Federico Mena Quintero 2017-08-27 17:15:05 UTC
Indeed, flowRoot is not in the 1.1 spec nor in the 1.2 draft spec.

Librsvg blindly translates unknown elements into <g> groups; this cause it to ignore rendering for those elements, but sub-elements *are* rendered.  This is what causes the black rectangle to appear in the example file.

The SVG 1.1 spec says in the "Error Processing" section:
https://www.w3.org/TR/SVG/implnote.html#ErrorProcessing

"When an element or attribute is encountered in the document which is not part of the SVG DTD [...] The document shall be rendered up to, but not including, the first element which has an error."

I don't think most viewers/browsers work like this; they just ignore problematic elements.  Librsvg certainly works like this, or at least that's the intention :)

I'm going to tentatively name this bug to "Should ignore unknown elements and all sub-elements", and see what happens if we make librsvg follow that behavior.
Comment 5 Federico Mena Quintero 2017-08-27 17:27:15 UTC
Created attachment 358519 [details] [review]
634514.patch

Here's a quickie patch that implements the behavior of ignoring unknown elements and all their sub-elements.  In light of bug #401115 I'm not sure this is completely the right thing to do, although that bug also refers to unknown/obsolete elements for text flows.

Could you give this a try and see if it causes problems elsewhere?  I haven't tested e.g. the SVG test suite's files for the <switch> element and things like that.
Comment 6 Federico Mena Quintero 2017-08-29 13:52:49 UTC
After more investigation, I think this *is* the right fix.  I've pushed it to the master branch as commit d38cb2e3de1a5a23e14e9ea5d0f788cab3511088.