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



commit d38cb2e3de1a5a23e14e9ea5d0f788cab3511088
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 |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/rsvg-base.c b/rsvg-base.c
index 6ebed89..0a0c93a 100644
--- a/rsvg-base.c
+++ b/rsvg-base.c
@@ -351,10 +351,11 @@ static const NodeCreator node_creators[] = {
     /* "vkern",              FALSE, */
 };
 
-/* 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.
+/* 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.
  */
-static const NodeCreator default_node_creator = { NULL, TRUE, rsvg_node_group_new };
+static const NodeCreator default_node_creator = { NULL, TRUE, rsvg_node_defs_new };
 
 /* Used from bsearch() */
 static int


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