Skip to content
  • Federico Mena Quintero's avatar
    Don't recurse into get_dimensions() from get_node_geometry() · bb68856d
    Federico Mena Quintero authored
    As an experiment to remove this recursion, this commit does a few
    things:
    
    * Makes get_node_geometry() not call get_dimensions().  This was a
      semi-recursive call when the toplevel SVG has
      width/height="100%" (or any other percentage-based size), and no
      viewBox.  Instead, start with a 1x1 viewport that matches the
      temporary surface used to run the rendering/measuring loop.
    
    * Make the case where an SVG has no dimensions (no width/height, no
      viewBox, no objects at all) *not* a rendering error.  Remove
      RenderingError::SvgHasNoSize and just render nothing.
    
    This also makes tests/render-crash not check the result of
    rsvg_handle_render_cairo().
    
    We are just checking whether the rendering doesn't crash; not that
    files actually render without errors.
    
    For the same reason, don't even try to figure out the SVG's
    dimensions; just render to a constant-sized surface.
    bb68856d