GNOME Bugzilla – Bug 634514
Should ignore unknown elements and all sub-elements.
Last modified: 2017-08-29 13:52:49 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.
Since librsvg handles the rendering of SVGs for eog this needs to be fixed over there. Reassigning.
*** Bug 644582 has been marked as a duplicate of this bug. ***
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.
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.
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.
After more investigation, I think this *is* the right fix. I've pushed it to the master branch as commit d38cb2e3de1a5a23e14e9ea5d0f788cab3511088.