Fri, 16 Jan 2015 18:13:44 +0100
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 invalid values for |viewBox| attribute</title> |
michael@0 | 4 | <defs> |
michael@0 | 5 | <rect id="redRect" fill="red" height="10" width="10"/> |
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 an invalid viewBox. If we |
michael@0 | 11 | honor the invalid viewBox (ignoring typos), that will make us scale |
michael@0 | 12 | the <use>'d redRect to appear larger than the limeRect, and we'll have |
michael@0 | 13 | some red showing (and we'll fail the test). --> |
michael@0 | 14 | |
michael@0 | 15 | <!-- First row: Initial comma(s) --> |
michael@0 | 16 | <g transform="translate(0, 0)"> |
michael@0 | 17 | <g transform="translate(0, 0)"> |
michael@0 | 18 | <svg width="20" height="20" viewBox=",0,0,1,1"> |
michael@0 | 19 | <use xlink:href="#redRect"/> |
michael@0 | 20 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 21 | </g> |
michael@0 | 22 | <g transform="translate(40, 0)"> |
michael@0 | 23 | <svg width="20" height="20" viewBox=",,0,0,1,1"> |
michael@0 | 24 | <use xlink:href="#redRect"/> |
michael@0 | 25 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 26 | </g> |
michael@0 | 27 | <g transform="translate(80, 0)"> |
michael@0 | 28 | <svg width="20" height="20" viewBox=", ,0,0,1,1"> |
michael@0 | 29 | <use xlink:href="#redRect"/> |
michael@0 | 30 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 31 | </g> |
michael@0 | 32 | <g transform="translate(120, 0)"> |
michael@0 | 33 | <svg width="20" height="20" viewBox=", 0,0,1,1"> |
michael@0 | 34 | <use xlink:href="#redRect"/> |
michael@0 | 35 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 36 | </g> |
michael@0 | 37 | <g transform="translate(160, 0)"> |
michael@0 | 38 | <svg width="20" height="20" viewBox=",,, 0,0,1,1"> |
michael@0 | 39 | <use xlink:href="#redRect"/> |
michael@0 | 40 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 41 | </g> |
michael@0 | 42 | </g> |
michael@0 | 43 | <!-- Second row: Trailing comma(s) --> |
michael@0 | 44 | <g transform="translate(0, 40)"> |
michael@0 | 45 | <g transform="translate(0, 0)"> |
michael@0 | 46 | <svg width="20" height="20" viewBox="0,0,1,1,"> |
michael@0 | 47 | <use xlink:href="#redRect"/> |
michael@0 | 48 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 49 | </g> |
michael@0 | 50 | <g transform="translate(40, 0)"> |
michael@0 | 51 | <svg width="20" height="20" viewBox="0,0,1,1 ,"> |
michael@0 | 52 | <use xlink:href="#redRect"/> |
michael@0 | 53 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 54 | </g> |
michael@0 | 55 | <g transform="translate(80, 0)"> |
michael@0 | 56 | <svg width="20" height="20" viewBox="0,0,1,1,,"> |
michael@0 | 57 | <use xlink:href="#redRect"/> |
michael@0 | 58 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 59 | </g> |
michael@0 | 60 | <g transform="translate(120, 0)"> |
michael@0 | 61 | <svg width="20" height="20" viewBox="0,0,1,1, ,"> |
michael@0 | 62 | <use xlink:href="#redRect"/> |
michael@0 | 63 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 64 | </g> |
michael@0 | 65 | <g transform="translate(160, 0)"> |
michael@0 | 66 | <svg width="20" height="20" viewBox="0,0,1,1 ,,,"> |
michael@0 | 67 | <use xlink:href="#redRect"/> |
michael@0 | 68 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 69 | </g> |
michael@0 | 70 | </g> |
michael@0 | 71 | <!-- Third row: Repeated commas in the middle --> |
michael@0 | 72 | <g transform="translate(0, 80)"> |
michael@0 | 73 | <g transform="translate(0, 0)"> |
michael@0 | 74 | <svg width="20" height="20" viewBox="0,,0,1,1"> |
michael@0 | 75 | <use xlink:href="#redRect"/> |
michael@0 | 76 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 77 | </g> |
michael@0 | 78 | <g transform="translate(40, 0)"> |
michael@0 | 79 | <svg width="20" height="20" viewBox="0,,,0,1,1"> |
michael@0 | 80 | <use xlink:href="#redRect"/> |
michael@0 | 81 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 82 | </g> |
michael@0 | 83 | <g transform="translate(80, 0)"> |
michael@0 | 84 | <svg width="20" height="20" viewBox="0, ,0,1,1"> |
michael@0 | 85 | <use xlink:href="#redRect"/> |
michael@0 | 86 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 87 | </g> |
michael@0 | 88 | <g transform="translate(120, 0)"> |
michael@0 | 89 | <svg width="20" height="20" viewBox="0 0,, 1,1"> |
michael@0 | 90 | <use xlink:href="#redRect"/> |
michael@0 | 91 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 92 | </g> |
michael@0 | 93 | <g transform="translate(160, 0)"> |
michael@0 | 94 | <svg width="20" height="20" viewBox="0 0,,1 1"> |
michael@0 | 95 | <use xlink:href="#redRect"/> |
michael@0 | 96 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 97 | </g> |
michael@0 | 98 | </g> |
michael@0 | 99 | <!-- Fourth row: wrong number of values --> |
michael@0 | 100 | <g transform="translate(0, 120)"> |
michael@0 | 101 | <g transform="translate(0, 0)"> |
michael@0 | 102 | <svg width="20" height="20" viewBox=""> |
michael@0 | 103 | <use xlink:href="#redRect"/> |
michael@0 | 104 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 105 | </g> |
michael@0 | 106 | <g transform="translate(40, 0)"> |
michael@0 | 107 | <svg width="20" height="20" viewBox="0"> |
michael@0 | 108 | <use xlink:href="#redRect"/> |
michael@0 | 109 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 110 | </g> |
michael@0 | 111 | <g transform="translate(80, 0)"> |
michael@0 | 112 | <svg width="20" height="20" viewBox="0 0"> |
michael@0 | 113 | <use xlink:href="#redRect"/> |
michael@0 | 114 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 115 | </g> |
michael@0 | 116 | <g transform="translate(120, 0)"> |
michael@0 | 117 | <svg width="20" height="20" viewBox="0 0 1"> |
michael@0 | 118 | <use xlink:href="#redRect"/> |
michael@0 | 119 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 120 | </g> |
michael@0 | 121 | <g transform="translate(160, 0)"> |
michael@0 | 122 | <svg width="20" height="20" viewBox="0 0 1 1 1 "> |
michael@0 | 123 | <use xlink:href="#redRect"/> |
michael@0 | 124 | </svg><use xlink:href="#limeRect"/> |
michael@0 | 125 | </g> |
michael@0 | 126 | </g> |
michael@0 | 127 | </svg> |