rebootcode / svg-edit

Automatically exported from code.google.com/p/svg-edit
MIT License
0 stars 0 forks source link

automatic modification to source renders svgs impossible to edit #866

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Load a file with containing a <g> and no <title>, i.e. having the basic 
structure
<svg><g style="some styles" id="group-without-title-element"></g></svg>
2. Attempt to select any path or other element within the original <g> element
3. Open the source code, it is now <svg><g><title>Layer 1</title><g style="some 
styles" id="group-without-title-element"></g></g></svg>

What is the expected output? What do you see instead?

Because svg adamantly equates groups to graphical program layers, it will wrap 
a <g> around any <title> that does not sit in one (even though the spec, if I 
understand it right, says that there SHOULD be such a title). Result is a weird 
"layer inside a layer" that is impossible to do anything to until you manually 
fix the mess in the code (and if you restore the original code, you just 
trigger the original issue). The same issue will occur if a title sits outside 
the group. These are extremely simple SVGs I'm trying to edit (e.g. 
http://upload.wikimedia.org/wikipedia/commons/4/47/BSicon_vWSLge.svg, 
attached), and it is surprising how the program has essentially rendered itself 
useless.

In what browser did you experience this problem? (ALL, Firefox, Opera, etc)

I would expect the program not to make this kind unnecessary "cleanup", 
ESPECIALLY after I explicitly undo it in source code!

In what version of SVG-edit does the problem occur? (Latest trunk, 2.5.1,
etc)

2.5.1

Please provide any additional information below.

Some sort of safeguard should be applied to prevent this kind of 
"layerfication" of an image being loaded. Amongst options are: allow 
deactivation of the layer function, insert titles inside group BEFORE new <g> 
elements are added, ensure that no <g> element are wrapped around the <title> 
that is child of the <svg> element...

Original issue reported on code.google.com by circeus...@gmail.com on 14 Oct 2011 at 8:53

Attachments:

GoogleCodeExporter commented 9 years ago
Apologies for misaligning thing. The problem is with Firefox, but its nature 
suggest it probably occurs on many opened SVGs that were created from raw text. 
I was hoping for a mean of easily switching between text and image, but was 
quite disappointed by the constant pointless "adjustments" to the source code

Original comment by circeus...@gmail.com on 14 Oct 2011 at 9:03