dom/smil/test/smilAnimateMotionValueLists.js

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

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

mercurial