[librsvg/librsvg-2.40] bgo#634514: Don't render unknown elements and their sub-elements



commit 3730200ec5625c7e3e5e28c60a607cebef835ee3
Author: Federico Mena Quintero <federico gnome org>
Date:   Tue Aug 29 08:48:08 2017 -0500

    bgo#634514: Don't render unknown elements and their sub-elements
    
    We were representing unknown elements as a NodeGroup, so their
    children would be rendered.
    
    Now we represent them as NodeDefs.  This is like a NodeGroup, but it
    doesn't do any rendering of itself or its children.  The SVG spec says
    that we should stop rendering the file if we encounter an unknown
    element, but it seems that real-world renderers are more lenient - so
    we'll just not render unknown elements and their children.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=634514

 rsvg-base.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/rsvg-base.c b/rsvg-base.c
index b42d4e8..5132d67 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -317,9 +317,11 @@ rsvg_standard_element_start (RsvgHandle * ctx, const char *name, RsvgPropertyBag
     else if (!strcmp (name, "tref"))
         newnode = rsvg_new_tref ();
     else {
-               /* hack for bug 401115. whenever we encounter a node we don't understand, push it into a 
group. 
-                  this will allow us to handle things like conditionals properly. */
-               newnode = rsvg_new_group ();
+        /* Whenever we encounter a node we don't understand, represent it as a defs.
+         * This is like a group, but it doesn't do any rendering of children.  The
+         * effect is that we will ignore all children of unknown elements.
+         */
+               newnode = rsvg_new_defs ();
        }
 
     if (newnode) {


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]