michael@0: /* -*- Mode: Java; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ michael@0: /* vim: set ts=2 sw=2 sts=2 et: */ michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: /* testcase data for simple "from-by" animations of CSS properties */ michael@0: michael@0: // NOTE: This js file requires db_smilCSSPropertyList.js michael@0: michael@0: // Lists of testcases for re-use across multiple properties of the same type michael@0: var _fromByTestLists = michael@0: { michael@0: color: [ michael@0: new AnimTestcaseFromBy("rgb(10, 20, 30)", "currentColor", michael@0: { midComp: "rgb(35, 45, 55)", michael@0: toComp: "rgb(60, 70, 80)"}), michael@0: new AnimTestcaseFromBy("currentColor", "rgb(30, 20, 10)", michael@0: { fromComp: "rgb(50, 50, 50)", michael@0: midComp: "rgb(65, 60, 55)", michael@0: toComp: "rgb(80, 70, 60)"}), michael@0: ], michael@0: lengthNoUnits: [ michael@0: new AnimTestcaseFromBy("0", "50", { fromComp: "0px", // 0 acts like 0px michael@0: midComp: "25px", michael@0: toComp: "50px"}), michael@0: new AnimTestcaseFromBy("30", "10", { fromComp: "30px", michael@0: midComp: "35px", michael@0: toComp: "40px"}), michael@0: ], michael@0: lengthNoUnitsSVG: [ michael@0: new AnimTestcaseFromBy("0", "50", { fromComp: "0", michael@0: midComp: "25", michael@0: toComp: "50"}), michael@0: new AnimTestcaseFromBy("30", "10", { fromComp: "30", michael@0: midComp: "35", michael@0: toComp: "40"}), michael@0: ], michael@0: lengthPx: [ michael@0: new AnimTestcaseFromBy("0px", "8px", { fromComp: "0px", michael@0: midComp: "4px", michael@0: toComp: "8px"}), michael@0: new AnimTestcaseFromBy("1px", "10px", { midComp: "6px", toComp: "11px"}), michael@0: ], michael@0: opacity: [ michael@0: new AnimTestcaseFromBy("1", "-1", { midComp: "0.5", toComp: "0"}), michael@0: new AnimTestcaseFromBy("0.4", "-0.6", { midComp: "0.1", toComp: "0"}), michael@0: new AnimTestcaseFromBy("0.8", "-1.4", { midComp: "0.1", toComp: "0"}, michael@0: "opacities with abs val >1 get clamped too early"), michael@0: new AnimTestcaseFromBy("1.2", "-0.6", { midComp: "0.9", toComp: "0.6"}, michael@0: "opacities with abs val >1 get clamped too early"), michael@0: ], michael@0: paint: [ michael@0: // The "none" keyword & URI values aren't addiditve, so the animations in michael@0: // these testcases are expected to have no effect. michael@0: new AnimTestcaseFromBy("none", "none", { noEffect: 1 }), michael@0: new AnimTestcaseFromBy("url(#gradA)", "url(#gradB)", { noEffect: 1 }), michael@0: new AnimTestcaseFromBy("url(#gradA)", "url(#gradB) red", { noEffect: 1 }), michael@0: new AnimTestcaseFromBy("url(#gradA)", "none", { noEffect: 1 }), michael@0: new AnimTestcaseFromBy("red", "url(#gradA)", { noEffect: 1 }), michael@0: ], michael@0: URIsAndNone: [ michael@0: // No need to specify { noEffect: 1 }, since plain URI-valued properties michael@0: // aren't additive michael@0: new AnimTestcaseFromBy("url(#idA)", "url(#idB)"), michael@0: new AnimTestcaseFromBy("none", "url(#idB)"), michael@0: new AnimTestcaseFromBy("url(#idB)", "inherit"), michael@0: ], michael@0: }; michael@0: michael@0: // List of attribute/testcase-list bundles to be tested michael@0: var gFromByBundles = michael@0: [ michael@0: new TestcaseBundle(gPropList.clip, [ michael@0: new AnimTestcaseFromBy("rect(1px, 2px, 3px, 4px)", michael@0: "rect(10px, 20px, 30px, 40px)", michael@0: { midComp: "rect(6px, 12px, 18px, 24px)", michael@0: toComp: "rect(11px, 22px, 33px, 44px)"}), michael@0: // Adding "auto" (either as a standalone value or a subcomponent value) michael@0: // should cause animation to fail. michael@0: new AnimTestcaseFromBy("auto", "auto", { noEffect: 1 }), michael@0: new AnimTestcaseFromBy("auto", michael@0: "rect(auto, auto, auto, auto)", { noEffect: 1 }), michael@0: new AnimTestcaseFromBy("rect(auto, auto, auto, auto)", michael@0: "rect(auto, auto, auto, auto)", { noEffect: 1 }), michael@0: new AnimTestcaseFromBy("rect(1px, 2px, 3px, 4px)", "auto", { noEffect: 1 }), michael@0: new AnimTestcaseFromBy("auto", "rect(1px, 2px, 3px, 4px)", { noEffect: 1 }), michael@0: new AnimTestcaseFromBy("rect(1px, 2px, 3px, auto)", michael@0: "rect(10px, 20px, 30px, 40px)", { noEffect: 1 }), michael@0: new AnimTestcaseFromBy("rect(1px, auto, 3px, 4px)", michael@0: "rect(10px, auto, 30px, 40px)", { noEffect: 1 }), michael@0: new AnimTestcaseFromBy("rect(1px, 2px, 3px, 4px)", michael@0: "rect(10px, auto, 30px, 40px)", { noEffect: 1 }), michael@0: ]), michael@0: // Check that 'by' animations for 'cursor' has no effect michael@0: new TestcaseBundle(gPropList.cursor, [ michael@0: new AnimTestcaseFromBy("crosshair", "move"), michael@0: ]), michael@0: new TestcaseBundle(gPropList.fill, [].concat(_fromByTestLists.color, michael@0: _fromByTestLists.paint)), michael@0: // Check that 'by' animations involving URIs have no effect michael@0: new TestcaseBundle(gPropList.filter, _fromByTestLists.URIsAndNone), michael@0: new TestcaseBundle(gPropList.font, [ michael@0: new AnimTestcaseFromBy("10px serif", michael@0: "normal normal 400 100px / 10px monospace"), michael@0: ]), michael@0: new TestcaseBundle(gPropList.font_size, michael@0: [].concat(_fromByTestLists.lengthNoUnits, michael@0: _fromByTestLists.lengthPx)), michael@0: new TestcaseBundle(gPropList.font_size_adjust, [ michael@0: // These testcases implicitly have no effect, because font-size-adjust is michael@0: // non-additive (and is declared as such in db_smilCSSPropertyList.js) michael@0: new AnimTestcaseFromBy("0.5", "0.1"), michael@0: new AnimTestcaseFromBy("none", "0.1"), michael@0: new AnimTestcaseFromBy("0.1", "none") michael@0: ]), michael@0: new TestcaseBundle(gPropList.lighting_color, _fromByTestLists.color), michael@0: new TestcaseBundle(gPropList.marker, _fromByTestLists.URIsAndNone), michael@0: new TestcaseBundle(gPropList.marker_end, _fromByTestLists.URIsAndNone), michael@0: new TestcaseBundle(gPropList.marker_mid, _fromByTestLists.URIsAndNone), michael@0: new TestcaseBundle(gPropList.marker_start, _fromByTestLists.URIsAndNone), michael@0: new TestcaseBundle(gPropList.overflow, [ michael@0: new AnimTestcaseFromBy("inherit", "auto"), michael@0: new AnimTestcaseFromBy("scroll", "hidden") michael@0: ]), michael@0: new TestcaseBundle(gPropList.opacity, _fromByTestLists.opacity), michael@0: new TestcaseBundle(gPropList.stroke_miterlimit, [ michael@0: new AnimTestcaseFromBy("1", "1", { midComp: "1.5", toComp: "2" }), michael@0: new AnimTestcaseFromBy("20.1", "-10", { midComp: "15.1", toComp: "10.1" }), michael@0: ]), michael@0: new TestcaseBundle(gPropList.stroke_dasharray, [ michael@0: // These testcases implicitly have no effect, because stroke-dasharray is michael@0: // non-additive (and is declared as such in db_smilCSSPropertyList.js) michael@0: new AnimTestcaseFromBy("none", "5"), michael@0: new AnimTestcaseFromBy("10", "5"), michael@0: new AnimTestcaseFromBy("1", "2, 3"), michael@0: ]), michael@0: new TestcaseBundle(gPropList.stroke_width, michael@0: [].concat(_fromByTestLists.lengthNoUnitsSVG, michael@0: _fromByTestLists.lengthPx)) michael@0: ];