Adding a viewBox on load modifies document content unexpectedly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
New
|
Undecided
|
Unassigned |
Bug Description
Inkscape's addition of a viewBox attribute to the top-level <svg> element in current trunk / 0.92pre may silently modify document content as well: it converts for example presentation attributes to in-line CSS style properties. Such a conversion usually is only triggered when editing elements with such attributes (a to-be-expected change in that situation).
Attached is a (manually written) SVG file with presentation attributes for fill, fill-opacity and stroke.
Steps to reproduce:
1) open attached test case in current trunk / 0.92pre1 (default new prefs)
2) resave (File > Save as) without any modifications
3) inspect the saved file in external editor
Expected result:
Apart from formatting (indentation, linebreaks), adding metadata and editor information for document properties (namedview), and unique IDs to all elements, there are no further changes to the content itself.
Actual result:
In addition to the expected differences, all presentation attributes are converted to style properties.
Reverting the changes from r13938 and r14648 to not enforce adding a viewBox on load if not present produces the expected result (as long as the element is not edited within Inkscape, its original presentation attributes are preserved).
Reproduced with latest trunk (Inkscape 0.92pre1 r14954) on OS X 10.7.5.
=====
The issue was noticed while investigating this user question:
http://
Diff used for comparison if addition of viewBox is not enforced by Inkscape.
(Note: this diff is used for testing, it is not meant as a solution for the reported issue as-is)