Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* vim: set ts=2 sw=2 sts=2 et: */ |
michael@0 | 3 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 4 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 5 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 6 | |
michael@0 | 7 | /* Lists of valid & invalid values for the various <animateMotion> attributes */ |
michael@0 | 8 | const gValidValues = [ |
michael@0 | 9 | "10 10", |
michael@0 | 10 | "10 10;", // Trailing semicolons are allowed |
michael@0 | 11 | "10 10; ", |
michael@0 | 12 | " 10 10em ", |
michael@0 | 13 | "1 2 ; 3,4", |
michael@0 | 14 | "1,2;3,4", |
michael@0 | 15 | "0 0", |
michael@0 | 16 | "0,0", |
michael@0 | 17 | ]; |
michael@0 | 18 | |
michael@0 | 19 | const gInvalidValues = [ |
michael@0 | 20 | ";10 10", |
michael@0 | 21 | "10 10;;", |
michael@0 | 22 | "1 2 3", |
michael@0 | 23 | "1 2 3 4", |
michael@0 | 24 | "1,2;3,4 ,", |
michael@0 | 25 | ",", " , ", |
michael@0 | 26 | ";", " ; ", |
michael@0 | 27 | "a", " a; ", ";a;", |
michael@0 | 28 | "", " ", |
michael@0 | 29 | "1,2;3,4,", |
michael@0 | 30 | "1,,2", |
michael@0 | 31 | ",1,2", |
michael@0 | 32 | ]; |
michael@0 | 33 | |
michael@0 | 34 | const gValidRotate = [ |
michael@0 | 35 | "10", |
michael@0 | 36 | "20.1", |
michael@0 | 37 | "30.5deg", |
michael@0 | 38 | "0.5rad", |
michael@0 | 39 | "auto", |
michael@0 | 40 | "auto-reverse" |
michael@0 | 41 | ]; |
michael@0 | 42 | |
michael@0 | 43 | const gInvalidRotate = [ |
michael@0 | 44 | " 10 ", |
michael@0 | 45 | " 10deg", |
michael@0 | 46 | "10 deg", |
michael@0 | 47 | "10deg ", |
michael@0 | 48 | "10 rad ", |
michael@0 | 49 | "aaa", |
michael@0 | 50 | " 10.1 ", |
michael@0 | 51 | ]; |
michael@0 | 52 | |
michael@0 | 53 | const gValidToBy = [ |
michael@0 | 54 | "0 0", |
michael@0 | 55 | "1em,2", |
michael@0 | 56 | "50.3em 0.2in", |
michael@0 | 57 | " 1,2", |
michael@0 | 58 | "1 2 " |
michael@0 | 59 | ]; |
michael@0 | 60 | |
michael@0 | 61 | const gInvalidToBy = [ |
michael@0 | 62 | "0 0 0", |
michael@0 | 63 | "0 0,0", |
michael@0 | 64 | "0,0,0", |
michael@0 | 65 | "1emm 2", |
michael@0 | 66 | "1 2;", |
michael@0 | 67 | "1 2,", |
michael@0 | 68 | " 1,2 ,", |
michael@0 | 69 | "abc", |
michael@0 | 70 | ",", |
michael@0 | 71 | "", |
michael@0 | 72 | "1,,2", |
michael@0 | 73 | "1,2," |
michael@0 | 74 | ]; |
michael@0 | 75 | |
michael@0 | 76 | const gValidPath = [ |
michael@0 | 77 | "m0 0 L30 30", |
michael@0 | 78 | "M20,20L10 10", |
michael@0 | 79 | "M20,20 L30, 30h20", |
michael@0 | 80 | "m50 50", "M50 50", |
michael@0 | 81 | "m0 0", "M0, 0" |
michael@0 | 82 | ]; |
michael@0 | 83 | |
michael@0 | 84 | // paths must start with at least a valid "M" segment to be valid |
michael@0 | 85 | const gInvalidPath = [ |
michael@0 | 86 | "M20in 20", |
michael@0 | 87 | "h30", |
michael@0 | 88 | "L50 50", |
michael@0 | 89 | "abc", |
michael@0 | 90 | ]; |
michael@0 | 91 | |
michael@0 | 92 | // paths that at least start with a valid "M" segment are valid - the spec says |
michael@0 | 93 | // to parse everything up to the first invalid token |
michael@0 | 94 | const gValidPathWithErrors = [ |
michael@0 | 95 | "M20 20em", |
michael@0 | 96 | "m0 0 L30,,30", |
michael@0 | 97 | "M10 10 L50 50 abc", |
michael@0 | 98 | ]; |
michael@0 | 99 | |
michael@0 | 100 | const gValidKeyPoints = [ |
michael@0 | 101 | "0; 0.5; 1", |
michael@0 | 102 | "0;.5;1", |
michael@0 | 103 | "0; 0; 1", |
michael@0 | 104 | "0; 1; 1", |
michael@0 | 105 | "0; 0; 1;", // Trailing semicolons are allowed |
michael@0 | 106 | "0; 0; 1; ", |
michael@0 | 107 | "0; 0.000; 1", |
michael@0 | 108 | "0; 0.000001; 1", |
michael@0 | 109 | ]; |
michael@0 | 110 | |
michael@0 | 111 | // Should have 3 values to be valid. |
michael@0 | 112 | // Same as number of keyTimes values |
michael@0 | 113 | const gInvalidKeyPoints = [ |
michael@0 | 114 | "0; 1", |
michael@0 | 115 | "0; 0.5; 0.75; 1", |
michael@0 | 116 | "0; 1;", |
michael@0 | 117 | "0", |
michael@0 | 118 | "1", |
michael@0 | 119 | "a", |
michael@0 | 120 | "", |
michael@0 | 121 | " ", |
michael@0 | 122 | "0; -0.1; 1", |
michael@0 | 123 | "0; 1.1; 1", |
michael@0 | 124 | "0; 0.1; 1.1", |
michael@0 | 125 | "-0.1; 0.1; 1", |
michael@0 | 126 | "0; a; 1", |
michael@0 | 127 | "0;;1", |
michael@0 | 128 | ]; |