| OLD | NEW |
| (Empty) |
| 1 <html> | |
| 2 <head> | |
| 3 <script src="../../fast/js/resources/js-test-pre.js"></script> | |
| 4 <script src="resources/scripted-random.js"></script> | |
| 5 <script src="resources/viewspec-parser.js"></script> | |
| 6 </head> | |
| 7 <body> | |
| 8 <p id="description"></p> | |
| 9 <div id="console"></div> | |
| 10 <script> | |
| 11 // maps a viewspec attribute to its minimum argument count. | |
| 12 var attributes = { | |
| 13 viewBox: 6, | |
| 14 preserveAspectRatio: 1, | |
| 15 transform: 1, | |
| 16 zoomAndPan: 1, | |
| 17 viewTarget: 1 | |
| 18 }; | |
| 19 | |
| 20 var tests = [ | |
| 21 "svgView(viewBox(0,0,200,200)))", | |
| 22 "svgView(preserveAspectRatio(xMaxYMin slice))", | |
| 23 "svgView(preserveAspectRatio(xMaxYMin))", | |
| 24 "svgView(viewBox(1,2,3,4);preserveAspectRatio(xMaxYMin))", | |
| 25 "svgView(zoomAndPan(disable))", | |
| 26 "svgView(viewTarget(#myElementId))", | |
| 27 "svgView", | |
| 28 "svgView(", | |
| 29 "svgView()", | |
| 30 "svgView(" + String.fromCharCode(0), | |
| 31 "svgView(transform(scale(2));;)", | |
| 32 "svgView(transform(scale(2));x", // used to hang | |
| 33 "svgView(transform(scale(.5)))", | |
| 34 "svgView(;transform(scale(.5)))", | |
| 35 "svgView(;;transform(scale(.5)))", | |
| 36 "svgView(transform(scale(.5));transform(scale(2));transform(scale(2)))", | |
| 37 ]; | |
| 38 | |
| 39 for (var attribute in attributes) { | |
| 40 // attribute names that are "off by one" | |
| 41 var extraChar = attribute.charAt(attribute.length - 1); | |
| 42 tests.push("svgView(" + attribute + extraChar + "(0, 0)"); | |
| 43 tests.push("svgView(" + attribute.substring(0, attribute.length - 1) + "
(0, 0)"); | |
| 44 | |
| 45 // Empty-ish attributes | |
| 46 tests.push("svgView(" + attribute); | |
| 47 tests.push("svgView(" + attribute + String.fromCharCode(0)); | |
| 48 } | |
| 49 | |
| 50 if (window.testRunner) | |
| 51 testRunner.waitUntilDone(); | |
| 52 | |
| 53 startViewspecTests(tests); | |
| 54 | |
| 55 </script> | |
| 56 </html> | |
| OLD | NEW |