Issue 122594

Summary: [SVG] in inner svg the missing size is set to viewBox, but should be 100%
Product: Draw Reporter: Regina Henschel <rb.henschel>
Component: codeAssignee: Armin Le Grand <Armin.Le.Grand>
Status: CLOSED FIXED QA Contact:
Severity: Normal    
Priority: P3 CC: Armin.Le.Grand, doneyourself, issues, jsc
Version: 4.0.0-devFlags: jsc: 4.0.0_release_blocker+
Target Milestone: 4.0.0   
Hardware: PC   
OS: Windows 7   
URL: http://www.w3.org/TR/SVG/struct.html#SVGElementWidthAttribute
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Issue Depends on: 122600    
Issue Blocks:    
Attachments:
Description Flags
inner svg element without width/height but with viewBox
none
example with relative size in width and height
none
Already had something, adding none

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