]> gitweb.michael.orlitzky.com - libsvgtiny.git/blobdiff - src/svgtiny.c
src/svgtiny.c: remove parent == NULL hack
[libsvgtiny.git] / src / svgtiny.c
index 91ce4396799e7f96714fdb7e4114a6e23f2fa600..165fc215758f330d32beb0dc8dda704fd9e234c0 100644 (file)
@@ -2340,30 +2340,6 @@ css_select_results *svgtiny_parse_styles(dom_element *node,
                dom_string_unref(attr);
        }
 
-       struct dom_element *parent;
-       dom_element_parent_node(node, &parent);
-       if (parent == NULL) {
-               /* This is the root <svg> node, skip it.
-                *
-                * While initialising its selection state, libcss sets its
-                * node_data->bloom pointer using css__get_parent_bloom().
-                * But if there is no parent, that function returns,
-                *
-                *   static css_bloom empty_bloom[CSS_BLOOM_SIZE];
-                *
-                * A problem later arises because when libcss FINALISES its
-                * selection state, it frees node_data->bloom! That obviously
-                * won't work then node has no parent, i.e. if it's the root
-                * <svg> element.
-                */
-               css_stylesheet_destroy(inline_sheet);
-               return NULL;
-       }
-       else {
-               /* We only needed to know if it was NULL */
-               dom_node_unref(parent);
-       }
-
        code = svgtiny_select_style(state, node, inline_sheet, &styles);
        css_stylesheet_destroy(inline_sheet);
        if (code != CSS_OK) {