dom/smil/test/smilAnimateMotionValueLists.js

changeset 0
6474c204b198
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/dom/smil/test/smilAnimateMotionValueLists.js	Wed Dec 31 06:09:35 2014 +0100
     1.3 @@ -0,0 +1,128 @@
     1.4 +/* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
     1.5 +/* vim: set ts=2 sw=2 sts=2 et: */
     1.6 +/* This Source Code Form is subject to the terms of the Mozilla Public
     1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this
     1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     1.9 +
    1.10 +/* Lists of valid & invalid values for the various <animateMotion> attributes */
    1.11 +const gValidValues = [
    1.12 +  "10 10",
    1.13 +  "10 10;",  // Trailing semicolons are allowed
    1.14 +  "10 10;  ",
    1.15 +  "   10   10em  ",
    1.16 +  "1 2  ; 3,4",
    1.17 +  "1,2;3,4",
    1.18 +  "0 0",
    1.19 +  "0,0",
    1.20 +];
    1.21 +
    1.22 +const gInvalidValues = [
    1.23 +  ";10 10",
    1.24 +  "10 10;;",
    1.25 +  "1 2 3",
    1.26 +  "1 2 3 4",
    1.27 +  "1,2;3,4 ,",
    1.28 +  ",", " , ",
    1.29 +  ";", " ; ",
    1.30 +  "a", " a; ", ";a;",
    1.31 +  "", " ",
    1.32 +  "1,2;3,4,",
    1.33 +  "1,,2",
    1.34 +  ",1,2",
    1.35 +];
    1.36 +
    1.37 +const gValidRotate = [
    1.38 +  "10",
    1.39 +  "20.1",
    1.40 +  "30.5deg",
    1.41 +  "0.5rad",
    1.42 +  "auto",
    1.43 +  "auto-reverse"
    1.44 +];
    1.45 +
    1.46 +const gInvalidRotate = [
    1.47 +  " 10 ",
    1.48 +  "  10deg",
    1.49 +  "10 deg",
    1.50 +  "10deg ",
    1.51 +  "10 rad    ",
    1.52 +  "aaa",
    1.53 +  " 10.1 ",
    1.54 +];
    1.55 +
    1.56 +const gValidToBy = [
    1.57 + "0 0",
    1.58 + "1em,2",
    1.59 + "50.3em 0.2in",
    1.60 + " 1,2",
    1.61 + "1 2 "
    1.62 +];
    1.63 +
    1.64 +const gInvalidToBy = [
    1.65 + "0 0 0",
    1.66 + "0 0,0",
    1.67 + "0,0,0",
    1.68 + "1emm 2",
    1.69 + "1 2;",
    1.70 + "1 2,",
    1.71 + " 1,2 ,",
    1.72 + "abc",
    1.73 + ",",
    1.74 + "",
    1.75 + "1,,2",
    1.76 + "1,2,"
    1.77 +];
    1.78 +
    1.79 +const gValidPath = [
    1.80 + "m0 0     L30 30",
    1.81 + "M20,20L10    10",
    1.82 + "M20,20 L30, 30h20",
    1.83 + "m50 50", "M50 50",
    1.84 + "m0 0", "M0, 0"
    1.85 +];
    1.86 +
    1.87 +// paths must start with at least a valid "M" segment to be valid
    1.88 +const gInvalidPath = [
    1.89 + "M20in 20",
    1.90 + "h30",
    1.91 + "L50 50",
    1.92 + "abc",
    1.93 +];
    1.94 +
    1.95 +// paths that at least start with a valid "M" segment are valid - the spec says
    1.96 +// to parse everything up to the first invalid token
    1.97 +const gValidPathWithErrors = [
    1.98 + "M20 20em",
    1.99 + "m0 0 L30,,30",
   1.100 + "M10 10 L50 50 abc",
   1.101 +];
   1.102 +
   1.103 +const gValidKeyPoints = [
   1.104 +  "0; 0.5; 1",
   1.105 +  "0;.5;1",
   1.106 +  "0; 0; 1",
   1.107 +  "0; 1; 1",
   1.108 +  "0; 0; 1;", // Trailing semicolons are allowed
   1.109 +  "0; 0; 1; ",
   1.110 +  "0; 0.000; 1",
   1.111 +  "0; 0.000001; 1",
   1.112 +];
   1.113 +
   1.114 +// Should have 3 values to be valid.
   1.115 +// Same as number of keyTimes values
   1.116 +const gInvalidKeyPoints = [
   1.117 +  "0; 1",
   1.118 +  "0; 0.5; 0.75; 1",
   1.119 +  "0; 1;",
   1.120 +  "0",
   1.121 +  "1",
   1.122 +  "a",
   1.123 +  "",
   1.124 +  "  ",
   1.125 +  "0; -0.1; 1",
   1.126 +  "0; 1.1; 1",
   1.127 +  "0; 0.1; 1.1",
   1.128 +  "-0.1; 0.1; 1",
   1.129 +  "0; a; 1",
   1.130 +  "0;;1",
   1.131 +];

mercurial