layout/reftests/svg/viewBox-valid-01.svg

Fri, 16 Jan 2015 18:13:44 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Fri, 16 Jan 2015 18:13:44 +0100
branch
TOR_BUG_9701
changeset 14
925c144e1f1f
permissions
-rw-r--r--

Integrate suggestion from review to improve consistency with existing code.

michael@0 1 <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
michael@0 2 xmlns:xlink="http://www.w3.org/1999/xlink">
michael@0 3 <title>Testing valid values for |viewBox| attribute</title>
michael@0 4 <defs>
michael@0 5 <rect id="redRect" fill="red" height="20" width="20"/>
michael@0 6 <rect id="limeRect" fill="lime" height="10" width="10"/>
michael@0 7 </defs>
michael@0 8 <rect fill="lime" height="100%" width="100%"/>
michael@0 9
michael@0 10 <!-- SUMMARY: Each <svg> subdocument below has a valid viewBox. If we honor
michael@0 11 the valid viewBox (ignoring typos), that will make us scale the <use>'d
michael@0 12 limeRect to appear as big as than the redRect, and we'll have no red
michael@0 13 showing (and we'll pass the test). -->
michael@0 14
michael@0 15 <!-- First row: no commas at all -->
michael@0 16 <g transform="translate(0, 0)">
michael@0 17 <g transform="translate(0, 0)">
michael@0 18 <use xlink:href="#redRect"/>
michael@0 19 <svg width="20" height="20" viewBox="0 0 10 10">
michael@0 20 <use xlink:href="#limeRect"/>
michael@0 21 </svg>
michael@0 22 </g>
michael@0 23 <g transform="translate(40, 0)">
michael@0 24 <use xlink:href="#redRect"/>
michael@0 25 <svg width="20" height="20" viewBox=" 0 0 10 10">
michael@0 26 <use xlink:href="#limeRect"/>
michael@0 27 </svg>
michael@0 28 </g>
michael@0 29 <g transform="translate(80, 0)">
michael@0 30 <use xlink:href="#redRect"/>
michael@0 31 <svg width="20" height="20" viewBox="0 0 10 10 ">
michael@0 32 <use xlink:href="#limeRect"/>
michael@0 33 </svg>
michael@0 34 </g>
michael@0 35 <g transform="translate(120, 0)">
michael@0 36 <use xlink:href="#redRect"/>
michael@0 37 <svg width="20" height="20" viewBox=" 0 0 10 10 ">
michael@0 38 <use xlink:href="#limeRect"/>
michael@0 39 </svg>
michael@0 40 </g>
michael@0 41 </g>
michael@0 42 <!-- Second row: some commas -->
michael@0 43 <g transform="translate(0, 40)">
michael@0 44 <g transform="translate(0, 0)">
michael@0 45 <use xlink:href="#redRect"/>
michael@0 46 <svg width="20" height="20" viewBox="0,0 10 10">
michael@0 47 <use xlink:href="#limeRect"/>
michael@0 48 </svg>
michael@0 49 </g>
michael@0 50 <g transform="translate(40, 0)">
michael@0 51 <use xlink:href="#redRect"/>
michael@0 52 <svg width="20" height="20" viewBox="0 0,10 10">
michael@0 53 <use xlink:href="#limeRect"/>
michael@0 54 </svg>
michael@0 55 </g>
michael@0 56 <g transform="translate(80, 0)">
michael@0 57 <use xlink:href="#redRect"/>
michael@0 58 <svg width="20" height="20" viewBox="0 0 10,10">
michael@0 59 <use xlink:href="#limeRect"/>
michael@0 60 </svg>
michael@0 61 </g>
michael@0 62 <g transform="translate(120, 0)">
michael@0 63 <use xlink:href="#redRect"/>
michael@0 64 <svg width="20" height="20" viewBox="0,0,10,10">
michael@0 65 <use xlink:href="#limeRect"/>
michael@0 66 </svg>
michael@0 67 </g>
michael@0 68 </g>
michael@0 69 <!-- Third row: commas & whitespace mixed -->
michael@0 70 <g transform="translate(0, 80)">
michael@0 71 <g transform="translate(0, 0)">
michael@0 72 <use xlink:href="#redRect"/>
michael@0 73 <svg width="20" height="20" viewBox="0, 0 10 10">
michael@0 74 <use xlink:href="#limeRect"/>
michael@0 75 </svg>
michael@0 76 </g>
michael@0 77 <g transform="translate(40, 0)">
michael@0 78 <use xlink:href="#redRect"/>
michael@0 79 <svg width="20" height="20" viewBox="0 0 , 10 10">
michael@0 80 <use xlink:href="#limeRect"/>
michael@0 81 </svg>
michael@0 82 </g>
michael@0 83 <g transform="translate(80, 0)">
michael@0 84 <use xlink:href="#redRect"/>
michael@0 85 <svg width="20" height="20" viewBox="0 0 10 ,10">
michael@0 86 <use xlink:href="#limeRect"/>
michael@0 87 </svg>
michael@0 88 </g>
michael@0 89 <g transform="translate(120, 0)">
michael@0 90 <use xlink:href="#redRect"/>
michael@0 91 <svg width="20" height="20" viewBox=" 0 ,0, 10,10 ">
michael@0 92 <use xlink:href="#limeRect"/>
michael@0 93 </svg>
michael@0 94 </g>
michael@0 95 </g>
michael@0 96 </svg>

mercurial