Adding a viewBox on load modifies document content unexpectedly

Bug #1589217 reported by su_v
6
This bug affects 1 person
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://www.inkscapeforum.com/viewtopic.php?f=5&t=21031&p=78090

Tags: viewbox
Revision history for this message
su_v (suv-lp) wrote :
Revision history for this message
su_v (suv-lp) wrote :

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)

description: updated
Revision history for this message
su_v (suv-lp) wrote : Re: [Bug 1589217] [NEW] Adding a viewBox on load modifies document content unexpectedly

Attaching test case resaved with
- r14954 (-> style properties)
- r14954+diff (-> presentation attributes preserved)

Revision history for this message
su_v (suv-lp) wrote :

The changes from r13938 and r14648 mentioned in the bug description (see also comment 2) have been reverted in trunk lp:inkscape r15273 (backported to stable lp:inkscape/0.92.x r15220), as part of a solution for bug #1389723.

The original known trigger for the symptom reported here is thus gone:
- reproduced with lp:inkscape/0.92.x r15219
- not reproduced with lp:inkscape/0.92.x r15220:
  the test case opens in without unexpected changes to the objects'
  attributes; there is no viewBox attribute forcefully added to the
  (entirely 'px'-based) document either).

The underlying problem - adding a viewBox attribute on load affects (potentially modifies) the whole document, even if the document scale is identical (based on width, height attributes of root <svg> element in px/SVG user units) - likely remains unsolved, though currently not directly exposed.

Proposing to close (for now) as 'Won't Fix' (because no longer reproducible as reported with current builds).

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.