Issue 122594 - [SVG] in inner svg the missing size is set to viewBox, but should be 100%
Summary: [SVG] in inner svg the missing size is set to viewBox, but should be 100%
Alias: None
Product: Draw
Classification: Application
Component: code (show other issues)
Version: 4.0.0-dev
Hardware: PC Windows 7
: P3 Normal (vote)
Target Milestone: 4.0.0
Assignee: Armin Le Grand
QA Contact:
: 122593 (view as issue list)
Depends on: 122600
  Show dependency treegraph
Reported: 2013-06-25 22:55 UTC by Regina Henschel
Modified: 2017-05-20 11:42 UTC (History)
4 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---
jsc: 4.0.0_release_blocker+

inner svg element without width/height but with viewBox (667 bytes, image/svg+xml)
2013-06-25 22:55 UTC, Regina Henschel
no flags Details
example with relative size in width and height (1.16 KB, image/svg+xml)
2013-06-27 20:56 UTC, Regina Henschel
no flags Details
Already had something, adding (4.57 KB, patch)
2013-06-28 11:30 UTC, Armin Le Grand
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Regina Henschel 2013-06-25 22:55:32 UTC
Created attachment 80913 [details]
inner svg element without width/height but with viewBox

Open attached document in Browser and in AOO. Notice, that the black rectangle is centered in the blue rectangle in browser, but left aligned in AOO.

The error is in SvgSvgNode::decomposeSvgNode. If the element svg has got no width/height the width/height of the viewBox attribute is used. Then the check "if(aTarget.equal(*getViewBox()))" is true. In result the sequence is appended immediately and the preserveAspectRatio attribute is not evaluated.

Correct behavior is to use the default width="100%" and height="100%", see link to specification.
Comment 1 Armin Le Grand 2013-06-26 13:03:39 UTC
ALG: Even more complicated, but showstoppers have prio. Will have a look ASAP. Grepping, though.
Comment 2 Regina Henschel 2013-06-27 20:56:32 UTC
Created attachment 80928 [details]
example with relative size in width and height

The display is wrong too, when a relative size is set explicitly. Compare graphic in Browser and AOO.
Comment 3 Armin Le Grand 2013-06-28 11:30:12 UTC
Created attachment 80939 [details]
Already had something, adding
Comment 4 jsc 2013-07-02 11:47:02 UTC
grant showstopper flag
Comment 5 Armin Le Grand 2013-07-02 12:01:47 UTC
ALG: Checked again, comitted, done.
Comment 6 SVN Robot 2013-07-02 12:03:24 UTC
"alg" committed SVN revision 1498895 into trunk:
i122594 correctly handle iner svg node when no width/height or percent is given
Comment 7 Armin Le Grand 2013-07-02 16:34:16 UTC
*** Issue 122593 has been marked as a duplicate of this issue. ***
Comment 8 Armin Le Grand 2013-07-02 16:34:57 UTC
ALG: #122593# is pretty much the same, adding here, too.
Comment 9 SVN Robot 2013-07-02 16:39:47 UTC
"alg" committed SVN revision 1499006 into trunk:
i122594 Added same handling for outer SVG element
Comment 10 liuping 2013-07-10 05:58:01 UTC
verify on  Rev. 1499347 on Windows 7