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 | /* testcase data for simple "from-by" animations of CSS properties */ |
michael@0 | 8 | |
michael@0 | 9 | // NOTE: This js file requires db_smilCSSPropertyList.js |
michael@0 | 10 | |
michael@0 | 11 | // Lists of testcases for re-use across multiple properties of the same type |
michael@0 | 12 | var _fromByTestLists = |
michael@0 | 13 | { |
michael@0 | 14 | color: [ |
michael@0 | 15 | new AnimTestcaseFromBy("rgb(10, 20, 30)", "currentColor", |
michael@0 | 16 | { midComp: "rgb(35, 45, 55)", |
michael@0 | 17 | toComp: "rgb(60, 70, 80)"}), |
michael@0 | 18 | new AnimTestcaseFromBy("currentColor", "rgb(30, 20, 10)", |
michael@0 | 19 | { fromComp: "rgb(50, 50, 50)", |
michael@0 | 20 | midComp: "rgb(65, 60, 55)", |
michael@0 | 21 | toComp: "rgb(80, 70, 60)"}), |
michael@0 | 22 | ], |
michael@0 | 23 | lengthNoUnits: [ |
michael@0 | 24 | new AnimTestcaseFromBy("0", "50", { fromComp: "0px", // 0 acts like 0px |
michael@0 | 25 | midComp: "25px", |
michael@0 | 26 | toComp: "50px"}), |
michael@0 | 27 | new AnimTestcaseFromBy("30", "10", { fromComp: "30px", |
michael@0 | 28 | midComp: "35px", |
michael@0 | 29 | toComp: "40px"}), |
michael@0 | 30 | ], |
michael@0 | 31 | lengthNoUnitsSVG: [ |
michael@0 | 32 | new AnimTestcaseFromBy("0", "50", { fromComp: "0", |
michael@0 | 33 | midComp: "25", |
michael@0 | 34 | toComp: "50"}), |
michael@0 | 35 | new AnimTestcaseFromBy("30", "10", { fromComp: "30", |
michael@0 | 36 | midComp: "35", |
michael@0 | 37 | toComp: "40"}), |
michael@0 | 38 | ], |
michael@0 | 39 | lengthPx: [ |
michael@0 | 40 | new AnimTestcaseFromBy("0px", "8px", { fromComp: "0px", |
michael@0 | 41 | midComp: "4px", |
michael@0 | 42 | toComp: "8px"}), |
michael@0 | 43 | new AnimTestcaseFromBy("1px", "10px", { midComp: "6px", toComp: "11px"}), |
michael@0 | 44 | ], |
michael@0 | 45 | opacity: [ |
michael@0 | 46 | new AnimTestcaseFromBy("1", "-1", { midComp: "0.5", toComp: "0"}), |
michael@0 | 47 | new AnimTestcaseFromBy("0.4", "-0.6", { midComp: "0.1", toComp: "0"}), |
michael@0 | 48 | new AnimTestcaseFromBy("0.8", "-1.4", { midComp: "0.1", toComp: "0"}, |
michael@0 | 49 | "opacities with abs val >1 get clamped too early"), |
michael@0 | 50 | new AnimTestcaseFromBy("1.2", "-0.6", { midComp: "0.9", toComp: "0.6"}, |
michael@0 | 51 | "opacities with abs val >1 get clamped too early"), |
michael@0 | 52 | ], |
michael@0 | 53 | paint: [ |
michael@0 | 54 | // The "none" keyword & URI values aren't addiditve, so the animations in |
michael@0 | 55 | // these testcases are expected to have no effect. |
michael@0 | 56 | new AnimTestcaseFromBy("none", "none", { noEffect: 1 }), |
michael@0 | 57 | new AnimTestcaseFromBy("url(#gradA)", "url(#gradB)", { noEffect: 1 }), |
michael@0 | 58 | new AnimTestcaseFromBy("url(#gradA)", "url(#gradB) red", { noEffect: 1 }), |
michael@0 | 59 | new AnimTestcaseFromBy("url(#gradA)", "none", { noEffect: 1 }), |
michael@0 | 60 | new AnimTestcaseFromBy("red", "url(#gradA)", { noEffect: 1 }), |
michael@0 | 61 | ], |
michael@0 | 62 | URIsAndNone: [ |
michael@0 | 63 | // No need to specify { noEffect: 1 }, since plain URI-valued properties |
michael@0 | 64 | // aren't additive |
michael@0 | 65 | new AnimTestcaseFromBy("url(#idA)", "url(#idB)"), |
michael@0 | 66 | new AnimTestcaseFromBy("none", "url(#idB)"), |
michael@0 | 67 | new AnimTestcaseFromBy("url(#idB)", "inherit"), |
michael@0 | 68 | ], |
michael@0 | 69 | }; |
michael@0 | 70 | |
michael@0 | 71 | // List of attribute/testcase-list bundles to be tested |
michael@0 | 72 | var gFromByBundles = |
michael@0 | 73 | [ |
michael@0 | 74 | new TestcaseBundle(gPropList.clip, [ |
michael@0 | 75 | new AnimTestcaseFromBy("rect(1px, 2px, 3px, 4px)", |
michael@0 | 76 | "rect(10px, 20px, 30px, 40px)", |
michael@0 | 77 | { midComp: "rect(6px, 12px, 18px, 24px)", |
michael@0 | 78 | toComp: "rect(11px, 22px, 33px, 44px)"}), |
michael@0 | 79 | // Adding "auto" (either as a standalone value or a subcomponent value) |
michael@0 | 80 | // should cause animation to fail. |
michael@0 | 81 | new AnimTestcaseFromBy("auto", "auto", { noEffect: 1 }), |
michael@0 | 82 | new AnimTestcaseFromBy("auto", |
michael@0 | 83 | "rect(auto, auto, auto, auto)", { noEffect: 1 }), |
michael@0 | 84 | new AnimTestcaseFromBy("rect(auto, auto, auto, auto)", |
michael@0 | 85 | "rect(auto, auto, auto, auto)", { noEffect: 1 }), |
michael@0 | 86 | new AnimTestcaseFromBy("rect(1px, 2px, 3px, 4px)", "auto", { noEffect: 1 }), |
michael@0 | 87 | new AnimTestcaseFromBy("auto", "rect(1px, 2px, 3px, 4px)", { noEffect: 1 }), |
michael@0 | 88 | new AnimTestcaseFromBy("rect(1px, 2px, 3px, auto)", |
michael@0 | 89 | "rect(10px, 20px, 30px, 40px)", { noEffect: 1 }), |
michael@0 | 90 | new AnimTestcaseFromBy("rect(1px, auto, 3px, 4px)", |
michael@0 | 91 | "rect(10px, auto, 30px, 40px)", { noEffect: 1 }), |
michael@0 | 92 | new AnimTestcaseFromBy("rect(1px, 2px, 3px, 4px)", |
michael@0 | 93 | "rect(10px, auto, 30px, 40px)", { noEffect: 1 }), |
michael@0 | 94 | ]), |
michael@0 | 95 | // Check that 'by' animations for 'cursor' has no effect |
michael@0 | 96 | new TestcaseBundle(gPropList.cursor, [ |
michael@0 | 97 | new AnimTestcaseFromBy("crosshair", "move"), |
michael@0 | 98 | ]), |
michael@0 | 99 | new TestcaseBundle(gPropList.fill, [].concat(_fromByTestLists.color, |
michael@0 | 100 | _fromByTestLists.paint)), |
michael@0 | 101 | // Check that 'by' animations involving URIs have no effect |
michael@0 | 102 | new TestcaseBundle(gPropList.filter, _fromByTestLists.URIsAndNone), |
michael@0 | 103 | new TestcaseBundle(gPropList.font, [ |
michael@0 | 104 | new AnimTestcaseFromBy("10px serif", |
michael@0 | 105 | "normal normal 400 100px / 10px monospace"), |
michael@0 | 106 | ]), |
michael@0 | 107 | new TestcaseBundle(gPropList.font_size, |
michael@0 | 108 | [].concat(_fromByTestLists.lengthNoUnits, |
michael@0 | 109 | _fromByTestLists.lengthPx)), |
michael@0 | 110 | new TestcaseBundle(gPropList.font_size_adjust, [ |
michael@0 | 111 | // These testcases implicitly have no effect, because font-size-adjust is |
michael@0 | 112 | // non-additive (and is declared as such in db_smilCSSPropertyList.js) |
michael@0 | 113 | new AnimTestcaseFromBy("0.5", "0.1"), |
michael@0 | 114 | new AnimTestcaseFromBy("none", "0.1"), |
michael@0 | 115 | new AnimTestcaseFromBy("0.1", "none") |
michael@0 | 116 | ]), |
michael@0 | 117 | new TestcaseBundle(gPropList.lighting_color, _fromByTestLists.color), |
michael@0 | 118 | new TestcaseBundle(gPropList.marker, _fromByTestLists.URIsAndNone), |
michael@0 | 119 | new TestcaseBundle(gPropList.marker_end, _fromByTestLists.URIsAndNone), |
michael@0 | 120 | new TestcaseBundle(gPropList.marker_mid, _fromByTestLists.URIsAndNone), |
michael@0 | 121 | new TestcaseBundle(gPropList.marker_start, _fromByTestLists.URIsAndNone), |
michael@0 | 122 | new TestcaseBundle(gPropList.overflow, [ |
michael@0 | 123 | new AnimTestcaseFromBy("inherit", "auto"), |
michael@0 | 124 | new AnimTestcaseFromBy("scroll", "hidden") |
michael@0 | 125 | ]), |
michael@0 | 126 | new TestcaseBundle(gPropList.opacity, _fromByTestLists.opacity), |
michael@0 | 127 | new TestcaseBundle(gPropList.stroke_miterlimit, [ |
michael@0 | 128 | new AnimTestcaseFromBy("1", "1", { midComp: "1.5", toComp: "2" }), |
michael@0 | 129 | new AnimTestcaseFromBy("20.1", "-10", { midComp: "15.1", toComp: "10.1" }), |
michael@0 | 130 | ]), |
michael@0 | 131 | new TestcaseBundle(gPropList.stroke_dasharray, [ |
michael@0 | 132 | // These testcases implicitly have no effect, because stroke-dasharray is |
michael@0 | 133 | // non-additive (and is declared as such in db_smilCSSPropertyList.js) |
michael@0 | 134 | new AnimTestcaseFromBy("none", "5"), |
michael@0 | 135 | new AnimTestcaseFromBy("10", "5"), |
michael@0 | 136 | new AnimTestcaseFromBy("1", "2, 3"), |
michael@0 | 137 | ]), |
michael@0 | 138 | new TestcaseBundle(gPropList.stroke_width, |
michael@0 | 139 | [].concat(_fromByTestLists.lengthNoUnitsSVG, |
michael@0 | 140 | _fromByTestLists.lengthPx)) |
michael@0 | 141 | ]; |