From 26a029d407be480d791972afb5975cf62c9360a6 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 02:47:55 +0200 Subject: Adding upstream version 124.0.1. Signed-off-by: Daniel Baumann --- dom/smil/test/db_smilAnimateMotion.js | 309 ++++++ dom/smil/test/db_smilCSSFromBy.js | 207 ++++ dom/smil/test/db_smilCSSFromTo.js | 625 ++++++++++++ dom/smil/test/db_smilCSSPaced.js | 356 +++++++ dom/smil/test/db_smilCSSPropertyList.js | 104 ++ dom/smil/test/db_smilMappedAttrList.js | 148 +++ dom/smil/test/file_smilWithTransition.html | 79 ++ dom/smil/test/mochitest.toml | 109 +++ dom/smil/test/smilAnimateMotionValueLists.js | 116 +++ dom/smil/test/smilExtDoc_helper.svg | 7 + dom/smil/test/smilTestUtils.js | 1015 ++++++++++++++++++++ dom/smil/test/smilXHR_helper.svg | 8 + dom/smil/test/test_smilAccessKey.xhtml | 79 ++ dom/smil/test/test_smilAdditionFallback.html | 30 + dom/smil/test/test_smilAnimateMotion.xhtml | 51 + .../test/test_smilAnimateMotionInvalidValues.xhtml | 176 ++++ .../test/test_smilAnimateMotionOverrideRules.xhtml | 215 +++++ dom/smil/test/test_smilBackwardsSeeking.xhtml | 191 ++++ .../test/test_smilCSSFontStretchRelative.xhtml | 102 ++ dom/smil/test/test_smilCSSFromBy.xhtml | 49 + dom/smil/test/test_smilCSSFromTo.xhtml | 76 ++ dom/smil/test/test_smilCSSInherit.xhtml | 85 ++ dom/smil/test/test_smilCSSInvalidValues.xhtml | 59 ++ dom/smil/test/test_smilCSSPaced.xhtml | 44 + dom/smil/test/test_smilChangeAfterFrozen.xhtml | 571 +++++++++++ dom/smil/test/test_smilConditionalProcessing.html | 93 ++ dom/smil/test/test_smilContainerBinding.xhtml | 101 ++ dom/smil/test/test_smilCrossContainer.xhtml | 132 +++ .../test/test_smilDynamicDelayedBeginElement.xhtml | 103 ++ dom/smil/test/test_smilExtDoc.xhtml | 80 ++ dom/smil/test/test_smilFillMode.xhtml | 86 ++ dom/smil/test/test_smilGetSimpleDuration.xhtml | 84 ++ dom/smil/test/test_smilGetStartTime.xhtml | 103 ++ dom/smil/test/test_smilHyperlinking.xhtml | 229 +++++ dom/smil/test/test_smilInvalidValues.html | 122 +++ dom/smil/test/test_smilKeySplines.xhtml | 296 ++++++ dom/smil/test/test_smilKeyTimes.xhtml | 391 ++++++++ dom/smil/test/test_smilKeyTimesPacedMode.xhtml | 123 +++ dom/smil/test/test_smilMappedAttrFromBy.xhtml | 51 + dom/smil/test/test_smilMappedAttrFromTo.xhtml | 79 ++ dom/smil/test/test_smilMappedAttrPaced.xhtml | 46 + dom/smil/test/test_smilMinTiming.html | 93 ++ dom/smil/test/test_smilRepeatDuration.html | 139 +++ dom/smil/test/test_smilRepeatTiming.xhtml | 96 ++ dom/smil/test/test_smilReset.xhtml | 82 ++ dom/smil/test/test_smilRestart.xhtml | 102 ++ dom/smil/test/test_smilSetCurrentTime.xhtml | 76 ++ dom/smil/test/test_smilSync.xhtml | 255 +++++ dom/smil/test/test_smilSyncTransform.xhtml | 66 ++ dom/smil/test/test_smilSyncbaseTarget.xhtml | 180 ++++ dom/smil/test/test_smilTextZoom.xhtml | 99 ++ dom/smil/test/test_smilTiming.xhtml | 291 ++++++ dom/smil/test/test_smilTimingZeroIntervals.xhtml | 285 ++++++ dom/smil/test/test_smilUpdatedInterval.xhtml | 64 ++ dom/smil/test/test_smilValues.xhtml | 171 ++++ dom/smil/test/test_smilWithTransition.html | 14 + dom/smil/test/test_smilWithXlink.xhtml | 47 + dom/smil/test/test_smilXHR.xhtml | 88 ++ 58 files changed, 9078 insertions(+) create mode 100644 dom/smil/test/db_smilAnimateMotion.js create mode 100644 dom/smil/test/db_smilCSSFromBy.js create mode 100644 dom/smil/test/db_smilCSSFromTo.js create mode 100644 dom/smil/test/db_smilCSSPaced.js create mode 100644 dom/smil/test/db_smilCSSPropertyList.js create mode 100644 dom/smil/test/db_smilMappedAttrList.js create mode 100644 dom/smil/test/file_smilWithTransition.html create mode 100644 dom/smil/test/mochitest.toml create mode 100644 dom/smil/test/smilAnimateMotionValueLists.js create mode 100644 dom/smil/test/smilExtDoc_helper.svg create mode 100644 dom/smil/test/smilTestUtils.js create mode 100644 dom/smil/test/smilXHR_helper.svg create mode 100644 dom/smil/test/test_smilAccessKey.xhtml create mode 100644 dom/smil/test/test_smilAdditionFallback.html create mode 100644 dom/smil/test/test_smilAnimateMotion.xhtml create mode 100644 dom/smil/test/test_smilAnimateMotionInvalidValues.xhtml create mode 100644 dom/smil/test/test_smilAnimateMotionOverrideRules.xhtml create mode 100644 dom/smil/test/test_smilBackwardsSeeking.xhtml create mode 100644 dom/smil/test/test_smilCSSFontStretchRelative.xhtml create mode 100644 dom/smil/test/test_smilCSSFromBy.xhtml create mode 100644 dom/smil/test/test_smilCSSFromTo.xhtml create mode 100644 dom/smil/test/test_smilCSSInherit.xhtml create mode 100644 dom/smil/test/test_smilCSSInvalidValues.xhtml create mode 100644 dom/smil/test/test_smilCSSPaced.xhtml create mode 100644 dom/smil/test/test_smilChangeAfterFrozen.xhtml create mode 100644 dom/smil/test/test_smilConditionalProcessing.html create mode 100644 dom/smil/test/test_smilContainerBinding.xhtml create mode 100644 dom/smil/test/test_smilCrossContainer.xhtml create mode 100644 dom/smil/test/test_smilDynamicDelayedBeginElement.xhtml create mode 100644 dom/smil/test/test_smilExtDoc.xhtml create mode 100644 dom/smil/test/test_smilFillMode.xhtml create mode 100644 dom/smil/test/test_smilGetSimpleDuration.xhtml create mode 100644 dom/smil/test/test_smilGetStartTime.xhtml create mode 100644 dom/smil/test/test_smilHyperlinking.xhtml create mode 100644 dom/smil/test/test_smilInvalidValues.html create mode 100644 dom/smil/test/test_smilKeySplines.xhtml create mode 100644 dom/smil/test/test_smilKeyTimes.xhtml create mode 100644 dom/smil/test/test_smilKeyTimesPacedMode.xhtml create mode 100644 dom/smil/test/test_smilMappedAttrFromBy.xhtml create mode 100644 dom/smil/test/test_smilMappedAttrFromTo.xhtml create mode 100644 dom/smil/test/test_smilMappedAttrPaced.xhtml create mode 100644 dom/smil/test/test_smilMinTiming.html create mode 100644 dom/smil/test/test_smilRepeatDuration.html create mode 100644 dom/smil/test/test_smilRepeatTiming.xhtml create mode 100644 dom/smil/test/test_smilReset.xhtml create mode 100644 dom/smil/test/test_smilRestart.xhtml create mode 100644 dom/smil/test/test_smilSetCurrentTime.xhtml create mode 100644 dom/smil/test/test_smilSync.xhtml create mode 100644 dom/smil/test/test_smilSyncTransform.xhtml create mode 100644 dom/smil/test/test_smilSyncbaseTarget.xhtml create mode 100644 dom/smil/test/test_smilTextZoom.xhtml create mode 100644 dom/smil/test/test_smilTiming.xhtml create mode 100644 dom/smil/test/test_smilTimingZeroIntervals.xhtml create mode 100644 dom/smil/test/test_smilUpdatedInterval.xhtml create mode 100644 dom/smil/test/test_smilValues.xhtml create mode 100644 dom/smil/test/test_smilWithTransition.html create mode 100644 dom/smil/test/test_smilWithXlink.xhtml create mode 100644 dom/smil/test/test_smilXHR.xhtml (limited to 'dom/smil/test') diff --git a/dom/smil/test/db_smilAnimateMotion.js b/dom/smil/test/db_smilAnimateMotion.js new file mode 100644 index 0000000000..31c338586f --- /dev/null +++ b/dom/smil/test/db_smilAnimateMotion.js @@ -0,0 +1,309 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 sw=2 sts=2 et: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* testcase data for */ + +// Fake motion 'attribute', to satisfy testing code that expects an attribute. +var gMotionAttr = new AdditiveAttribute( + SMILUtil.getMotionFakeAttributeName(), + "XML", + "rect" +); + +// CTM-summary-definitions, for re-use by multiple testcase bundles below. +var _reusedCTMLists = { + pacedBasic: { + ctm0: [100, 200, 0], + ctm1_6: [105, 205, 0], + ctm1_3: [110, 210, 0], + ctm2_3: [120, 220, 0], + ctm1: [130, 210, 0], + }, + pacedR60: { + ctm0: [100, 200, Math.PI / 3], + ctm1_6: [105, 205, Math.PI / 3], + ctm1_3: [110, 210, Math.PI / 3], + ctm2_3: [120, 220, Math.PI / 3], + ctm1: [130, 210, Math.PI / 3], + }, + pacedRAuto: { + ctm0: [100, 200, Math.PI / 4], + ctm1_6: [105, 205, Math.PI / 4], + ctm1_3: [110, 210, Math.PI / 4], + ctm2_3: [120, 220, -Math.PI / 4], + ctm1: [130, 210, -Math.PI / 4], + }, + pacedRAutoReverse: { + ctm0: [100, 200, (5 * Math.PI) / 4], + ctm1_6: [105, 205, (5 * Math.PI) / 4], + ctm1_3: [110, 210, (5 * Math.PI) / 4], + ctm2_3: [120, 220, (3 * Math.PI) / 4], + ctm1: [130, 210, (3 * Math.PI) / 4], + }, + + discreteBasic: { + ctm0: [100, 200, 0], + ctm1_6: [100, 200, 0], + ctm1_3: [120, 220, 0], + ctm2_3: [130, 210, 0], + ctm1: [130, 210, 0], + }, + discreteRAuto: { + ctm0: [100, 200, Math.PI / 4], + ctm1_6: [100, 200, Math.PI / 4], + ctm1_3: [120, 220, -Math.PI / 4], + ctm2_3: [130, 210, -Math.PI / 4], + ctm1: [130, 210, -Math.PI / 4], + }, + justMoveBasic: { + ctm0: [40, 80, 0], + ctm1_6: [40, 80, 0], + ctm1_3: [40, 80, 0], + ctm2_3: [40, 80, 0], + ctm1: [40, 80, 0], + }, + justMoveR60: { + ctm0: [40, 80, Math.PI / 3], + ctm1_6: [40, 80, Math.PI / 3], + ctm1_3: [40, 80, Math.PI / 3], + ctm2_3: [40, 80, Math.PI / 3], + ctm1: [40, 80, Math.PI / 3], + }, + justMoveRAuto: { + ctm0: [40, 80, Math.atan(2)], + ctm1_6: [40, 80, Math.atan(2)], + ctm1_3: [40, 80, Math.atan(2)], + ctm2_3: [40, 80, Math.atan(2)], + ctm1: [40, 80, Math.atan(2)], + }, + justMoveRAutoReverse: { + ctm0: [40, 80, Math.PI + Math.atan(2)], + ctm1_6: [40, 80, Math.PI + Math.atan(2)], + ctm1_3: [40, 80, Math.PI + Math.atan(2)], + ctm2_3: [40, 80, Math.PI + Math.atan(2)], + ctm1: [40, 80, Math.PI + Math.atan(2)], + }, + nullMoveBasic: { + ctm0: [0, 0, 0], + ctm1_6: [0, 0, 0], + ctm1_3: [0, 0, 0], + ctm2_3: [0, 0, 0], + ctm1: [0, 0, 0], + }, + nullMoveRAutoReverse: { + ctm0: [0, 0, Math.PI], + ctm1_6: [0, 0, Math.PI], + ctm1_3: [0, 0, Math.PI], + ctm2_3: [0, 0, Math.PI], + ctm1: [0, 0, Math.PI], + }, +}; + +var gMotionBundles = [ + // Bundle to test basic functionality (using default calcMode='paced') + new TestcaseBundle(gMotionAttr, [ + // Basic paced-mode (default) test, with values/mpath/path + new AnimMotionTestcase( + { values: "100, 200; 120, 220; 130, 210" }, + _reusedCTMLists.pacedBasic + ), + new AnimMotionTestcase( + { path: "M100 200 L120 220 L130 210" }, + _reusedCTMLists.pacedBasic + ), + new AnimMotionTestcase( + { mpath: "M100 200 L120 220 L130 210" }, + _reusedCTMLists.pacedBasic + ), + + // ..and now with rotate=constant value in degrees + new AnimMotionTestcase( + { values: "100,200; 120,220; 130, 210", rotate: "60" }, + _reusedCTMLists.pacedR60 + ), + new AnimMotionTestcase( + { path: "M100 200 L120 220 L130 210", rotate: "60" }, + _reusedCTMLists.pacedR60 + ), + new AnimMotionTestcase( + { mpath: "M100 200 L120 220 L130 210", rotate: "60" }, + _reusedCTMLists.pacedR60 + ), + + // ..and now with rotate=constant value in radians + new AnimMotionTestcase( + { path: "M100 200 L120 220 L130 210", rotate: "1.0471975512rad" }, // pi/3 + _reusedCTMLists.pacedR60 + ), + + // ..and now with rotate=auto + new AnimMotionTestcase( + { values: "100,200; 120,220; 130, 210", rotate: "auto" }, + _reusedCTMLists.pacedRAuto + ), + new AnimMotionTestcase( + { path: "M100 200 L120 220 L130 210", rotate: "auto" }, + _reusedCTMLists.pacedRAuto + ), + new AnimMotionTestcase( + { mpath: "M100 200 L120 220 L130 210", rotate: "auto" }, + _reusedCTMLists.pacedRAuto + ), + + // ..and now with rotate=auto-reverse + new AnimMotionTestcase( + { values: "100,200; 120,220; 130, 210", rotate: "auto-reverse" }, + _reusedCTMLists.pacedRAutoReverse + ), + new AnimMotionTestcase( + { path: "M100 200 L120 220 L130 210", rotate: "auto-reverse" }, + _reusedCTMLists.pacedRAutoReverse + ), + new AnimMotionTestcase( + { mpath: "M100 200 L120 220 L130 210", rotate: "auto-reverse" }, + _reusedCTMLists.pacedRAutoReverse + ), + ]), + + // Bundle to test calcMode='discrete' + new TestcaseBundle(gMotionAttr, [ + new AnimMotionTestcase( + { values: "100, 200; 120, 220; 130, 210", calcMode: "discrete" }, + _reusedCTMLists.discreteBasic + ), + new AnimMotionTestcase( + { path: "M100 200 L120 220 L130 210", calcMode: "discrete" }, + _reusedCTMLists.discreteBasic + ), + new AnimMotionTestcase( + { mpath: "M100 200 L120 220 L130 210", calcMode: "discrete" }, + _reusedCTMLists.discreteBasic + ), + // ..and now with rotate=auto + new AnimMotionTestcase( + { + values: "100, 200; 120, 220; 130, 210", + calcMode: "discrete", + rotate: "auto", + }, + _reusedCTMLists.discreteRAuto + ), + new AnimMotionTestcase( + { + path: "M100 200 L120 220 L130 210", + calcMode: "discrete", + rotate: "auto", + }, + _reusedCTMLists.discreteRAuto + ), + new AnimMotionTestcase( + { + mpath: "M100 200 L120 220 L130 210", + calcMode: "discrete", + rotate: "auto", + }, + _reusedCTMLists.discreteRAuto + ), + ]), + + // Bundle to test relative units ('em') + new TestcaseBundle(gMotionAttr, [ + // First with unitless values from->by... + new AnimMotionTestcase( + { from: "10, 10", by: "30, 60" }, + { + ctm0: [10, 10, 0], + ctm1_6: [15, 20, 0], + ctm1_3: [20, 30, 0], + ctm2_3: [30, 50, 0], + ctm1: [40, 70, 0], + } + ), + // ... then add 'em' units (with 1em=10px) on half the values + new AnimMotionTestcase( + { from: "1em, 10", by: "30, 6em" }, + { + ctm0: [10, 10, 0], + ctm1_6: [15, 20, 0], + ctm1_3: [20, 30, 0], + ctm2_3: [30, 50, 0], + ctm1: [40, 70, 0], + } + ), + ]), + + // Bundle to test a path with just a "move" command and nothing else + new TestcaseBundle(gMotionAttr, [ + new AnimMotionTestcase({ values: "40, 80" }, _reusedCTMLists.justMoveBasic), + new AnimMotionTestcase({ path: "M40 80" }, _reusedCTMLists.justMoveBasic), + new AnimMotionTestcase({ mpath: "m40 80" }, _reusedCTMLists.justMoveBasic), + ]), + // ... and now with a fixed rotate-angle + new TestcaseBundle(gMotionAttr, [ + new AnimMotionTestcase( + { values: "40, 80", rotate: "60" }, + _reusedCTMLists.justMoveR60 + ), + new AnimMotionTestcase( + { path: "M40 80", rotate: "60" }, + _reusedCTMLists.justMoveR60 + ), + new AnimMotionTestcase( + { mpath: "m40 80", rotate: "60" }, + _reusedCTMLists.justMoveR60 + ), + ]), + // ... and now with 'auto' (should use the move itself as + // our tangent angle, I think) + new TestcaseBundle(gMotionAttr, [ + new AnimMotionTestcase( + { values: "40, 80", rotate: "auto" }, + _reusedCTMLists.justMoveRAuto + ), + new AnimMotionTestcase( + { path: "M40 80", rotate: "auto" }, + _reusedCTMLists.justMoveRAuto + ), + new AnimMotionTestcase( + { mpath: "m40 80", rotate: "auto" }, + _reusedCTMLists.justMoveRAuto + ), + ]), + // ... and now with 'auto-reverse' + new TestcaseBundle(gMotionAttr, [ + new AnimMotionTestcase( + { values: "40, 80", rotate: "auto-reverse" }, + _reusedCTMLists.justMoveRAutoReverse + ), + new AnimMotionTestcase( + { path: "M40 80", rotate: "auto-reverse" }, + _reusedCTMLists.justMoveRAutoReverse + ), + new AnimMotionTestcase( + { mpath: "m40 80", rotate: "auto-reverse" }, + _reusedCTMLists.justMoveRAutoReverse + ), + ]), + // ... and now with a null move to make sure 'auto'/'auto-reverse' don't + // blow up + new TestcaseBundle(gMotionAttr, [ + new AnimMotionTestcase( + { values: "0, 0", rotate: "auto" }, + _reusedCTMLists.nullMoveBasic + ), + ]), + new TestcaseBundle(gMotionAttr, [ + new AnimMotionTestcase( + { values: "0, 0", rotate: "auto-reverse" }, + _reusedCTMLists.nullMoveRAutoReverse + ), + ]), +]; + +// XXXdholbert Add more tests: +// - keyPoints/keyTimes +// - paths with curves +// - Control path with from/by/to diff --git a/dom/smil/test/db_smilCSSFromBy.js b/dom/smil/test/db_smilCSSFromBy.js new file mode 100644 index 0000000000..737037271d --- /dev/null +++ b/dom/smil/test/db_smilCSSFromBy.js @@ -0,0 +1,207 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 sw=2 sts=2 et: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* testcase data for simple "from-by" animations of CSS properties */ + +// NOTE: This js file requires db_smilCSSPropertyList.js + +// Lists of testcases for re-use across multiple properties of the same type +var _fromByTestLists = { + color: [ + new AnimTestcaseFromBy("rgb(10, 20, 30)", "currentColor", { + midComp: "rgb(35, 45, 55)", + toComp: "rgb(60, 70, 80)", + }), + new AnimTestcaseFromBy("currentColor", "rgb(30, 20, 10)", { + fromComp: "rgb(50, 50, 50)", + midComp: "rgb(65, 60, 55)", + toComp: "rgb(80, 70, 60)", + }), + new AnimTestcaseFromBy( + "rgba(10, 20, 30, 0.2)", + "rgba(50, 50, 50, 1)", + // (rgb(10, 20, 30) * 0.2 * 0.5 + rgb(52, 54, 56) * 1.0 * 0.5) * (1 / 0.6) + { + midComp: "rgba(45, 48, 52, 0.6)", + // (rgb(10, 20, 30) * 0.2 + rgb(50, 50, 50) * 1) / 1.0 + toComp: "rgb(52, 54, 56)", + } + ), + + // The "from" and "by" values in the test case below overflow the maxium + // color-channel values when added together. + // (e.g. for red [ignoring alpha for now], 100 + 240 = 340 which is > 255) + // + // The SVG Animation spec says we should clamp color values "as late as + // possible" i.e. allow the channel overflow and clamp at paint-time. + // + // That gives us: + // + // to-value = (rgb(100, 100, 100) * 0.6 + rgb(240, 240, 240) * 1.0)) * 1 + // = rgb(300, 300, 300) + // midComp = (rgb(100, 100, 100) * 0.6 * 0.5 + rgb(300, 300, 300) * 1.0 * 0.5) * (1 / 0.8) + // = rgb(225, 225, 225) + // + // + new AnimTestcaseFromBy( + "rgba(100, 100, 100, 0.6)", + "rgba(240, 240, 240, 1)", + { midComp: "rgba(225, 225, 225, 0.8)", toComp: "rgb(255, 255, 255)" } + ), + ], + lengthNoUnits: [ + new AnimTestcaseFromBy("0", "50", { + fromComp: "0px", // 0 acts like 0px + midComp: "25px", + toComp: "50px", + }), + new AnimTestcaseFromBy("30", "10", { + fromComp: "30px", + midComp: "35px", + toComp: "40px", + }), + ], + lengthPx: [ + new AnimTestcaseFromBy("0px", "8px", { + fromComp: "0px", + midComp: "4px", + toComp: "8px", + }), + new AnimTestcaseFromBy("1px", "10px", { + fromComp: "1px", + midComp: "6px", + toComp: "11px", + }), + ], + opacity: [ + new AnimTestcaseFromBy("1", "-1", { midComp: "0.5", toComp: "0" }), + new AnimTestcaseFromBy("0.4", "-0.6", { midComp: "0.1", toComp: "0" }), + new AnimTestcaseFromBy( + "0.8", + "-1.4", + { midComp: "0.1", toComp: "0" }, + "opacities with abs val >1 get clamped too early" + ), + new AnimTestcaseFromBy( + "1.2", + "-0.6", + { midComp: "0.9", toComp: "0.6" }, + "opacities with abs val >1 get clamped too early" + ), + ], + paint: [ + // The "none" keyword & URI values aren't addiditve, so the animations in + // these testcases are expected to have no effect. + new AnimTestcaseFromBy("none", "none", { noEffect: 1 }), + new AnimTestcaseFromBy("url(#gradA)", "url(#gradB)", { noEffect: 1 }), + new AnimTestcaseFromBy("url(#gradA)", "url(#gradB) red", { noEffect: 1 }), + new AnimTestcaseFromBy("url(#gradA)", "none", { noEffect: 1 }), + new AnimTestcaseFromBy("red", "url(#gradA)", { noEffect: 1 }), + ], + URIsAndNone: [ + // No need to specify { noEffect: 1 }, since plain URI-valued properties + // aren't additive + new AnimTestcaseFromBy("url(#idA)", "url(#idB)"), + new AnimTestcaseFromBy("none", "url(#idB)"), + new AnimTestcaseFromBy("url(#idB)", "inherit"), + ], +}; + +// List of attribute/testcase-list bundles to be tested +var gFromByBundles = [ + new TestcaseBundle(gPropList.clip, [ + new AnimTestcaseFromBy( + "rect(1px, 2px, 3px, 4px)", + "rect(10px, 20px, 30px, 40px)", + { + midComp: "rect(6px, 12px, 18px, 24px)", + toComp: "rect(11px, 22px, 33px, 44px)", + } + ), + // Adding "auto" (either as a standalone value or a subcomponent value) + // should cause animation to fail. + new AnimTestcaseFromBy("auto", "auto", { noEffect: 1 }), + new AnimTestcaseFromBy("auto", "rect(auto, auto, auto, auto)", { + noEffect: 1, + }), + new AnimTestcaseFromBy( + "rect(auto, auto, auto, auto)", + "rect(auto, auto, auto, auto)", + { noEffect: 1 } + ), + new AnimTestcaseFromBy("rect(1px, 2px, 3px, 4px)", "auto", { noEffect: 1 }), + new AnimTestcaseFromBy("auto", "rect(1px, 2px, 3px, 4px)", { noEffect: 1 }), + new AnimTestcaseFromBy( + "rect(1px, 2px, 3px, auto)", + "rect(10px, 20px, 30px, 40px)", + { noEffect: 1 } + ), + new AnimTestcaseFromBy( + "rect(1px, auto, 3px, 4px)", + "rect(10px, auto, 30px, 40px)", + { noEffect: 1 } + ), + new AnimTestcaseFromBy( + "rect(1px, 2px, 3px, 4px)", + "rect(10px, auto, 30px, 40px)", + { noEffect: 1 } + ), + ]), + // Check that 'by' animations for 'cursor' has no effect + new TestcaseBundle(gPropList.cursor, [ + new AnimTestcaseFromBy("crosshair", "move"), + ]), + new TestcaseBundle( + gPropList.fill, + [].concat(_fromByTestLists.color, _fromByTestLists.paint) + ), + // Check that 'by' animations involving URIs have no effect + new TestcaseBundle(gPropList.filter, _fromByTestLists.URIsAndNone), + new TestcaseBundle(gPropList.font, [ + new AnimTestcaseFromBy( + "10px serif", + "normal normal 400 100px / 10px monospace" + ), + ]), + new TestcaseBundle( + gPropList.font_size, + [].concat(_fromByTestLists.lengthNoUnits, _fromByTestLists.lengthPx) + ), + new TestcaseBundle(gPropList.font_size_adjust, [ + // These testcases implicitly have no effect, because font-size-adjust is + // non-additive (and is declared as such in db_smilCSSPropertyList.js) + new AnimTestcaseFromBy("0.5", "0.1"), + new AnimTestcaseFromBy("none", "0.1"), + new AnimTestcaseFromBy("0.1", "none"), + ]), + // Bug 1457353: Change from nsColor to StyleComplexColor causes addition + // with currentcolor to break. Bug 1465307 for work to re-enable. + new TestcaseBundle(gPropList.lighting_color, _fromByTestLists.color), + new TestcaseBundle(gPropList.marker, _fromByTestLists.URIsAndNone), + new TestcaseBundle(gPropList.marker_end, _fromByTestLists.URIsAndNone), + new TestcaseBundle(gPropList.marker_mid, _fromByTestLists.URIsAndNone), + new TestcaseBundle(gPropList.marker_start, _fromByTestLists.URIsAndNone), + new TestcaseBundle(gPropList.overflow, [ + new AnimTestcaseFromBy("inherit", "auto"), + new AnimTestcaseFromBy("scroll", "hidden"), + ]), + new TestcaseBundle(gPropList.opacity, _fromByTestLists.opacity), + new TestcaseBundle(gPropList.stroke_miterlimit, [ + new AnimTestcaseFromBy("1", "1", { midComp: "1.5", toComp: "2" }), + new AnimTestcaseFromBy("20.1", "-10", { midComp: "15.1", toComp: "10.1" }), + ]), + new TestcaseBundle(gPropList.stroke_dasharray, [ + // These testcases implicitly have no effect, because stroke-dasharray is + // non-additive (and is declared as such in db_smilCSSPropertyList.js) + new AnimTestcaseFromBy("none", "5"), + new AnimTestcaseFromBy("10", "5"), + new AnimTestcaseFromBy("1", "2, 3"), + ]), + new TestcaseBundle( + gPropList.stroke_width, + [].concat(_fromByTestLists.lengthNoUnits, _fromByTestLists.lengthPx) + ), +]; diff --git a/dom/smil/test/db_smilCSSFromTo.js b/dom/smil/test/db_smilCSSFromTo.js new file mode 100644 index 0000000000..a644c96962 --- /dev/null +++ b/dom/smil/test/db_smilCSSFromTo.js @@ -0,0 +1,625 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 sw=2 sts=2 et: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* testcase data for simple "from-to" animations of CSS properties */ + +// NOTE: This js file requires db_smilCSSPropertyList.js + +// NOTE: I'm Including 'inherit' and 'currentColor' as interpolatable values. +// According to SVG Mobile 1.2 section 16.2.9, "keywords such as inherit which +// yield a numeric computed value may be included in the values list for an +// interpolated animation". + +// Path of test URL (stripping off final slash + filename), for use in +// generating computed value of 'cursor' property +var _testPath = document.URL.substring(0, document.URL.lastIndexOf("/")); + +// Lists of testcases for re-use across multiple properties of the same type +var _fromToTestLists = { + color: [ + new AnimTestcaseFromTo("rgb(100, 100, 100)", "rgb(200, 200, 200)", { + midComp: "rgb(150, 150, 150)", + }), + new AnimTestcaseFromTo("#F02000", "#0080A0", { + fromComp: "rgb(240, 32, 0)", + midComp: "rgb(120, 80, 80)", + toComp: "rgb(0, 128, 160)", + }), + new AnimTestcaseFromTo("crimson", "lawngreen", { + fromComp: "rgb(220, 20, 60)", + midComp: "rgb(172, 136, 30)", + toComp: "rgb(124, 252, 0)", + }), + new AnimTestcaseFromTo("currentColor", "rgb(100, 100, 100)", { + fromComp: "rgb(50, 50, 50)", + midComp: "rgb(75, 75, 75)", + }), + new AnimTestcaseFromTo( + "rgba(10, 20, 30, 0.2)", + "rgba(50, 50, 50, 1)", + // (rgb(10, 20, 30) * 0.2 * 0.5 + rgb(50, 50, 50) * 1.0 * 0.5) * (1 / 0.6) + { midComp: "rgba(43, 45, 47, 0.6)", toComp: "rgb(50, 50, 50)" } + ), + ], + colorFromInheritBlack: [ + new AnimTestcaseFromTo("inherit", "rgb(200, 200, 200)", { + fromComp: "rgb(0, 0, 0)", + midComp: "rgb(100, 100, 100)", + }), + ], + colorFromInheritWhite: [ + new AnimTestcaseFromTo("inherit", "rgb(205, 205, 205)", { + fromComp: "rgb(255, 255, 255)", + midComp: "rgb(230, 230, 230)", + }), + ], + paintServer: [ + new AnimTestcaseFromTo("none", "none"), + new AnimTestcaseFromTo("none", "blue", { toComp: "rgb(0, 0, 255)" }), + new AnimTestcaseFromTo("rgb(50, 50, 50)", "none"), + new AnimTestcaseFromTo( + "url(#gradA)", + "url(#gradB) currentColor", + { + fromComp: 'url("' + document.URL + '#gradA") rgb(0, 0, 0)', + toComp: 'url("' + document.URL + '#gradB") rgb(50, 50, 50)', + }, + "need support for URI-based paints" + ), + new AnimTestcaseFromTo( + "url(#gradA) orange", + "url(#gradB)", + { + fromComp: 'url("' + document.URL + '#gradA") rgb(255, 165, 0)', + toComp: 'url("' + document.URL + '#gradB") rgb(0, 0, 0)', + }, + "need support for URI-based paints" + ), + new AnimTestcaseFromTo( + "url(#no_grad)", + "url(#gradB)", + { + fromComp: 'url("' + document.URL + '#no_grad") ' + "rgb(0, 0, 0)", + toComp: 'url("' + document.URL + '#gradB") rgb(0, 0, 0)', + }, + "need support for URI-based paints" + ), + new AnimTestcaseFromTo( + "url(#no_grad) rgb(1,2,3)", + "url(#gradB) blue", + { + fromComp: 'url("' + document.URL + '#no_grad") ' + "rgb(1, 2, 3)", + toComp: 'url("' + document.URL + '#gradB") rgb(0, 0, 255)', + }, + "need support for URI-based paints" + ), + ], + lengthNoUnits: [ + new AnimTestcaseFromTo("0", "20", { + fromComp: "0px", + midComp: "10px", + toComp: "20px", + }), + new AnimTestcaseFromTo("50", "0", { + fromComp: "50px", + midComp: "25px", + toComp: "0px", + }), + new AnimTestcaseFromTo("30", "80", { + fromComp: "30px", + midComp: "55px", + toComp: "80px", + }), + ], + lengthPx: [ + new AnimTestcaseFromTo("0px", "12px", { + fromComp: "0px", + midComp: "6px", + toComp: "12px", + }), + new AnimTestcaseFromTo("16px", "0px", { + fromComp: "16px", + midComp: "8px", + toComp: "0px", + }), + new AnimTestcaseFromTo("10px", "20px", { + fromComp: "10px", + midComp: "15px", + toComp: "20px", + }), + new AnimTestcaseFromTo("41px", "1px", { + fromComp: "41px", + midComp: "21px", + toComp: "1px", + }), + ], + lengthPctSVG: [new AnimTestcaseFromTo("20.5%", "0.5%", { midComp: "10.5%" })], + lengthPxPctSVG: [ + new AnimTestcaseFromTo( + "10px", + "10%", + { midComp: "15px" }, + "need support for interpolating between " + "px and percent values" + ), + ], + lengthPxNoUnitsSVG: [ + new AnimTestcaseFromTo("10", "20px", { + fromComp: "10px", + midComp: "15px", + toComp: "20px", + }), + new AnimTestcaseFromTo("10px", "20", { + fromComp: "10px", + midComp: "15px", + toComp: "20px", + }), + ], + opacity: [ + new AnimTestcaseFromTo("1", "0", { midComp: "0.5" }), + new AnimTestcaseFromTo("0.2", "0.12", { midComp: "0.16" }), + new AnimTestcaseFromTo("0.5", "0.7", { midComp: "0.6" }), + new AnimTestcaseFromTo("0.5", "inherit", { midComp: "0.75", toComp: "1" }), + // Make sure we don't clamp out-of-range values before interpolation + new AnimTestcaseFromTo( + "0.2", + "1.2", + { midComp: "0.7", toComp: "1" }, + "opacities with abs val >1 get clamped too early" + ), + new AnimTestcaseFromTo("-0.2", "0.6", { fromComp: "0", midComp: "0.2" }), + new AnimTestcaseFromTo( + "-1.2", + "1.6", + { fromComp: "0", midComp: "0.2", toComp: "1" }, + "opacities with abs val >1 get clamped too early" + ), + new AnimTestcaseFromTo( + "-0.6", + "1.4", + { fromComp: "0", midComp: "0.4", toComp: "1" }, + "opacities with abs val >1 get clamped too early" + ), + ], + URIsAndNone: [ + new AnimTestcaseFromTo("url(#idA)", "url(#idB)", { + fromComp: 'url("#idA")', + toComp: 'url("#idB")', + }), + new AnimTestcaseFromTo("none", "url(#idB)", { toComp: 'url("#idB")' }), + new AnimTestcaseFromTo("url(#idB)", "inherit", { + fromComp: 'url("#idB")', + toComp: "none", + }), + ], +}; + +function _tweakForLetterSpacing(testcases) { + return testcases.map(function (t) { + let valMap = Object.assign({}, t.computedValMap); + for (let prop of Object.keys(valMap)) { + if (valMap[prop] == "0px") { + valMap[prop] = "normal"; + } + } + return new AnimTestcaseFromTo(t.from, t.to, valMap); + }); +} + +// List of attribute/testcase-list bundles to be tested +var gFromToBundles = [ + new TestcaseBundle(gPropList.clip, [ + new AnimTestcaseFromTo( + "rect(1px, 2px, 3px, 4px)", + "rect(11px, 22px, 33px, 44px)", + { midComp: "rect(6px, 12px, 18px, 24px)" } + ), + new AnimTestcaseFromTo( + "rect(1px, auto, 3px, 4px)", + "rect(11px, auto, 33px, 44px)", + { midComp: "rect(6px, auto, 18px, 24px)" } + ), + new AnimTestcaseFromTo("auto", "auto"), + new AnimTestcaseFromTo( + "rect(auto, auto, auto, auto)", + "rect(auto, auto, auto, auto)" + ), + // Interpolation not supported in these next cases (with auto --> px-value) + new AnimTestcaseFromTo( + "rect(1px, auto, 3px, auto)", + "rect(11px, auto, 33px, 44px)" + ), + new AnimTestcaseFromTo( + "rect(1px, 2px, 3px, 4px)", + "rect(11px, auto, 33px, 44px)" + ), + new AnimTestcaseFromTo("rect(1px, 2px, 3px, 4px)", "auto"), + new AnimTestcaseFromTo("auto", "rect(1px, 2px, 3px, 4px)"), + ]), + new TestcaseBundle(gPropList.clip_path, _fromToTestLists.URIsAndNone), + new TestcaseBundle(gPropList.clip_rule, [ + new AnimTestcaseFromTo("nonzero", "evenodd"), + new AnimTestcaseFromTo("evenodd", "inherit", { toComp: "nonzero" }), + ]), + new TestcaseBundle( + gPropList.color, + [].concat(_fromToTestLists.color, [ + // Note: inherited value is rgb(50, 50, 50) (set on ) + new AnimTestcaseFromTo("inherit", "rgb(200, 200, 200)", { + fromComp: "rgb(50, 50, 50)", + midComp: "rgb(125, 125, 125)", + }), + ]) + ), + new TestcaseBundle(gPropList.color_interpolation, [ + new AnimTestcaseFromTo("sRGB", "auto", { fromComp: "srgb" }), + new AnimTestcaseFromTo("inherit", "linearRGB", { + fromComp: "srgb", + toComp: "linearrgb", + }), + ]), + new TestcaseBundle(gPropList.color_interpolation_filters, [ + new AnimTestcaseFromTo("sRGB", "auto", { fromComp: "srgb" }), + new AnimTestcaseFromTo("auto", "inherit", { toComp: "linearrgb" }), + ]), + new TestcaseBundle(gPropList.cursor, [ + new AnimTestcaseFromTo("crosshair", "move"), + new AnimTestcaseFromTo( + "url('a.cur'), url('b.cur'), nw-resize", + "sw-resize", + { + fromComp: + 'url("' + + _testPath + + '/a.cur"), ' + + 'url("' + + _testPath + + '/b.cur"), ' + + "nw-resize", + } + ), + ]), + new TestcaseBundle(gPropList.direction, [ + new AnimTestcaseFromTo("ltr", "rtl"), + new AnimTestcaseFromTo("rtl", "inherit"), + ]), + new TestcaseBundle(gPropList.display, [ + // I'm not testing the "inherit" value for "display", because part of + // my test runs with "display: none" on everything, and so the + // inherited value isn't always the same. (i.e. the computed value + // of 'inherit' will be different in different tests) + new AnimTestcaseFromTo("block", "table-cell"), + new AnimTestcaseFromTo("inline", "inline-table"), + new AnimTestcaseFromTo("table-row", "none"), + ]), + new TestcaseBundle(gPropList.dominant_baseline, [ + new AnimTestcaseFromTo("alphabetic", "hanging"), + new AnimTestcaseFromTo("mathematical", "central"), + new AnimTestcaseFromTo("middle", "text-after-edge"), + new AnimTestcaseFromTo("text-before-edge", "auto"), + new AnimTestcaseFromTo("alphabetic", "inherit", { toComp: "auto" }), + ]), + // NOTE: Mozilla doesn't currently support "enable-background", but I'm + // testing it here in case we ever add support for it, because it's + // explicitly not animatable in the SVG spec. + new TestcaseBundle(gPropList.enable_background, [ + new AnimTestcaseFromTo("new", "accumulate"), + ]), + new TestcaseBundle( + gPropList.fill, + [].concat( + _fromToTestLists.color, + _fromToTestLists.paintServer, + _fromToTestLists.colorFromInheritBlack + ) + ), + new TestcaseBundle(gPropList.fill_opacity, _fromToTestLists.opacity), + new TestcaseBundle(gPropList.fill_rule, [ + new AnimTestcaseFromTo("nonzero", "evenodd"), + new AnimTestcaseFromTo("evenodd", "inherit", { toComp: "nonzero" }), + ]), + new TestcaseBundle(gPropList.filter, _fromToTestLists.URIsAndNone), + new TestcaseBundle( + gPropList.flood_color, + [].concat(_fromToTestLists.color, _fromToTestLists.colorFromInheritBlack) + ), + new TestcaseBundle(gPropList.flood_opacity, _fromToTestLists.opacity), + new TestcaseBundle(gPropList.font, [ + // NOTE: 'line-height' is hard-wired at 10px in test_smilCSSFromTo.xhtml + // because if it's not explicitly set, its value varies across platforms. + // NOTE: System font values can't be tested here, because their computed + // values vary from platform to platform. However, they are tested + // visually, in the reftest "anim-css-font-1.svg" + new AnimTestcaseFromTo("10px serif", "30px serif", { + fromComp: "normal normal 400 10px / 10px serif", + toComp: "normal normal 400 30px / 10px serif", + }), + new AnimTestcaseFromTo("10px serif", "30px sans-serif", { + fromComp: "normal normal 400 10px / 10px serif", + toComp: "normal normal 400 30px / 10px sans-serif", + }), + new AnimTestcaseFromTo("1px / 90px cursive", "100px monospace", { + fromComp: "normal normal 400 1px / 10px cursive", + toComp: "normal normal 400 100px / 10px monospace", + }), + new AnimTestcaseFromTo( + "italic small-caps 200 1px cursive", + "100px monospace", + { + fromComp: "italic small-caps 200 1px / 10px cursive", + toComp: "normal normal 400 100px / 10px monospace", + } + ), + new AnimTestcaseFromTo( + "oblique normal 200 30px / 10px cursive", + "normal small-caps 800 40px / 10px serif" + ), + ]), + new TestcaseBundle(gPropList.font_family, [ + new AnimTestcaseFromTo("serif", "sans-serif"), + new AnimTestcaseFromTo("cursive", "monospace"), + ]), + new TestcaseBundle( + gPropList.font_size, + [].concat(_fromToTestLists.lengthNoUnits, _fromToTestLists.lengthPx, [ + new AnimTestcaseFromTo("10px", "40%", { + midComp: "15px", + toComp: "20px", + }), + new AnimTestcaseFromTo("160%", "80%", { + fromComp: "80px", + midComp: "60px", + toComp: "40px", + }), + ]) + ), + new TestcaseBundle(gPropList.font_size_adjust, [ + new AnimTestcaseFromTo("0.9", "0.1", { midComp: "0.5" }), + new AnimTestcaseFromTo("0.5", "0.6", { midComp: "0.55" }), + new AnimTestcaseFromTo("none", "0.4"), + ]), + new TestcaseBundle(gPropList.font_stretch, [ + new AnimTestcaseFromTo( + "normal", + "wider", + {}, + "need support for animating between " + "relative 'font-stretch' values" + ), + new AnimTestcaseFromTo( + "narrower", + "ultra-condensed", + {}, + "need support for animating between " + "relative 'font-stretch' values" + ), + new AnimTestcaseFromTo("ultra-condensed", "condensed", { + fromComp: "50%", + midComp: "62.5%", + toComp: "75%", + }), + new AnimTestcaseFromTo("semi-condensed", "semi-expanded", { + fromComp: "87.5%", + midComp: "100%", + toComp: "112.5%", + }), + new AnimTestcaseFromTo("expanded", "ultra-expanded", { + fromComp: "125%", + midComp: "162.5%", + toComp: "200%", + }), + new AnimTestcaseFromTo("ultra-expanded", "inherit", { + fromComp: "200%", + midComp: "150%", + toComp: "100%", + }), + ]), + new TestcaseBundle(gPropList.font_style, [ + new AnimTestcaseFromTo("italic", "inherit", { toComp: "normal" }), + new AnimTestcaseFromTo("normal", "italic"), + new AnimTestcaseFromTo("italic", "oblique"), + new AnimTestcaseFromTo("oblique", "normal", { midComp: "oblique 7deg" }), + ]), + new TestcaseBundle(gPropList.font_variant, [ + new AnimTestcaseFromTo("inherit", "small-caps", { fromComp: "normal" }), + new AnimTestcaseFromTo("small-caps", "normal"), + ]), + new TestcaseBundle(gPropList.font_weight, [ + new AnimTestcaseFromTo("100", "900", { midComp: "500" }), + new AnimTestcaseFromTo("700", "100", { midComp: "400" }), + new AnimTestcaseFromTo("inherit", "200", { + fromComp: "400", + midComp: "300", + }), + new AnimTestcaseFromTo("normal", "bold", { + fromComp: "400", + midComp: "550", + toComp: "700", + }), + new AnimTestcaseFromTo( + "lighter", + "bolder", + {}, + "need support for animating between " + "relative 'font-weight' values" + ), + ]), + // NOTE: Mozilla doesn't currently support "glyph-orientation-horizontal" or + // "glyph-orientation-vertical", but I'm testing them here in case we ever + // add support for them, because they're explicitly not animatable in the SVG + // spec. + new TestcaseBundle(gPropList.glyph_orientation_horizontal, [ + new AnimTestcaseFromTo("45deg", "60deg"), + ]), + new TestcaseBundle(gPropList.glyph_orientation_vertical, [ + new AnimTestcaseFromTo("45deg", "60deg"), + ]), + new TestcaseBundle(gPropList.image_rendering, [ + new AnimTestcaseFromTo("auto", "optimizeQuality", { + toComp: "optimizequality", + }), + new AnimTestcaseFromTo("optimizeQuality", "optimizeSpeed", { + fromComp: "optimizequality", + toComp: "optimizespeed", + }), + ]), + new TestcaseBundle( + gPropList.letter_spacing, + _tweakForLetterSpacing( + [].concat(_fromToTestLists.lengthNoUnits, _fromToTestLists.lengthPx) + ) + ), + new TestcaseBundle( + gPropList.lighting_color, + [].concat(_fromToTestLists.color, _fromToTestLists.colorFromInheritWhite) + ), + new TestcaseBundle(gPropList.marker, _fromToTestLists.URIsAndNone), + new TestcaseBundle(gPropList.marker_end, _fromToTestLists.URIsAndNone), + new TestcaseBundle(gPropList.marker_mid, _fromToTestLists.URIsAndNone), + new TestcaseBundle(gPropList.marker_start, _fromToTestLists.URIsAndNone), + new TestcaseBundle(gPropList.mask, _fromToTestLists.URIsAndNone), + new TestcaseBundle(gPropList.opacity, _fromToTestLists.opacity), + new TestcaseBundle(gPropList.overflow, [ + new AnimTestcaseFromTo("auto", "visible"), + new AnimTestcaseFromTo("inherit", "visible", { fromComp: "hidden" }), + new AnimTestcaseFromTo("scroll", "auto"), + ]), + new TestcaseBundle(gPropList.pointer_events, [ + new AnimTestcaseFromTo("visibleFill", "stroke", { + fromComp: "visiblefill", + }), + new AnimTestcaseFromTo("none", "visibleStroke", { + toComp: "visiblestroke", + }), + ]), + new TestcaseBundle(gPropList.shape_rendering, [ + new AnimTestcaseFromTo("auto", "optimizeSpeed", { + toComp: "optimizespeed", + }), + new AnimTestcaseFromTo("crispEdges", "geometricPrecision", { + fromComp: "crispedges", + toComp: "geometricprecision", + }), + ]), + new TestcaseBundle( + gPropList.stop_color, + [].concat(_fromToTestLists.color, _fromToTestLists.colorFromInheritBlack) + ), + new TestcaseBundle(gPropList.stop_opacity, _fromToTestLists.opacity), + new TestcaseBundle( + gPropList.stroke, + [].concat(_fromToTestLists.color, _fromToTestLists.paintServer, [ + // Note: inherited value is "none" (the default for "stroke" property) + new AnimTestcaseFromTo("inherit", "rgb(200, 200, 200)", { + fromComp: "none", + }), + ]) + ), + new TestcaseBundle( + gPropList.stroke_dasharray, + [].concat(_fromToTestLists.lengthPctSVG, [ + new AnimTestcaseFromTo("inherit", "20", { fromComp: "none" }), + new AnimTestcaseFromTo("1", "none"), + new AnimTestcaseFromTo("10", "20", { midComp: "15" }), + new AnimTestcaseFromTo("1", "2, 3", { + fromComp: "1, 1", + midComp: "1.5, 2", + }), + new AnimTestcaseFromTo("2, 8", "6", { midComp: "4, 7" }), + new AnimTestcaseFromTo("1, 3", "1, 3, 5, 7, 9", { + fromComp: "1, 3, 1, 3, 1, 3, 1, 3, 1, 3", + midComp: "1, 3, 3, 5, 5, 2, 2, 4, 4, 6", + }), + ]) + ), + new TestcaseBundle( + gPropList.stroke_dashoffset, + [].concat( + _fromToTestLists.lengthNoUnits, + _fromToTestLists.lengthPx, + _fromToTestLists.lengthPxPctSVG, + _fromToTestLists.lengthPctSVG, + _fromToTestLists.lengthPxNoUnitsSVG + ) + ), + new TestcaseBundle(gPropList.stroke_linecap, [ + new AnimTestcaseFromTo("butt", "round"), + new AnimTestcaseFromTo("round", "square"), + ]), + new TestcaseBundle(gPropList.stroke_linejoin, [ + new AnimTestcaseFromTo("miter", "round"), + new AnimTestcaseFromTo("round", "bevel"), + ]), + new TestcaseBundle(gPropList.stroke_miterlimit, [ + new AnimTestcaseFromTo("1", "2", { midComp: "1.5" }), + new AnimTestcaseFromTo("20.1", "10.1", { midComp: "15.1" }), + ]), + new TestcaseBundle(gPropList.stroke_opacity, _fromToTestLists.opacity), + new TestcaseBundle( + gPropList.stroke_width, + [].concat( + _fromToTestLists.lengthNoUnits, + _fromToTestLists.lengthPx, + _fromToTestLists.lengthPxPctSVG, + _fromToTestLists.lengthPctSVG, + _fromToTestLists.lengthPxNoUnitsSVG, + [ + new AnimTestcaseFromTo("inherit", "7px", { + fromComp: "1px", + midComp: "4px", + toComp: "7px", + }), + ] + ) + ), + new TestcaseBundle(gPropList.text_anchor, [ + new AnimTestcaseFromTo("start", "middle"), + new AnimTestcaseFromTo("middle", "end"), + ]), + new TestcaseBundle(gPropList.text_decoration_line, [ + new AnimTestcaseFromTo("none", "underline"), + new AnimTestcaseFromTo("overline", "line-through"), + new AnimTestcaseFromTo("blink", "underline"), + ]), + new TestcaseBundle(gPropList.text_rendering, [ + new AnimTestcaseFromTo("auto", "optimizeSpeed", { + toComp: "optimizespeed", + }), + new AnimTestcaseFromTo("optimizeSpeed", "geometricPrecision", { + fromComp: "optimizespeed", + toComp: "geometricprecision", + }), + new AnimTestcaseFromTo("geometricPrecision", "optimizeLegibility", { + fromComp: "geometricprecision", + toComp: "optimizelegibility", + }), + ]), + new TestcaseBundle(gPropList.unicode_bidi, [ + new AnimTestcaseFromTo("embed", "bidi-override"), + ]), + new TestcaseBundle(gPropList.vector_effect, [ + new AnimTestcaseFromTo("none", "non-scaling-stroke"), + ]), + new TestcaseBundle(gPropList.visibility, [ + new AnimTestcaseFromTo("visible", "hidden"), + new AnimTestcaseFromTo("hidden", "collapse"), + ]), + new TestcaseBundle( + gPropList.word_spacing, + [].concat( + _fromToTestLists.lengthNoUnits, + _fromToTestLists.lengthPx, + _fromToTestLists.lengthPxPctSVG + ) + ), + new TestcaseBundle( + gPropList.word_spacing, + _fromToTestLists.lengthPctSVG, + "pct->pct animations don't currently work for " + "*-spacing properties" + ), + // NOTE: Mozilla doesn't currently support "writing-mode", but I'm + // testing it here in case we ever add support for it, because it's + // explicitly not animatable in the SVG spec. + new TestcaseBundle(gPropList.writing_mode, [ + new AnimTestcaseFromTo("lr", "rl"), + ]), +]; diff --git a/dom/smil/test/db_smilCSSPaced.js b/dom/smil/test/db_smilCSSPaced.js new file mode 100644 index 0000000000..de2896bd2b --- /dev/null +++ b/dom/smil/test/db_smilCSSPaced.js @@ -0,0 +1,356 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 4 -*- */ +/* vim: set shiftwidth=4 tabstop=4 autoindent cindent noexpandtab: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* testcase data for paced-mode animations of CSS properties */ + +// Lists of testcases for re-use across multiple properties of the same type +var _pacedTestLists = { + color: [ + new AnimTestcasePaced( + "rgb(2, 4, 6); " + "rgb(4, 8, 12); " + "rgb(8, 16, 24)", + { + comp0: "rgb(2, 4, 6)", + comp1_6: "rgb(3, 6, 9)", + comp1_3: "rgb(4, 8, 12)", + comp2_3: "rgb(6, 12, 18)", + comp1: "rgb(8, 16, 24)", + } + ), + new AnimTestcasePaced( + "rgb(10, 10, 10); " + "rgb(20, 10, 8); " + "rgb(20, 30, 4)", + { + comp0: "rgb(10, 10, 10)", + comp1_6: "rgb(15, 10, 9)", + comp1_3: "rgb(20, 10, 8)", + comp2_3: "rgb(20, 20, 6)", + comp1: "rgb(20, 30, 4)", + } + ), + // Use the same RGB component values to make + // premultication effect easier to compute. + new AnimTestcasePaced( + "rgba(20, 40, 60, 0.2); " + + "rgba(20, 40, 60, 0.4); " + + "rgba(20, 40, 60, 0.8)", + { + comp0: "rgba(20, 40, 60, 0.2)", + comp1_6: "rgba(20, 40, 60, 0.3)", + comp1_3: "rgba(20, 40, 60, 0.4)", + comp2_3: "rgba(20, 40, 60, 0.6)", + comp1: "rgba(20, 40, 60, 0.8)", + } + ), + ], + currentColor_color: [ + new AnimTestcasePaced( + "olive; " + // rgb(128, 128, 0) + "currentColor; " + // rgb(50, 50, 50) + "rgb(206, 150, 206)", + { + comp0: "rgb(128, 128, 0)", + comp1_6: "rgb(89, 89, 25)", + comp1_3: "rgb(50, 50, 50)", + comp2_3: "rgb(128, 100, 128)", + comp1: "rgb(206, 150, 206)", + } + ), + ], + currentColor_fill: [ + // Bug 1467622 changed the distance calculation + // involving currentColor, comp values below + // are no longer evenly spaced. + new AnimTestcasePaced( + "olive; " + // rgb(128, 128, 0) + "currentColor; " + // rgb(50, 50, 50) + "rgb(206, 150, 206)", + { + comp0: "rgb(128, 128, 0)", + comp1_6: "rgb(98, 98, 19)", + comp1_3: "rgb(67, 67, 39)", + comp2_3: "rgb(115, 92, 115)", + comp1: "rgb(206, 150, 206)", + } + ), + ], + paintServer: [ + // Sanity check: These aren't interpolatable -- they should end up + // ignoring the calcMode="paced" and falling into discrete-mode. + new AnimTestcasePaced( + "url(#gradA); url(#gradB)", + { + comp0: 'url("' + document.URL + '#gradA") rgb(0, 0, 0)', + comp1_6: 'url("' + document.URL + '#gradA") rgb(0, 0, 0)', + comp1_3: 'url("' + document.URL + '#gradA") rgb(0, 0, 0)', + comp2_3: 'url("' + document.URL + '#gradB") rgb(0, 0, 0)', + comp1: 'url("' + document.URL + '#gradB") rgb(0, 0, 0)', + }, + "need support for URI-based paints" + ), + new AnimTestcasePaced( + "url(#gradA); url(#gradB); url(#gradC)", + { + comp0: 'url("' + document.URL + '#gradA") rgb(0, 0, 0)', + comp1_6: 'url("' + document.URL + '#gradA") rgb(0, 0, 0)', + comp1_3: 'url("' + document.URL + '#gradB") rgb(0, 0, 0)', + comp2_3: 'url("' + document.URL + '#gradC") rgb(0, 0, 0)', + comp1: 'url("' + document.URL + '#gradC") rgb(0, 0, 0)', + }, + "need support for URI-based paints" + ), + ], + lengthNoUnits: [ + new AnimTestcasePaced("2; 0; 4", { + comp0: "2px", + comp1_6: "1px", + comp1_3: "0px", + comp2_3: "2px", + comp1: "4px", + }), + new AnimTestcasePaced("10; 12; 8", { + comp0: "10px", + comp1_6: "11px", + comp1_3: "12px", + comp2_3: "10px", + comp1: "8px", + }), + ], + lengthPx: [ + new AnimTestcasePaced("0px; 2px; 6px", { + comp0: "0px", + comp1_6: "1px", + comp1_3: "2px", + comp2_3: "4px", + comp1: "6px", + }), + new AnimTestcasePaced("10px; 12px; 8px", { + comp0: "10px", + comp1_6: "11px", + comp1_3: "12px", + comp2_3: "10px", + comp1: "8px", + }), + ], + lengthPctSVG: [ + new AnimTestcasePaced("5%; 6%; 4%", { + comp0: "5%", + comp1_6: "5.5%", + comp1_3: "6%", + comp2_3: "5%", + comp1: "4%", + }), + ], + lengthPxPctSVG: [ + new AnimTestcasePaced( + "0px; 1%; 6px", + { + comp0: "0px", + comp1_6: "1px", + comp1_3: "1%", + comp2_3: "4px", + comp1: "6px", + }, + "need support for interpolating between " + "px and percent values" + ), + ], + opacity: [ + new AnimTestcasePaced("0; 0.2; 0.6", { + comp0: "0", + comp1_6: "0.1", + comp1_3: "0.2", + comp2_3: "0.4", + comp1: "0.6", + }), + new AnimTestcasePaced("0.7; 1.0; 0.4", { + comp0: "0.7", + comp1_6: "0.85", + comp1_3: "1", + comp2_3: "0.7", + comp1: "0.4", + }), + ], + rect: [ + new AnimTestcasePaced( + "rect(2px, 4px, 6px, 8px); " + + "rect(4px, 8px, 12px, 16px); " + + "rect(8px, 16px, 24px, 32px)", + { + comp0: "rect(2px, 4px, 6px, 8px)", + comp1_6: "rect(3px, 6px, 9px, 12px)", + comp1_3: "rect(4px, 8px, 12px, 16px)", + comp2_3: "rect(6px, 12px, 18px, 24px)", + comp1: "rect(8px, 16px, 24px, 32px)", + } + ), + new AnimTestcasePaced( + "rect(10px, 10px, 10px, 10px); " + + "rect(20px, 10px, 50px, 8px); " + + "rect(20px, 30px, 130px, 4px)", + { + comp0: "rect(10px, 10px, 10px, 10px)", + comp1_6: "rect(15px, 10px, 30px, 9px)", + comp1_3: "rect(20px, 10px, 50px, 8px)", + comp2_3: "rect(20px, 20px, 90px, 6px)", + comp1: "rect(20px, 30px, 130px, 4px)", + } + ), + new AnimTestcasePaced( + "rect(10px, auto, 10px, 10px); " + + "rect(20px, auto, 50px, 8px); " + + "rect(40px, auto, 130px, 4px)", + { + comp0: "rect(10px, auto, 10px, 10px)", + comp1_6: "rect(15px, auto, 30px, 9px)", + comp1_3: "rect(20px, auto, 50px, 8px)", + comp2_3: "rect(30px, auto, 90px, 6px)", + comp1: "rect(40px, auto, 130px, 4px)", + } + ), + // Paced-mode animation is not supported in these next few cases + // (Can't compute subcomponent distance between 'auto' & px-values) + new AnimTestcasePaced( + "rect(10px, 10px, 10px, auto); " + + "rect(20px, 10px, 50px, 8px); " + + "rect(20px, 30px, 130px, 4px)", + { + comp0: "rect(10px, 10px, 10px, auto)", + comp1_6: "rect(10px, 10px, 10px, auto)", + comp1_3: "rect(20px, 10px, 50px, 8px)", + comp2_3: "rect(20px, 30px, 130px, 4px)", + comp1: "rect(20px, 30px, 130px, 4px)", + } + ), + new AnimTestcasePaced( + "rect(10px, 10px, 10px, 10px); " + + "rect(20px, 10px, 50px, 8px); " + + "auto", + { + comp0: "rect(10px, 10px, 10px, 10px)", + comp1_6: "rect(10px, 10px, 10px, 10px)", + comp1_3: "rect(20px, 10px, 50px, 8px)", + comp2_3: "auto", + comp1: "auto", + } + ), + new AnimTestcasePaced( + "auto; " + "auto; " + "rect(20px, 30px, 130px, 4px)", + { + comp0: "auto", + comp1_6: "auto", + comp1_3: "auto", + comp2_3: "rect(20px, 30px, 130px, 4px)", + comp1: "rect(20px, 30px, 130px, 4px)", + } + ), + new AnimTestcasePaced("auto; auto; auto", { + comp0: "auto", + comp1_6: "auto", + comp1_3: "auto", + comp2_3: "auto", + comp1: "auto", + }), + ], +}; + +// TODO: test more properties here. +var gPacedBundles = [ + new TestcaseBundle(gPropList.clip, _pacedTestLists.rect), + new TestcaseBundle( + gPropList.color, + [].concat(_pacedTestLists.color, _pacedTestLists.currentColor_color) + ), + new TestcaseBundle(gPropList.direction, [ + new AnimTestcasePaced("rtl; ltr; rtl"), + ]), + new TestcaseBundle( + gPropList.fill, + [].concat( + _pacedTestLists.color, + _pacedTestLists.currentColor_fill, + _pacedTestLists.paintServer + ) + ), + new TestcaseBundle( + gPropList.font_size, + [].concat(_pacedTestLists.lengthNoUnits, _pacedTestLists.lengthPx, [ + new AnimTestcasePaced("20%; 24%; 16%", { + comp0: "10px", + comp1_6: "11px", + comp1_3: "12px", + comp2_3: "10px", + comp1: "8px", + }), + new AnimTestcasePaced("0px; 4%; 6px", { + comp0: "0px", + comp1_6: "1px", + comp1_3: "2px", + comp2_3: "4px", + comp1: "6px", + }), + ]) + ), + new TestcaseBundle(gPropList.font_size_adjust, [ + new AnimTestcasePaced("0.2; 0.6; 0.8", { + comp0: "0.2", + comp1_6: "0.3", + comp1_3: "0.4", + comp2_3: "0.6", + comp1: "0.8", + }), + new AnimTestcasePaced("none; none; 0.5", { + comp0: "none", + comp1_6: "none", + comp1_3: "none", + comp2_3: "0.5", + comp1: "0.5", + }), + ]), + new TestcaseBundle(gPropList.font_family, [ + // Sanity check: 'font-family' isn't interpolatable. It should end up + // ignoring the calcMode="paced" and falling into discrete-mode. + new AnimTestcasePaced( + "serif; sans-serif; monospace", + { + comp0: "serif", + comp1_6: "serif", + comp1_3: "sans-serif", + comp2_3: "monospace", + comp1: "monospace", + }, + "need support for more font properties" + ), + ]), + new TestcaseBundle(gPropList.opacity, _pacedTestLists.opacity), + new TestcaseBundle( + gPropList.stroke_dasharray, + [].concat(_pacedTestLists.lengthPctSVG, [ + new AnimTestcasePaced("7, 7, 7; 7, 10, 3; 1, 2, 3", { + comp0: "7px, 7px, 7px", + comp1_6: "7px, 8.5px, 5px", + comp1_3: "7px, 10px, 3px", + comp2_3: "4px, 6px, 3px", + comp1: "1px, 2px, 3px", + }), + ]) + ), + new TestcaseBundle( + gPropList.stroke_dashoffset, + [].concat( + _pacedTestLists.lengthNoUnits, + _pacedTestLists.lengthPx, + _pacedTestLists.lengthPctSVG, + _pacedTestLists.lengthPxPctSVG + ) + ), + new TestcaseBundle( + gPropList.stroke_width, + [].concat( + _pacedTestLists.lengthNoUnits, + _pacedTestLists.lengthPx, + _pacedTestLists.lengthPctSVG, + _pacedTestLists.lengthPxPctSVG + ) + ), +]; diff --git a/dom/smil/test/db_smilCSSPropertyList.js b/dom/smil/test/db_smilCSSPropertyList.js new file mode 100644 index 0000000000..237c9db585 --- /dev/null +++ b/dom/smil/test/db_smilCSSPropertyList.js @@ -0,0 +1,104 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 sw=2 sts=2 et: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* list of CSS properties recognized by SVG 1.1 spec, for use in mochitests */ + +// List of CSS Properties from SVG 1.1 Specification, Appendix N +var gPropList = { + // NOTE: AnimatedAttribute signature is: + // (attrName, attrType, sampleTarget, isAnimatable, isAdditive) + + // SKIP 'alignment-baseline' property: animatable but not supported by Mozilla + // SKIP 'baseline-shift' property: animatable but not supported by Mozilla + clip: new AdditiveAttribute("clip", "CSS", "marker"), + clip_path: new NonAdditiveAttribute("clip-path", "CSS", "rect"), + clip_rule: new NonAdditiveAttribute("clip-rule", "CSS", "circle"), + color: new AdditiveAttribute("color", "CSS", "rect"), + color_interpolation: new NonAdditiveAttribute( + "color-interpolation", + "CSS", + "rect" + ), + color_interpolation_filters: new NonAdditiveAttribute( + "color-interpolation-filters", + "CSS", + "feFlood" + ), + // SKIP 'color-profile' property: animatable but not supported by Mozilla + cursor: new NonAdditiveAttribute("cursor", "CSS", "rect"), + direction: new NonAnimatableAttribute("direction", "CSS", "text"), + display: new NonAdditiveAttribute("display", "CSS", "rect"), + dominant_baseline: new NonAdditiveAttribute( + "dominant-baseline", + "CSS", + "text" + ), + enable_background: + // NOTE: Not supported by Mozilla, but explicitly non-animatable + new NonAnimatableAttribute("enable-background", "CSS", "marker"), + fill: new AdditiveAttribute("fill", "CSS", "rect"), + fill_opacity: new AdditiveAttribute("fill-opacity", "CSS", "rect"), + fill_rule: new NonAdditiveAttribute("fill-rule", "CSS", "rect"), + filter: new NonAdditiveAttribute("filter", "CSS", "rect"), + flood_color: new AdditiveAttribute("flood-color", "CSS", "feFlood"), + flood_opacity: new AdditiveAttribute("flood-opacity", "CSS", "feFlood"), + font: new NonAdditiveAttribute("font", "CSS", "text"), + font_family: new NonAdditiveAttribute("font-family", "CSS", "text"), + font_size: new AdditiveAttribute("font-size", "CSS", "text"), + font_size_adjust: new NonAdditiveAttribute("font-size-adjust", "CSS", "text"), + font_stretch: new NonAdditiveAttribute("font-stretch", "CSS", "text"), + font_style: new NonAdditiveAttribute("font-style", "CSS", "text"), + font_variant: new NonAdditiveAttribute("font-variant", "CSS", "text"), + // XXXdholbert should 'font-weight' be additive? + font_weight: new NonAdditiveAttribute("font-weight", "CSS", "text"), + glyph_orientation_horizontal: + // NOTE: Not supported by Mozilla, but explicitly non-animatable + NonAnimatableAttribute("glyph-orientation-horizontal", "CSS", "text"), + glyph_orientation_vertical: + // NOTE: Not supported by Mozilla, but explicitly non-animatable + NonAnimatableAttribute("glyph-orientation-horizontal", "CSS", "text"), + image_rendering: NonAdditiveAttribute("image-rendering", "CSS", "image"), + // SKIP 'kerning' property: animatable but not supported by Mozilla + letter_spacing: new AdditiveAttribute("letter-spacing", "CSS", "text"), + lighting_color: new AdditiveAttribute( + "lighting-color", + "CSS", + "feDiffuseLighting" + ), + marker: new NonAdditiveAttribute("marker", "CSS", "line"), + marker_end: new NonAdditiveAttribute("marker-end", "CSS", "line"), + marker_mid: new NonAdditiveAttribute("marker-mid", "CSS", "line"), + marker_start: new NonAdditiveAttribute("marker-start", "CSS", "line"), + mask: new NonAdditiveAttribute("mask", "CSS", "line"), + opacity: new AdditiveAttribute("opacity", "CSS", "rect"), + overflow: new NonAdditiveAttribute("overflow", "CSS", "marker"), + pointer_events: new NonAdditiveAttribute("pointer-events", "CSS", "rect"), + shape_rendering: new NonAdditiveAttribute("shape-rendering", "CSS", "rect"), + stop_color: new AdditiveAttribute("stop-color", "CSS", "stop"), + stop_opacity: new AdditiveAttribute("stop-opacity", "CSS", "stop"), + stroke: new AdditiveAttribute("stroke", "CSS", "rect"), + stroke_dasharray: new NonAdditiveAttribute("stroke-dasharray", "CSS", "rect"), + stroke_dashoffset: new AdditiveAttribute("stroke-dashoffset", "CSS", "rect"), + stroke_linecap: new NonAdditiveAttribute("stroke-linecap", "CSS", "rect"), + stroke_linejoin: new NonAdditiveAttribute("stroke-linejoin", "CSS", "rect"), + stroke_miterlimit: new AdditiveAttribute("stroke-miterlimit", "CSS", "rect"), + stroke_opacity: new AdditiveAttribute("stroke-opacity", "CSS", "rect"), + stroke_width: new AdditiveAttribute("stroke-width", "CSS", "rect"), + text_anchor: new NonAdditiveAttribute("text-anchor", "CSS", "text"), + text_decoration_line: new NonAdditiveAttribute( + "text-decoration-line", + "CSS", + "text" + ), + text_rendering: new NonAdditiveAttribute("text-rendering", "CSS", "text"), + unicode_bidi: new NonAnimatableAttribute("unicode-bidi", "CSS", "text"), + vector_effect: new NonAdditiveAttribute("vector-effect", "CSS", "rect"), + visibility: new NonAdditiveAttribute("visibility", "CSS", "rect"), + word_spacing: new AdditiveAttribute("word-spacing", "CSS", "text"), + writing_mode: + // NOTE: Not supported by Mozilla, but explicitly non-animatable + new NonAnimatableAttribute("writing-mode", "CSS", "text"), +}; diff --git a/dom/smil/test/db_smilMappedAttrList.js b/dom/smil/test/db_smilMappedAttrList.js new file mode 100644 index 0000000000..81f71ef32b --- /dev/null +++ b/dom/smil/test/db_smilMappedAttrList.js @@ -0,0 +1,148 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 sw=2 sts=2 et: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* List of SVG presentational attributes in the SVG 1.1 spec, for use in + mochitests. (These are the attributes that are mapped to CSS properties) */ + +var gMappedAttrList = { + // NOTE: The list here should match the MappedAttributeEntry arrays in + // SVGElement.cpp + + // PresentationAttributes-FillStroke + fill: new AdditiveAttribute("fill", "XML", "rect"), + fill_opacity: new AdditiveAttribute("fill-opacity", "XML", "rect"), + fill_rule: new NonAdditiveAttribute("fill-rule", "XML", "rect"), + stroke: new AdditiveAttribute("stroke", "XML", "rect"), + stroke_dasharray: new NonAdditiveAttribute("stroke-dasharray", "XML", "rect"), + stroke_dashoffset: new AdditiveAttribute("stroke-dashoffset", "XML", "rect"), + stroke_linecap: new NonAdditiveAttribute("stroke-linecap", "XML", "rect"), + stroke_linejoin: new NonAdditiveAttribute("stroke-linejoin", "XML", "rect"), + stroke_miterlimit: new AdditiveAttribute("stroke-miterlimit", "XML", "rect"), + stroke_opacity: new AdditiveAttribute("stroke-opacity", "XML", "rect"), + stroke_width: new AdditiveAttribute("stroke-width", "XML", "rect"), + + // PresentationAttributes-Graphics + clip_path: new NonAdditiveAttribute("clip-path", "XML", "rect"), + clip_rule: new NonAdditiveAttribute("clip-rule", "XML", "circle"), + color_interpolation: new NonAdditiveAttribute( + "color-interpolation", + "XML", + "rect" + ), + cursor: new NonAdditiveAttribute("cursor", "XML", "rect"), + display: new NonAdditiveAttribute("display", "XML", "rect"), + filter: new NonAdditiveAttribute("filter", "XML", "rect"), + image_rendering: NonAdditiveAttribute("image-rendering", "XML", "image"), + mask: new NonAdditiveAttribute("mask", "XML", "line"), + pointer_events: new NonAdditiveAttribute("pointer-events", "XML", "rect"), + shape_rendering: new NonAdditiveAttribute("shape-rendering", "XML", "rect"), + text_rendering: new NonAdditiveAttribute("text-rendering", "XML", "text"), + visibility: new NonAdditiveAttribute("visibility", "XML", "rect"), + + // PresentationAttributes-TextContentElements + // SKIP 'alignment-baseline' property: animatable but not supported by Mozilla + // SKIP 'baseline-shift' property: animatable but not supported by Mozilla + direction: new NonAnimatableAttribute("direction", "XML", "text"), + dominant_baseline: new NonAdditiveAttribute( + "dominant-baseline", + "XML", + "text" + ), + glyph_orientation_horizontal: + // NOTE: Not supported by Mozilla, but explicitly non-animatable + NonAnimatableAttribute("glyph-orientation-horizontal", "XML", "text"), + glyph_orientation_vertical: + // NOTE: Not supported by Mozilla, but explicitly non-animatable + NonAnimatableAttribute("glyph-orientation-horizontal", "XML", "text"), + // SKIP 'kerning' property: animatable but not supported by Mozilla + letter_spacing: new AdditiveAttribute("letter-spacing", "XML", "text"), + text_anchor: new NonAdditiveAttribute("text-anchor", "XML", "text"), + text_decoration_line: new NonAdditiveAttribute( + "text-decoration-line", + "XML", + "text" + ), + unicode_bidi: new NonAnimatableAttribute("unicode-bidi", "XML", "text"), + word_spacing: new AdditiveAttribute("word-spacing", "XML", "text"), + + // PresentationAttributes-FontSpecification + font_family: new NonAdditiveAttribute("font-family", "XML", "text"), + font_size: new AdditiveAttribute("font-size", "XML", "text"), + font_size_adjust: new NonAdditiveAttribute("font-size-adjust", "XML", "text"), + font_stretch: new NonAdditiveAttribute("font-stretch", "XML", "text"), + font_style: new NonAdditiveAttribute("font-style", "XML", "text"), + font_variant: new NonAdditiveAttribute("font-variant", "XML", "text"), + font_weight: new NonAdditiveAttribute("font-weight", "XML", "text"), + + // PresentationAttributes-GradientStop + stop_color: new AdditiveAttribute("stop-color", "XML", "stop"), + stop_opacity: new AdditiveAttribute("stop-opacity", "XML", "stop"), + + // PresentationAttributes-Viewports + overflow: new NonAdditiveAttribute("overflow", "XML", "marker"), + clip: new AdditiveAttribute("clip", "XML", "marker"), + + // PresentationAttributes-Makers + marker_end: new NonAdditiveAttribute("marker-end", "XML", "line"), + marker_mid: new NonAdditiveAttribute("marker-mid", "XML", "line"), + marker_start: new NonAdditiveAttribute("marker-start", "XML", "line"), + + // PresentationAttributes-Color + color: new AdditiveAttribute("color", "XML", "rect"), + + // PresentationAttributes-Filters + color_interpolation_filters: new NonAdditiveAttribute( + "color-interpolation-filters", + "XML", + "feFlood" + ), + + // PresentationAttributes-feFlood + flood_color: new AdditiveAttribute("flood-color", "XML", "feFlood"), + flood_opacity: new AdditiveAttribute("flood-opacity", "XML", "feFlood"), + + // PresentationAttributes-LightingEffects + lighting_color: new AdditiveAttribute( + "lighting-color", + "XML", + "feDiffuseLighting" + ), +}; + +// Utility method to copy a list of TestcaseBundle objects for CSS properties +// into a list of TestcaseBundles for the corresponding mapped attributes. +function convertCSSBundlesToMappedAttr(bundleList) { + // Create mapping of property names to the corresponding + // mapped-attribute object in gMappedAttrList. + var propertyNameToMappedAttr = {}; + for (attributeLabel in gMappedAttrList) { + var propName = gMappedAttrList[attributeLabel].attrName; + propertyNameToMappedAttr[propName] = gMappedAttrList[attributeLabel]; + } + + var convertedBundles = []; + for (var bundleIdx in bundleList) { + var origBundle = bundleList[bundleIdx]; + var propName = origBundle.animatedAttribute.attrName; + if (propertyNameToMappedAttr[propName]) { + // There's a mapped attribute by this name! Duplicate the TestcaseBundle, + // using the Mapped Attribute instead of the CSS Property. + is( + origBundle.animatedAttribute.attrType, + "CSS", + "expecting to be converting from CSS to XML" + ); + convertedBundles.push( + new TestcaseBundle( + propertyNameToMappedAttr[propName], + origBundle.testcaseList, + origBundle.skipReason + ) + ); + } + } + return convertedBundles; +} diff --git a/dom/smil/test/file_smilWithTransition.html b/dom/smil/test/file_smilWithTransition.html new file mode 100644 index 0000000000..b91398436b --- /dev/null +++ b/dom/smil/test/file_smilWithTransition.html @@ -0,0 +1,79 @@ + + + + + + Test SMIL does not trigger CSS Transitions (bug 1315874) + + +Mozilla Bug + 1315874 + + + + + + + + + diff --git a/dom/smil/test/mochitest.toml b/dom/smil/test/mochitest.toml new file mode 100644 index 0000000000..7a3e98fa57 --- /dev/null +++ b/dom/smil/test/mochitest.toml @@ -0,0 +1,109 @@ +[DEFAULT] +support-files = [ + "db_smilAnimateMotion.js", + "db_smilCSSFromBy.js", + "db_smilCSSFromTo.js", + "db_smilCSSPaced.js", + "db_smilCSSPropertyList.js", + "db_smilMappedAttrList.js", + "file_smilWithTransition.html", + "smilAnimateMotionValueLists.js", + "smilExtDoc_helper.svg", + "smilTestUtils.js", + "smilXHR_helper.svg", +] + +["test_smilAccessKey.xhtml"] + +["test_smilAdditionFallback.html"] + +["test_smilAnimateMotion.xhtml"] + +["test_smilAnimateMotionInvalidValues.xhtml"] + +["test_smilAnimateMotionOverrideRules.xhtml"] + +["test_smilBackwardsSeeking.xhtml"] + +["test_smilCSSFontStretchRelative.xhtml"] + +["test_smilCSSFromBy.xhtml"] + +["test_smilCSSFromTo.xhtml"] + +["test_smilCSSInherit.xhtml"] +disabled = "until bug 501183 is fixed" + +["test_smilCSSInvalidValues.xhtml"] + +["test_smilCSSPaced.xhtml"] + +["test_smilChangeAfterFrozen.xhtml"] +skip-if = ["true"] # bug 1358955. + +["test_smilConditionalProcessing.html"] + +["test_smilContainerBinding.xhtml"] + +["test_smilCrossContainer.xhtml"] + +["test_smilDynamicDelayedBeginElement.xhtml"] + +["test_smilExtDoc.xhtml"] + +["test_smilFillMode.xhtml"] + +["test_smilGetSimpleDuration.xhtml"] + +["test_smilGetStartTime.xhtml"] + +["test_smilHyperlinking.xhtml"] + +["test_smilInvalidValues.html"] + +["test_smilKeySplines.xhtml"] + +["test_smilKeyTimes.xhtml"] + +["test_smilKeyTimesPacedMode.xhtml"] + +["test_smilMappedAttrFromBy.xhtml"] + +["test_smilMappedAttrFromTo.xhtml"] + +["test_smilMappedAttrPaced.xhtml"] + +["test_smilMinTiming.html"] + +["test_smilRepeatDuration.html"] + +["test_smilRepeatTiming.xhtml"] + +["test_smilReset.xhtml"] + +["test_smilRestart.xhtml"] + +["test_smilSetCurrentTime.xhtml"] + +["test_smilSync.xhtml"] + +["test_smilSyncTransform.xhtml"] + +["test_smilSyncbaseTarget.xhtml"] + +["test_smilTextZoom.xhtml"] + +["test_smilTiming.xhtml"] + +["test_smilTimingZeroIntervals.xhtml"] + +["test_smilUpdatedInterval.xhtml"] + +["test_smilValues.xhtml"] + +["test_smilWithTransition.html"] +skip-if = ["os == 'android'"] + +["test_smilWithXlink.xhtml"] + +["test_smilXHR.xhtml"] diff --git a/dom/smil/test/smilAnimateMotionValueLists.js b/dom/smil/test/smilAnimateMotionValueLists.js new file mode 100644 index 0000000000..6e05ebd7e1 --- /dev/null +++ b/dom/smil/test/smilAnimateMotionValueLists.js @@ -0,0 +1,116 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 sw=2 sts=2 et: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +/* Lists of valid & invalid values for the various attributes */ +const gValidValues = [ + "10 10", + "10 10;", // Trailing semicolons are allowed + "10 10; ", + " 10 10em ", + "1 2 ; 3,4", + "1,2;3,4", + "0 0", + "0,0", +]; + +const gInvalidValues = [ + ";10 10", + "10 10;;", + "1 2 3", + "1 2 3 4", + "1,2;3,4 ,", + ",", + " , ", + ";", + " ; ", + "a", + " a; ", + ";a;", + "", + " ", + "1,2;3,4,", + "1,,2", + ",1,2", +]; + +const gValidRotate = [ + "10", + "20.1", + "30.5deg", + "0.5rad", + "auto", + "auto-reverse", + " 10 ", + " 10deg", + "10deg ", + " 10.1 ", +]; + +const gInvalidRotate = ["10 deg", "10 rad ", "aaa"]; + +const gValidToBy = ["0 0", "1em,2", "50.3em 0.2in", " 1,2", "1 2 "]; + +const gInvalidToBy = [ + "0 0 0", + "0 0,0", + "0,0,0", + "1emm 2", + "1 2;", + "1 2,", + " 1,2 ,", + "abc", + ",", + "", + "1,,2", + "1,2,", +]; + +const gValidPath = [ + "m0 0 L30 30", + "M20,20L10 10", + "M20,20 L30, 30h20", + "m50 50", + "M50 50", + "m0 0", + "M0, 0", +]; + +// paths must start with at least a valid "M" segment to be valid +const gInvalidPath = ["M20in 20", "h30", "L50 50", "abc"]; + +// paths that at least start with a valid "M" segment are valid - the spec says +// to parse everything up to the first invalid token +const gValidPathWithErrors = ["M20 20em", "m0 0 L30,,30", "M10 10 L50 50 abc"]; + +const gValidKeyPoints = [ + "0; 0.5; 1", + "0;.5;1", + "0; 0; 1", + "0; 1; 1", + "0; 0; 1;", // Trailing semicolons are allowed + "0; 0; 1; ", + "0; 0.000; 1", + "0; 0.000001; 1", +]; + +// Should have 3 values to be valid. +// Same as number of keyTimes values +const gInvalidKeyPoints = [ + "0; 1", + "0; 0.5; 0.75; 1", + "0; 1;", + "0", + "1", + "a", + "", + " ", + "0; -0.1; 1", + "0; 1.1; 1", + "0; 0.1; 1.1", + "-0.1; 0.1; 1", + "0; a; 1", + "0;;1", +]; diff --git a/dom/smil/test/smilExtDoc_helper.svg b/dom/smil/test/smilExtDoc_helper.svg new file mode 100644 index 0000000000..fbd9d091a4 --- /dev/null +++ b/dom/smil/test/smilExtDoc_helper.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/dom/smil/test/smilTestUtils.js b/dom/smil/test/smilTestUtils.js new file mode 100644 index 0000000000..be270a39bf --- /dev/null +++ b/dom/smil/test/smilTestUtils.js @@ -0,0 +1,1015 @@ +/* -*- indent-tabs-mode: nil; js-indent-level: 2 -*- */ +/* vim: set ts=2 sw=2 sts=2 et: */ +/* This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ + +// Note: Class syntax roughly based on: +// https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Inheritance +const SVG_NS = "http://www.w3.org/2000/svg"; +const XLINK_NS = "http://www.w3.org/1999/xlink"; + +const MPATH_TARGET_ID = "smilTestUtilsTestingPath"; + +function extend(child, supertype) { + child.prototype.__proto__ = supertype.prototype; +} + +// General Utility Methods +var SMILUtil = { + // Returns the first matched node in the document + getSVGRoot() { + return SMILUtil.getFirstElemWithTag("svg"); + }, + + // Returns the first element in the document with the matching tag + getFirstElemWithTag(aTargetTag) { + var elemList = document.getElementsByTagName(aTargetTag); + return !elemList.length ? null : elemList[0]; + }, + + // Simple wrapper for getComputedStyle + getComputedStyleSimple(elem, prop) { + return window.getComputedStyle(elem).getPropertyValue(prop); + }, + + getAttributeValue(elem, attr) { + if (attr.attrName == SMILUtil.getMotionFakeAttributeName()) { + // Fake motion "attribute" -- "computed value" is the element's CTM + return elem.getCTM(); + } + if (attr.attrType == "CSS") { + return SMILUtil.getComputedStyleWrapper(elem, attr.attrName); + } + if (attr.attrType == "XML") { + // XXXdholbert This is appropriate for mapped attributes, but not + // for other attributes. + return SMILUtil.getComputedStyleWrapper(elem, attr.attrName); + } + throw new Error(`Unexpected attribute value ${attr.attrType}`); + }, + + // Smart wrapper for getComputedStyle, which will generate a "fake" computed + // style for recognized shorthand properties (font, font-variant, overflow, marker) + getComputedStyleWrapper(elem, propName) { + // Special cases for shorthand properties (which aren't directly queriable + // via getComputedStyle) + var computedStyle; + if (propName == "font") { + var subProps = [ + "font-style", + "font-variant-caps", + "font-weight", + "font-size", + "line-height", + "font-family", + ]; + for (var i in subProps) { + var subPropStyle = SMILUtil.getComputedStyleSimple(elem, subProps[i]); + if (subPropStyle) { + if (subProps[i] == "line-height") { + // There needs to be a "/" before line-height + subPropStyle = "/ " + subPropStyle; + } + if (!computedStyle) { + computedStyle = subPropStyle; + } else { + computedStyle = computedStyle + " " + subPropStyle; + } + } + } + } else if (propName == "font-variant") { + // xxx - this isn't completely correct but it's sufficient for what's + // being tested here + computedStyle = SMILUtil.getComputedStyleSimple( + elem, + "font-variant-caps" + ); + } else if (propName == "marker") { + var subProps = ["marker-end", "marker-mid", "marker-start"]; + for (var i in subProps) { + if (!computedStyle) { + computedStyle = SMILUtil.getComputedStyleSimple(elem, subProps[i]); + } else { + is( + computedStyle, + SMILUtil.getComputedStyleSimple(elem, subProps[i]), + "marker sub-properties should match each other " + + "(they shouldn't be individually set)" + ); + } + } + } else if (propName == "overflow") { + var subProps = ["overflow-x", "overflow-y"]; + for (var i in subProps) { + if (!computedStyle) { + computedStyle = SMILUtil.getComputedStyleSimple(elem, subProps[i]); + } else { + is( + computedStyle, + SMILUtil.getComputedStyleSimple(elem, subProps[i]), + "overflow sub-properties should match each other " + + "(they shouldn't be individually set)" + ); + } + } + } else { + computedStyle = SMILUtil.getComputedStyleSimple(elem, propName); + } + return computedStyle; + }, + + getMotionFakeAttributeName() { + return "_motion"; + }, + + // Return stripped px value from specified value. + stripPx: str => str.replace(/px\s*$/, ""), +}; + +var CTMUtil = { + CTM_COMPONENTS_ALL: ["a", "b", "c", "d", "e", "f"], + CTM_COMPONENTS_ROTATE: ["a", "b", "c", "d"], + + // Function to generate a CTM Matrix from a "summary" + // (a 3-tuple containing [tX, tY, theta]) + generateCTM(aCtmSummary) { + if (!aCtmSummary || aCtmSummary.length != 3) { + ok(false, "Unexpected CTM summary tuple length: " + aCtmSummary.length); + } + var tX = aCtmSummary[0]; + var tY = aCtmSummary[1]; + var theta = aCtmSummary[2]; + var cosTheta = Math.cos(theta); + var sinTheta = Math.sin(theta); + var newCtm = { + a: cosTheta, + c: -sinTheta, + e: tX, + b: sinTheta, + d: cosTheta, + f: tY, + }; + return newCtm; + }, + + /// Helper for isCtmEqual + isWithinDelta(aTestVal, aExpectedVal, aErrMsg, aIsTodo) { + var testFunc = aIsTodo ? todo : ok; + const delta = 0.00001; // allowing margin of error = 10^-5 + ok( + aTestVal >= aExpectedVal - delta && aTestVal <= aExpectedVal + delta, + aErrMsg + " | got: " + aTestVal + ", expected: " + aExpectedVal + ); + }, + + assertCTMEqual(aLeftCtm, aRightCtm, aComponentsToCheck, aErrMsg, aIsTodo) { + var foundCTMDifference = false; + for (var j in aComponentsToCheck) { + var curComponent = aComponentsToCheck[j]; + if (!aIsTodo) { + CTMUtil.isWithinDelta( + aLeftCtm[curComponent], + aRightCtm[curComponent], + aErrMsg + " | component: " + curComponent, + false + ); + } else if (aLeftCtm[curComponent] != aRightCtm[curComponent]) { + foundCTMDifference = true; + } + } + + if (aIsTodo) { + todo(!foundCTMDifference, aErrMsg + " | (currently marked todo)"); + } + }, + + assertCTMNotEqual(aLeftCtm, aRightCtm, aComponentsToCheck, aErrMsg, aIsTodo) { + // CTM should not match initial one + var foundCTMDifference = false; + for (var j in aComponentsToCheck) { + var curComponent = aComponentsToCheck[j]; + if (aLeftCtm[curComponent] != aRightCtm[curComponent]) { + foundCTMDifference = true; + break; // We found a difference, as expected. Success! + } + } + + if (aIsTodo) { + todo(foundCTMDifference, aErrMsg + " | (currently marked todo)"); + } else { + ok(foundCTMDifference, aErrMsg); + } + }, +}; + +// Wrapper for timing information +function SMILTimingData(aBegin, aDur) { + this._begin = aBegin; + this._dur = aDur; +} +SMILTimingData.prototype = { + _begin: null, + _dur: null, + getBeginTime() { + return this._begin; + }, + getDur() { + return this._dur; + }, + getEndTime() { + return this._begin + this._dur; + }, + getFractionalTime(aPortion) { + return this._begin + aPortion * this._dur; + }, +}; + +/** + * Attribute: a container for information about an attribute we'll + * attempt to animate with SMIL in our tests. + * + * See also the factory methods below: NonAnimatableAttribute(), + * NonAdditiveAttribute(), and AdditiveAttribute(). + * + * @param aAttrName The name of the attribute + * @param aAttrType The type of the attribute ("CSS" vs "XML") + * @param aTargetTag The name of an element that this attribute could be + * applied to. + * @param aIsAnimatable A bool indicating whether this attribute is defined as + * animatable in the SVG spec. + * @param aIsAdditive A bool indicating whether this attribute is defined as + * additive (i.e. supports "by" animation) in the SVG spec. + */ +function Attribute( + aAttrName, + aAttrType, + aTargetTag, + aIsAnimatable, + aIsAdditive +) { + this.attrName = aAttrName; + this.attrType = aAttrType; + this.targetTag = aTargetTag; + this.isAnimatable = aIsAnimatable; + this.isAdditive = aIsAdditive; +} +Attribute.prototype = { + // Member variables + attrName: null, + attrType: null, + isAnimatable: null, + testcaseList: null, +}; + +// Generators for Attribute objects. These allow lists of attribute +// definitions to be more human-readible than if we were using Attribute() with +// boolean flags, e.g. "Attribute(..., true, true), Attribute(..., true, false) +function NonAnimatableAttribute(aAttrName, aAttrType, aTargetTag) { + return new Attribute(aAttrName, aAttrType, aTargetTag, false, false); +} +function NonAdditiveAttribute(aAttrName, aAttrType, aTargetTag) { + return new Attribute(aAttrName, aAttrType, aTargetTag, true, false); +} +function AdditiveAttribute(aAttrName, aAttrType, aTargetTag) { + return new Attribute(aAttrName, aAttrType, aTargetTag, true, true); +} + +/** + * TestcaseBundle: a container for a group of tests for a particular attribute + * + * @param aAttribute An Attribute object for the attribute + * @param aTestcaseList An array of AnimTestcase objects + */ +function TestcaseBundle(aAttribute, aTestcaseList, aSkipReason) { + this.animatedAttribute = aAttribute; + this.testcaseList = aTestcaseList; + this.skipReason = aSkipReason; +} +TestcaseBundle.prototype = { + // Member variables + animatedAttribute: null, + testcaseList: null, + skipReason: null, + + // Methods + go(aTimingData) { + if (this.skipReason) { + todo( + false, + "Skipping a bundle for '" + + this.animatedAttribute.attrName + + "' because: " + + this.skipReason + ); + } else { + // Sanity Check: Bundle should have > 0 testcases + if (!this.testcaseList || !this.testcaseList.length) { + ok( + false, + "a bundle for '" + + this.animatedAttribute.attrName + + "' has no testcases" + ); + } + + var targetElem = SMILUtil.getFirstElemWithTag( + this.animatedAttribute.targetTag + ); + + if (!targetElem) { + ok( + false, + "Error: can't find an element of type '" + + this.animatedAttribute.targetTag + + "', so I can't test property '" + + this.animatedAttribute.attrName + + "'" + ); + return; + } + + for (var testcaseIdx in this.testcaseList) { + var testcase = this.testcaseList[testcaseIdx]; + if (testcase.skipReason) { + todo( + false, + "Skipping a testcase for '" + + this.animatedAttribute.attrName + + "' because: " + + testcase.skipReason + ); + } else { + testcase.runTest( + targetElem, + this.animatedAttribute, + aTimingData, + false + ); + testcase.runTest( + targetElem, + this.animatedAttribute, + aTimingData, + true + ); + } + } + } + }, +}; + +/** + * AnimTestcase: an abstract class that represents an animation testcase. + * (e.g. a set of "from"/"to" values to test) + */ +function AnimTestcase() {} // abstract => no constructor +AnimTestcase.prototype = { + // Member variables + _animElementTagName: "animate", // Can be overridden for e.g. animateColor + computedValMap: null, + skipReason: null, + + // Methods + /** + * runTest: Runs this AnimTestcase + * + * @param aTargetElem The node to be targeted in our test animation. + * @param aTargetAttr An Attribute object representing the attribute + * to be targeted in our test animation. + * @param aTimeData A SMILTimingData object with timing information for + * our test animation. + * @param aIsFreeze If true, indicates that our test animation should use + * fill="freeze"; otherwise, we'll default to fill="remove". + */ + runTest(aTargetElem, aTargetAttr, aTimeData, aIsFreeze) { + // SANITY CHECKS + if (!SMILUtil.getSVGRoot().animationsPaused()) { + ok(false, "Should start each test with animations paused"); + } + if (SMILUtil.getSVGRoot().getCurrentTime() != 0) { + ok(false, "Should start each test at time = 0"); + } + + // SET UP + // Cache initial computed value + var baseVal = SMILUtil.getAttributeValue(aTargetElem, aTargetAttr); + + // Create & append animation element + var anim = this.setupAnimationElement(aTargetAttr, aTimeData, aIsFreeze); + aTargetElem.appendChild(anim); + + // Build a list of [seek-time, expectedValue, errorMessage] triplets + var seekList = this.buildSeekList( + aTargetAttr, + baseVal, + aTimeData, + aIsFreeze + ); + + // DO THE ACTUAL TESTING + this.seekAndTest(seekList, aTargetElem, aTargetAttr); + + // CLEAN UP + aTargetElem.removeChild(anim); + SMILUtil.getSVGRoot().setCurrentTime(0); + }, + + // HELPER FUNCTIONS + // setupAnimationElement: element + // Subclasses should extend this parent method + setupAnimationElement(aAnimAttr, aTimeData, aIsFreeze) { + var animElement = document.createElementNS( + SVG_NS, + this._animElementTagName + ); + animElement.setAttribute("attributeName", aAnimAttr.attrName); + animElement.setAttribute("attributeType", aAnimAttr.attrType); + animElement.setAttribute("begin", aTimeData.getBeginTime()); + animElement.setAttribute("dur", aTimeData.getDur()); + if (aIsFreeze) { + animElement.setAttribute("fill", "freeze"); + } + return animElement; + }, + + buildSeekList(aAnimAttr, aBaseVal, aTimeData, aIsFreeze) { + if (!aAnimAttr.isAnimatable) { + return this.buildSeekListStatic( + aAnimAttr, + aBaseVal, + aTimeData, + "defined as non-animatable in SVG spec" + ); + } + if (this.computedValMap.noEffect) { + return this.buildSeekListStatic( + aAnimAttr, + aBaseVal, + aTimeData, + "testcase specified to have no effect" + ); + } + return this.buildSeekListAnimated( + aAnimAttr, + aBaseVal, + aTimeData, + aIsFreeze + ); + }, + + seekAndTest(aSeekList, aTargetElem, aTargetAttr) { + var svg = document.getElementById("svg"); + for (var i in aSeekList) { + var entry = aSeekList[i]; + SMILUtil.getSVGRoot().setCurrentTime(entry[0]); + + // Bug 1379908: The computed value of stroke-* properties should be + // serialized with px units, but currently Gecko and Servo don't do that + // when animating these values. + if ( + ["stroke-width", "stroke-dasharray", "stroke-dashoffset"].includes( + aTargetAttr.attrName + ) + ) { + var attr = SMILUtil.stripPx( + SMILUtil.getAttributeValue(aTargetElem, aTargetAttr) + ); + var expectedVal = SMILUtil.stripPx(entry[1]); + is(attr, expectedVal, entry[2]); + return; + } + is( + SMILUtil.getAttributeValue(aTargetElem, aTargetAttr), + entry[1], + entry[2] + ); + } + }, + + // methods that expect to be overridden in subclasses + buildSeekListStatic(aAnimAttr, aBaseVal, aTimeData, aReasonStatic) {}, + buildSeekListAnimated(aAnimAttr, aBaseVal, aTimeData, aIsFreeze) {}, +}; + +// Abstract parent class to share code between from-to & from-by testcases. +function AnimTestcaseFrom() {} // abstract => no constructor +AnimTestcaseFrom.prototype = { + // Member variables + from: null, + + // Methods + setupAnimationElement(aAnimAttr, aTimeData, aIsFreeze) { + // Call super, and then add my own customization + var animElem = AnimTestcase.prototype.setupAnimationElement.apply(this, [ + aAnimAttr, + aTimeData, + aIsFreeze, + ]); + animElem.setAttribute("from", this.from); + return animElem; + }, + + buildSeekListStatic(aAnimAttr, aBaseVal, aTimeData, aReasonStatic) { + var seekList = new Array(); + var msgPrefix = + aAnimAttr.attrName + ": shouldn't be affected by animation "; + seekList.push([ + aTimeData.getBeginTime(), + aBaseVal, + msgPrefix + "(at animation begin) - " + aReasonStatic, + ]); + seekList.push([ + aTimeData.getFractionalTime(1 / 2), + aBaseVal, + msgPrefix + "(at animation mid) - " + aReasonStatic, + ]); + seekList.push([ + aTimeData.getEndTime(), + aBaseVal, + msgPrefix + "(at animation end) - " + aReasonStatic, + ]); + seekList.push([ + aTimeData.getEndTime() + aTimeData.getDur(), + aBaseVal, + msgPrefix + "(after animation end) - " + aReasonStatic, + ]); + return seekList; + }, + + buildSeekListAnimated(aAnimAttr, aBaseVal, aTimeData, aIsFreeze) { + var seekList = new Array(); + var msgPrefix = aAnimAttr.attrName + ": "; + if (aTimeData.getBeginTime() > 0.1) { + seekList.push([ + aTimeData.getBeginTime() - 0.1, + aBaseVal, + msgPrefix + + "checking that base value is set " + + "before start of animation", + ]); + } + + seekList.push([ + aTimeData.getBeginTime(), + this.computedValMap.fromComp || this.from, + msgPrefix + + "checking that 'from' value is set " + + "at start of animation", + ]); + seekList.push([ + aTimeData.getFractionalTime(1 / 2), + this.computedValMap.midComp || this.computedValMap.toComp || this.to, + msgPrefix + "checking value halfway through animation", + ]); + + var finalMsg; + var expectedEndVal; + if (aIsFreeze) { + expectedEndVal = this.computedValMap.toComp || this.to; + finalMsg = msgPrefix + "[freeze-mode] checking that final value is set "; + } else { + expectedEndVal = aBaseVal; + finalMsg = + msgPrefix + "[remove-mode] checking that animation is cleared "; + } + seekList.push([ + aTimeData.getEndTime(), + expectedEndVal, + finalMsg + "at end of animation", + ]); + seekList.push([ + aTimeData.getEndTime() + aTimeData.getDur(), + expectedEndVal, + finalMsg + "after end of animation", + ]); + return seekList; + }, +}; +extend(AnimTestcaseFrom, AnimTestcase); + +/* + * A testcase for a simple "from-to" animation + * @param aFrom The 'from' value + * @param aTo The 'to' value + * @param aComputedValMap A hash-map that contains some computed values, + * if they're needed, as follows: + * - fromComp: Computed value version of |aFrom| (if different from |aFrom|) + * - midComp: Computed value that we expect to visit halfway through the + * animation (if different from |aTo|) + * - toComp: Computed value version of |aTo| (if different from |aTo|) + * - noEffect: Special flag -- if set, indicates that this testcase is + * expected to have no effect on the computed value. (e.g. the + * given values are invalid.) + * @param aSkipReason If this test-case is known to currently fail, this + * parameter should be a string explaining why. + * Otherwise, this value should be null (or omitted). + * + */ +function AnimTestcaseFromTo(aFrom, aTo, aComputedValMap, aSkipReason) { + this.from = aFrom; + this.to = aTo; + this.computedValMap = aComputedValMap || {}; // Let aComputedValMap be omitted + this.skipReason = aSkipReason; +} +AnimTestcaseFromTo.prototype = { + // Member variables + to: null, + + // Methods + setupAnimationElement(aAnimAttr, aTimeData, aIsFreeze) { + // Call super, and then add my own customization + var animElem = AnimTestcaseFrom.prototype.setupAnimationElement.apply( + this, + [aAnimAttr, aTimeData, aIsFreeze] + ); + animElem.setAttribute("to", this.to); + return animElem; + }, +}; +extend(AnimTestcaseFromTo, AnimTestcaseFrom); + +/* + * A testcase for a simple "from-by" animation. + * + * @param aFrom The 'from' value + * @param aBy The 'by' value + * @param aComputedValMap A hash-map that contains some computed values that + * we expect to visit, as follows: + * - fromComp: Computed value version of |aFrom| (if different from |aFrom|) + * - midComp: Computed value that we expect to visit halfway through the + * animation (|aFrom| + |aBy|/2) + * - toComp: Computed value of the animation endpoint (|aFrom| + |aBy|) + * - noEffect: Special flag -- if set, indicates that this testcase is + * expected to have no effect on the computed value. (e.g. the + * given values are invalid. Or the attribute may be animatable + * and additive, but the particular "from" & "by" values that + * are used don't support addition.) + * @param aSkipReason If this test-case is known to currently fail, this + * parameter should be a string explaining why. + * Otherwise, this value should be null (or omitted). + */ +function AnimTestcaseFromBy(aFrom, aBy, aComputedValMap, aSkipReason) { + this.from = aFrom; + this.by = aBy; + this.computedValMap = aComputedValMap; + this.skipReason = aSkipReason; + if ( + this.computedValMap && + !this.computedValMap.noEffect && + !this.computedValMap.toComp + ) { + ok(false, "AnimTestcaseFromBy needs expected computed final value"); + } +} +AnimTestcaseFromBy.prototype = { + // Member variables + by: null, + + // Methods + setupAnimationElement(aAnimAttr, aTimeData, aIsFreeze) { + // Call super, and then add my own customization + var animElem = AnimTestcaseFrom.prototype.setupAnimationElement.apply( + this, + [aAnimAttr, aTimeData, aIsFreeze] + ); + animElem.setAttribute("by", this.by); + return animElem; + }, + buildSeekList(aAnimAttr, aBaseVal, aTimeData, aIsFreeze) { + if (!aAnimAttr.isAdditive) { + return this.buildSeekListStatic( + aAnimAttr, + aBaseVal, + aTimeData, + "defined as non-additive in SVG spec" + ); + } + // Just use inherited method + return AnimTestcaseFrom.prototype.buildSeekList.apply(this, [ + aAnimAttr, + aBaseVal, + aTimeData, + aIsFreeze, + ]); + }, +}; +extend(AnimTestcaseFromBy, AnimTestcaseFrom); + +/* + * A testcase for a "paced-mode" animation + * @param aValues An array of values, to be used as the "Values" list + * @param aComputedValMap A hash-map that contains some computed values, + * if they're needed, as follows: + * - comp0: The computed value at the start of the animation + * - comp1_6: The computed value exactly 1/6 through animation + * - comp1_3: The computed value exactly 1/3 through animation + * - comp2_3: The computed value exactly 2/3 through animation + * - comp1: The computed value of the animation endpoint + * The math works out easiest if... + * (a) aValuesString has 3 entries in its values list: vA, vB, vC + * (b) dist(vB, vC) = 2 * dist(vA, vB) + * With this setup, we can come up with expected intermediate values according + * to the following rules: + * - comp0 should be vA + * - comp1_6 should be us halfway between vA and vB + * - comp1_3 should be vB + * - comp2_3 should be halfway between vB and vC + * - comp1 should be vC + * @param aSkipReason If this test-case is known to currently fail, this + * parameter should be a string explaining why. + * Otherwise, this value should be null (or omitted). + */ +function AnimTestcasePaced(aValuesString, aComputedValMap, aSkipReason) { + this.valuesString = aValuesString; + this.computedValMap = aComputedValMap; + this.skipReason = aSkipReason; + if ( + this.computedValMap && + (!this.computedValMap.comp0 || + !this.computedValMap.comp1_6 || + !this.computedValMap.comp1_3 || + !this.computedValMap.comp2_3 || + !this.computedValMap.comp1) + ) { + ok(false, "This AnimTestcasePaced has an incomplete computed value map"); + } +} +AnimTestcasePaced.prototype = { + // Member variables + valuesString: null, + + // Methods + setupAnimationElement(aAnimAttr, aTimeData, aIsFreeze) { + // Call super, and then add my own customization + var animElem = AnimTestcase.prototype.setupAnimationElement.apply(this, [ + aAnimAttr, + aTimeData, + aIsFreeze, + ]); + animElem.setAttribute("values", this.valuesString); + animElem.setAttribute("calcMode", "paced"); + return animElem; + }, + buildSeekListAnimated(aAnimAttr, aBaseVal, aTimeData, aIsFreeze) { + var seekList = new Array(); + var msgPrefix = aAnimAttr.attrName + ": checking value "; + seekList.push([ + aTimeData.getBeginTime(), + this.computedValMap.comp0, + msgPrefix + "at start of animation", + ]); + seekList.push([ + aTimeData.getFractionalTime(1 / 6), + this.computedValMap.comp1_6, + msgPrefix + "1/6 of the way through animation.", + ]); + seekList.push([ + aTimeData.getFractionalTime(1 / 3), + this.computedValMap.comp1_3, + msgPrefix + "1/3 of the way through animation.", + ]); + seekList.push([ + aTimeData.getFractionalTime(2 / 3), + this.computedValMap.comp2_3, + msgPrefix + "2/3 of the way through animation.", + ]); + + var finalMsg; + var expectedEndVal; + if (aIsFreeze) { + expectedEndVal = this.computedValMap.comp1; + finalMsg = + aAnimAttr.attrName + + ": [freeze-mode] checking that final value is set "; + } else { + expectedEndVal = aBaseVal; + finalMsg = + aAnimAttr.attrName + + ": [remove-mode] checking that animation is cleared "; + } + seekList.push([ + aTimeData.getEndTime(), + expectedEndVal, + finalMsg + "at end of animation", + ]); + seekList.push([ + aTimeData.getEndTime() + aTimeData.getDur(), + expectedEndVal, + finalMsg + "after end of animation", + ]); + return seekList; + }, + buildSeekListStatic(aAnimAttr, aBaseVal, aTimeData, aReasonStatic) { + var seekList = new Array(); + var msgPrefix = + aAnimAttr.attrName + ": shouldn't be affected by animation "; + seekList.push([ + aTimeData.getBeginTime(), + aBaseVal, + msgPrefix + "(at animation begin) - " + aReasonStatic, + ]); + seekList.push([ + aTimeData.getFractionalTime(1 / 6), + aBaseVal, + msgPrefix + "(1/6 of the way through animation) - " + aReasonStatic, + ]); + seekList.push([ + aTimeData.getFractionalTime(1 / 3), + aBaseVal, + msgPrefix + "(1/3 of the way through animation) - " + aReasonStatic, + ]); + seekList.push([ + aTimeData.getFractionalTime(2 / 3), + aBaseVal, + msgPrefix + "(2/3 of the way through animation) - " + aReasonStatic, + ]); + seekList.push([ + aTimeData.getEndTime(), + aBaseVal, + msgPrefix + "(at animation end) - " + aReasonStatic, + ]); + seekList.push([ + aTimeData.getEndTime() + aTimeData.getDur(), + aBaseVal, + msgPrefix + "(after animation end) - " + aReasonStatic, + ]); + return seekList; + }, +}; +extend(AnimTestcasePaced, AnimTestcase); + +/* + * A testcase for an animation. + * + * @param aAttrValueHash A hash-map mapping attribute names to values. + * Should include at least 'path', 'values', 'to' + * or 'by' to describe the motion path. + * @param aCtmMap A hash-map that contains summaries of the expected resulting + * CTM at various points during the animation. The CTM is + * summarized as a tuple of three numbers: [tX, tY, theta] + (indicating a translate(tX,tY) followed by a rotate(theta)) + * - ctm0: The CTM summary at the start of the animation + * - ctm1_6: The CTM summary at exactly 1/6 through animation + * - ctm1_3: The CTM summary at exactly 1/3 through animation + * - ctm2_3: The CTM summary at exactly 2/3 through animation + * - ctm1: The CTM summary at the animation endpoint + * + * NOTE: For paced-mode animation (the default for animateMotion), the math + * works out easiest if: + * (a) our motion path has 3 points: vA, vB, vC + * (b) dist(vB, vC) = 2 * dist(vA, vB) + * (See discussion in header comment for AnimTestcasePaced.) + * + * @param aSkipReason If this test-case is known to currently fail, this + * parameter should be a string explaining why. + * Otherwise, this value should be null (or omitted). + */ +function AnimMotionTestcase(aAttrValueHash, aCtmMap, aSkipReason) { + this.attrValueHash = aAttrValueHash; + this.ctmMap = aCtmMap; + this.skipReason = aSkipReason; + if ( + this.ctmMap && + (!this.ctmMap.ctm0 || + !this.ctmMap.ctm1_6 || + !this.ctmMap.ctm1_3 || + !this.ctmMap.ctm2_3 || + !this.ctmMap.ctm1) + ) { + ok(false, "This AnimMotionTestcase has an incomplete CTM map"); + } +} +AnimMotionTestcase.prototype = { + // Member variables + _animElementTagName: "animateMotion", + + // Implementations of inherited methods that we need to override: + // -------------------------------------------------------------- + setupAnimationElement(aAnimAttr, aTimeData, aIsFreeze) { + var animElement = document.createElementNS( + SVG_NS, + this._animElementTagName + ); + animElement.setAttribute("begin", aTimeData.getBeginTime()); + animElement.setAttribute("dur", aTimeData.getDur()); + if (aIsFreeze) { + animElement.setAttribute("fill", "freeze"); + } + for (var attrName in this.attrValueHash) { + if (attrName == "mpath") { + this.createPath(this.attrValueHash[attrName]); + this.createMpath(animElement); + } else { + animElement.setAttribute(attrName, this.attrValueHash[attrName]); + } + } + return animElement; + }, + + createPath(aPathDescription) { + var path = document.createElementNS(SVG_NS, "path"); + path.setAttribute("d", aPathDescription); + path.setAttribute("id", MPATH_TARGET_ID); + return SMILUtil.getSVGRoot().appendChild(path); + }, + + createMpath(aAnimElement) { + var mpath = document.createElementNS(SVG_NS, "mpath"); + mpath.setAttributeNS(XLINK_NS, "href", "#" + MPATH_TARGET_ID); + return aAnimElement.appendChild(mpath); + }, + + // Override inherited seekAndTest method since... + // (a) it expects a computedValMap and we have a computed-CTM map instead + // and (b) it expects we might have no effect (for non-animatable attrs) + buildSeekList(aAnimAttr, aBaseVal, aTimeData, aIsFreeze) { + var seekList = new Array(); + var msgPrefix = "CTM mismatch "; + seekList.push([ + aTimeData.getBeginTime(), + CTMUtil.generateCTM(this.ctmMap.ctm0), + msgPrefix + "at start of animation", + ]); + seekList.push([ + aTimeData.getFractionalTime(1 / 6), + CTMUtil.generateCTM(this.ctmMap.ctm1_6), + msgPrefix + "1/6 of the way through animation.", + ]); + seekList.push([ + aTimeData.getFractionalTime(1 / 3), + CTMUtil.generateCTM(this.ctmMap.ctm1_3), + msgPrefix + "1/3 of the way through animation.", + ]); + seekList.push([ + aTimeData.getFractionalTime(2 / 3), + CTMUtil.generateCTM(this.ctmMap.ctm2_3), + msgPrefix + "2/3 of the way through animation.", + ]); + + var finalMsg; + var expectedEndVal; + if (aIsFreeze) { + expectedEndVal = CTMUtil.generateCTM(this.ctmMap.ctm1); + finalMsg = + aAnimAttr.attrName + + ": [freeze-mode] checking that final value is set "; + } else { + expectedEndVal = aBaseVal; + finalMsg = + aAnimAttr.attrName + + ": [remove-mode] checking that animation is cleared "; + } + seekList.push([ + aTimeData.getEndTime(), + expectedEndVal, + finalMsg + "at end of animation", + ]); + seekList.push([ + aTimeData.getEndTime() + aTimeData.getDur(), + expectedEndVal, + finalMsg + "after end of animation", + ]); + return seekList; + }, + + // Override inherited seekAndTest method + // (Have to use assertCTMEqual() instead of is() for comparison, to check each + // component of the CTM and to allow for a small margin of error.) + seekAndTest(aSeekList, aTargetElem, aTargetAttr) { + var svg = document.getElementById("svg"); + for (var i in aSeekList) { + var entry = aSeekList[i]; + SMILUtil.getSVGRoot().setCurrentTime(entry[0]); + CTMUtil.assertCTMEqual( + aTargetElem.getCTM(), + entry[1], + CTMUtil.CTM_COMPONENTS_ALL, + entry[2], + false + ); + } + }, + + // Override "runTest" method so we can remove any element that we + // created at the end of each test. + runTest(aTargetElem, aTargetAttr, aTimeData, aIsFreeze) { + AnimTestcase.prototype.runTest.apply(this, [ + aTargetElem, + aTargetAttr, + aTimeData, + aIsFreeze, + ]); + var pathElem = document.getElementById(MPATH_TARGET_ID); + if (pathElem) { + SMILUtil.getSVGRoot().removeChild(pathElem); + } + }, +}; +extend(AnimMotionTestcase, AnimTestcase); + +// MAIN METHOD +function testBundleList(aBundleList, aTimingData) { + for (var bundleIdx in aBundleList) { + aBundleList[bundleIdx].go(aTimingData); + } +} diff --git a/dom/smil/test/smilXHR_helper.svg b/dom/smil/test/smilXHR_helper.svg new file mode 100644 index 0000000000..cb0b51c360 --- /dev/null +++ b/dom/smil/test/smilXHR_helper.svg @@ -0,0 +1,8 @@ + + + + + + diff --git a/dom/smil/test/test_smilAccessKey.xhtml b/dom/smil/test/test_smilAccessKey.xhtml new file mode 100644 index 0000000000..5910dc1c27 --- /dev/null +++ b/dom/smil/test/test_smilAccessKey.xhtml @@ -0,0 +1,79 @@ + + + Test for SMIL accessKey support + + + + +Mozilla Bug + 587910 +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilAdditionFallback.html b/dom/smil/test/test_smilAdditionFallback.html new file mode 100644 index 0000000000..a73457728c --- /dev/null +++ b/dom/smil/test/test_smilAdditionFallback.html @@ -0,0 +1,30 @@ + + + + + + +

+
+ + + + + +
+
+
+
diff --git a/dom/smil/test/test_smilAnimateMotion.xhtml b/dom/smil/test/test_smilAnimateMotion.xhtml new file mode 100644 index 0000000000..68ac7fb96a --- /dev/null +++ b/dom/smil/test/test_smilAnimateMotion.xhtml @@ -0,0 +1,51 @@ + + + + Test for animateMotion behavior + + + + + + +Mozilla Bug 436418 +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilAnimateMotionInvalidValues.xhtml b/dom/smil/test/test_smilAnimateMotionInvalidValues.xhtml new file mode 100644 index 0000000000..c2d72e5435 --- /dev/null +++ b/dom/smil/test/test_smilAnimateMotionInvalidValues.xhtml @@ -0,0 +1,176 @@ + + + + Test for animateMotion acceptance of invalid values + + + + + diff --git a/dom/smil/test/test_smilAnimateMotionOverrideRules.xhtml b/dom/smil/test/test_smilAnimateMotionOverrideRules.xhtml new file mode 100644 index 0000000000..3a147cd094 --- /dev/null +++ b/dom/smil/test/test_smilAnimateMotionOverrideRules.xhtml @@ -0,0 +1,215 @@ + + + + Test for overriding of path-defining attributes for animateMotion + + + + + diff --git a/dom/smil/test/test_smilBackwardsSeeking.xhtml b/dom/smil/test/test_smilBackwardsSeeking.xhtml new file mode 100644 index 0000000000..20974e6de3 --- /dev/null +++ b/dom/smil/test/test_smilBackwardsSeeking.xhtml @@ -0,0 +1,191 @@ + + + Test for backwards seeking behavior + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilCSSFontStretchRelative.xhtml b/dom/smil/test/test_smilCSSFontStretchRelative.xhtml new file mode 100644 index 0000000000..01988a881b --- /dev/null +++ b/dom/smil/test/test_smilCSSFontStretchRelative.xhtml @@ -0,0 +1,102 @@ + + + Test for Animation Behavior on CSS Properties + + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilCSSFromBy.xhtml b/dom/smil/test/test_smilCSSFromBy.xhtml new file mode 100644 index 0000000000..586305fb8a --- /dev/null +++ b/dom/smil/test/test_smilCSSFromBy.xhtml @@ -0,0 +1,49 @@ + + + Test for Animation Behavior on CSS Properties + + + + + + + +

+
+ + + + testing 123 + + + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilCSSFromTo.xhtml b/dom/smil/test/test_smilCSSFromTo.xhtml new file mode 100644 index 0000000000..501adbc4a8 --- /dev/null +++ b/dom/smil/test/test_smilCSSFromTo.xhtml @@ -0,0 +1,76 @@ + + + Test for Animation Behavior on CSS Properties + + + + + + + +

+
+ + + + testing 123 + + + + + + + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilCSSInherit.xhtml b/dom/smil/test/test_smilCSSInherit.xhtml new file mode 100644 index 0000000000..4e262d3aa9 --- /dev/null +++ b/dom/smil/test/test_smilCSSInherit.xhtml @@ -0,0 +1,85 @@ + + + Test for Animation Behavior on CSS Properties + + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilCSSInvalidValues.xhtml b/dom/smil/test/test_smilCSSInvalidValues.xhtml new file mode 100644 index 0000000000..5e8e682af9 --- /dev/null +++ b/dom/smil/test/test_smilCSSInvalidValues.xhtml @@ -0,0 +1,59 @@ + + + Test for Animation Behavior on CSS Properties + + + + + + +

+
+ + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilCSSPaced.xhtml b/dom/smil/test/test_smilCSSPaced.xhtml new file mode 100644 index 0000000000..1f6b3509ae --- /dev/null +++ b/dom/smil/test/test_smilCSSPaced.xhtml @@ -0,0 +1,44 @@ + + + Test for Animation Behavior on CSS Properties + + + + + + + +

+
+ + + testing 123 + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilChangeAfterFrozen.xhtml b/dom/smil/test/test_smilChangeAfterFrozen.xhtml new file mode 100644 index 0000000000..97fe131678 --- /dev/null +++ b/dom/smil/test/test_smilChangeAfterFrozen.xhtml @@ -0,0 +1,571 @@ + + + Test for SMIL when things change after an animation is frozen + + + + + +Mozilla Bug 533291 +

+ + +
+
+
+ + diff --git a/dom/smil/test/test_smilConditionalProcessing.html b/dom/smil/test/test_smilConditionalProcessing.html new file mode 100644 index 0000000000..302c445b6e --- /dev/null +++ b/dom/smil/test/test_smilConditionalProcessing.html @@ -0,0 +1,93 @@ + + + + + Test conditional processing tests applied to animations + + + + +

+
+ + + + + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilContainerBinding.xhtml b/dom/smil/test/test_smilContainerBinding.xhtml new file mode 100644 index 0000000000..20e1013d4b --- /dev/null +++ b/dom/smil/test/test_smilContainerBinding.xhtml @@ -0,0 +1,101 @@ + + + + Test for adding and removing animations from a time container + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilCrossContainer.xhtml b/dom/smil/test/test_smilCrossContainer.xhtml new file mode 100644 index 0000000000..e4d30ef26d --- /dev/null +++ b/dom/smil/test/test_smilCrossContainer.xhtml @@ -0,0 +1,132 @@ + + + + Test for moving animations between time containers + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilDynamicDelayedBeginElement.xhtml b/dom/smil/test/test_smilDynamicDelayedBeginElement.xhtml new file mode 100644 index 0000000000..10da496454 --- /dev/null +++ b/dom/smil/test/test_smilDynamicDelayedBeginElement.xhtml @@ -0,0 +1,103 @@ + + + + Test for Bug 699143 + + + + + +Mozilla Bug 699143 +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilExtDoc.xhtml b/dom/smil/test/test_smilExtDoc.xhtml new file mode 100644 index 0000000000..0323cbfb77 --- /dev/null +++ b/dom/smil/test/test_smilExtDoc.xhtml @@ -0,0 +1,80 @@ + + + + Test for Bug 628888 - Animations in external document sometimes don't run + + + + +Mozilla Bug 628888 +

+
+ +
+
+
+ + diff --git a/dom/smil/test/test_smilFillMode.xhtml b/dom/smil/test/test_smilFillMode.xhtml new file mode 100644 index 0000000000..ed270863bd --- /dev/null +++ b/dom/smil/test/test_smilFillMode.xhtml @@ -0,0 +1,86 @@ + + + Test for SMIL fill modes + + + + +

+
+ + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilGetSimpleDuration.xhtml b/dom/smil/test/test_smilGetSimpleDuration.xhtml new file mode 100644 index 0000000000..e36922c34a --- /dev/null +++ b/dom/smil/test/test_smilGetSimpleDuration.xhtml @@ -0,0 +1,84 @@ + + + Test for getSimpleDuration Behavior + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilGetStartTime.xhtml b/dom/smil/test/test_smilGetStartTime.xhtml new file mode 100644 index 0000000000..f854dd7cd9 --- /dev/null +++ b/dom/smil/test/test_smilGetStartTime.xhtml @@ -0,0 +1,103 @@ + + + Test for getStartTime Behavior + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilHyperlinking.xhtml b/dom/smil/test/test_smilHyperlinking.xhtml new file mode 100644 index 0000000000..49e9e7f7b0 --- /dev/null +++ b/dom/smil/test/test_smilHyperlinking.xhtml @@ -0,0 +1,229 @@ + + + Test for hyperlinking + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilInvalidValues.html b/dom/smil/test/test_smilInvalidValues.html new file mode 100644 index 0000000000..29ddfad39a --- /dev/null +++ b/dom/smil/test/test_smilInvalidValues.html @@ -0,0 +1,122 @@ + + + + + + Test invalid values cause the model to be updated (bug 941315) + + + + +Mozilla Bug 941315 +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilKeySplines.xhtml b/dom/smil/test/test_smilKeySplines.xhtml new file mode 100644 index 0000000000..c12f6f1e09 --- /dev/null +++ b/dom/smil/test/test_smilKeySplines.xhtml @@ -0,0 +1,296 @@ + + + Test for SMIL keySplines + + + + +

+
+ + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilKeyTimes.xhtml b/dom/smil/test/test_smilKeyTimes.xhtml new file mode 100644 index 0000000000..43d3c91895 --- /dev/null +++ b/dom/smil/test/test_smilKeyTimes.xhtml @@ -0,0 +1,391 @@ + + + Test for SMIL keyTimes + + + + +Mozilla Bug + 557885 +

+
+ + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilKeyTimesPacedMode.xhtml b/dom/smil/test/test_smilKeyTimesPacedMode.xhtml new file mode 100644 index 0000000000..f2d6571fa8 --- /dev/null +++ b/dom/smil/test/test_smilKeyTimesPacedMode.xhtml @@ -0,0 +1,123 @@ + + + Tests updated intervals + + + + +Mozilla Bug 555026 +

+
+ + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilMappedAttrFromBy.xhtml b/dom/smil/test/test_smilMappedAttrFromBy.xhtml new file mode 100644 index 0000000000..5b70b5b83f --- /dev/null +++ b/dom/smil/test/test_smilMappedAttrFromBy.xhtml @@ -0,0 +1,51 @@ + + + Test for Animation Behavior on CSS Properties + + + + + + + + +

+
+ + + + testing 123 + + + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilMappedAttrFromTo.xhtml b/dom/smil/test/test_smilMappedAttrFromTo.xhtml new file mode 100644 index 0000000000..57ef83800e --- /dev/null +++ b/dom/smil/test/test_smilMappedAttrFromTo.xhtml @@ -0,0 +1,79 @@ + + + Test for Animation Behavior on CSS Properties + + + + + + + + +

+
+ + + + testing 123 + + + + + + + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilMappedAttrPaced.xhtml b/dom/smil/test/test_smilMappedAttrPaced.xhtml new file mode 100644 index 0000000000..81adea6390 --- /dev/null +++ b/dom/smil/test/test_smilMappedAttrPaced.xhtml @@ -0,0 +1,46 @@ + + + Test for Animation Behavior on CSS Properties + + + + + + + + +

+
+ + + testing 123 + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilMinTiming.html b/dom/smil/test/test_smilMinTiming.html new file mode 100644 index 0000000000..f0bdd42502 --- /dev/null +++ b/dom/smil/test/test_smilMinTiming.html @@ -0,0 +1,93 @@ + + + + + + Test for Bug 948245 + + + + +Mozilla Bug 948245 +

+
+ + + + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilRepeatDuration.html b/dom/smil/test/test_smilRepeatDuration.html new file mode 100644 index 0000000000..b746bb45d4 --- /dev/null +++ b/dom/smil/test/test_smilRepeatDuration.html @@ -0,0 +1,139 @@ + + + + + + Test for repeat duration calculation (Bug 948245) + + + + +Mozilla Bug 948245 +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilRepeatTiming.xhtml b/dom/smil/test/test_smilRepeatTiming.xhtml new file mode 100644 index 0000000000..ace63d37b0 --- /dev/null +++ b/dom/smil/test/test_smilRepeatTiming.xhtml @@ -0,0 +1,96 @@ + + + + Test repeat timing + + + + +Mozilla Bug + 485157 +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilReset.xhtml b/dom/smil/test/test_smilReset.xhtml new file mode 100644 index 0000000000..a53f73c112 --- /dev/null +++ b/dom/smil/test/test_smilReset.xhtml @@ -0,0 +1,82 @@ + + + Tests for SMIL Reset Behavior + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilRestart.xhtml b/dom/smil/test/test_smilRestart.xhtml new file mode 100644 index 0000000000..3e03dfdbcc --- /dev/null +++ b/dom/smil/test/test_smilRestart.xhtml @@ -0,0 +1,102 @@ + + + Test for SMIL Restart Behavior + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilSetCurrentTime.xhtml b/dom/smil/test/test_smilSetCurrentTime.xhtml new file mode 100644 index 0000000000..91ded84c8c --- /dev/null +++ b/dom/smil/test/test_smilSetCurrentTime.xhtml @@ -0,0 +1,76 @@ + + + Test for setCurrentTime Behavior + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilSync.xhtml b/dom/smil/test/test_smilSync.xhtml new file mode 100644 index 0000000000..36b2a91198 --- /dev/null +++ b/dom/smil/test/test_smilSync.xhtml @@ -0,0 +1,255 @@ + + + Test for SMIL sync behaviour + + + + +

+
+ + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilSyncTransform.xhtml b/dom/smil/test/test_smilSyncTransform.xhtml new file mode 100644 index 0000000000..79c5cbf0b9 --- /dev/null +++ b/dom/smil/test/test_smilSyncTransform.xhtml @@ -0,0 +1,66 @@ + + + Test for SMIL sync behaviour for transform types + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilSyncbaseTarget.xhtml b/dom/smil/test/test_smilSyncbaseTarget.xhtml new file mode 100644 index 0000000000..496cb6751e --- /dev/null +++ b/dom/smil/test/test_smilSyncbaseTarget.xhtml @@ -0,0 +1,180 @@ + + + + Test for syncbase targetting + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilTextZoom.xhtml b/dom/smil/test/test_smilTextZoom.xhtml new file mode 100644 index 0000000000..5f65bd778e --- /dev/null +++ b/dom/smil/test/test_smilTextZoom.xhtml @@ -0,0 +1,99 @@ + + + Test for SMIL Animation Behavior with textZoom + + + + + +

+
+ + + abc + + + + + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilTiming.xhtml b/dom/smil/test/test_smilTiming.xhtml new file mode 100644 index 0000000000..0dc8525382 --- /dev/null +++ b/dom/smil/test/test_smilTiming.xhtml @@ -0,0 +1,291 @@ + + + Test for SMIL timing + + + + +

+
+ + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilTimingZeroIntervals.xhtml b/dom/smil/test/test_smilTimingZeroIntervals.xhtml new file mode 100644 index 0000000000..d54b74600b --- /dev/null +++ b/dom/smil/test/test_smilTimingZeroIntervals.xhtml @@ -0,0 +1,285 @@ + + + Test for SMIL timing with zero-duration intervals + + + + +

+
+ + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilUpdatedInterval.xhtml b/dom/smil/test/test_smilUpdatedInterval.xhtml new file mode 100644 index 0000000000..3045a815de --- /dev/null +++ b/dom/smil/test/test_smilUpdatedInterval.xhtml @@ -0,0 +1,64 @@ + + + Tests updated intervals + + + + +

+ +
+
+
+ + diff --git a/dom/smil/test/test_smilValues.xhtml b/dom/smil/test/test_smilValues.xhtml new file mode 100644 index 0000000000..b25a153472 --- /dev/null +++ b/dom/smil/test/test_smilValues.xhtml @@ -0,0 +1,171 @@ + + + Test for SMIL values + + + + +Mozilla Bug + 474742 +

+
+ + + +
+
+
+
+ + diff --git a/dom/smil/test/test_smilWithTransition.html b/dom/smil/test/test_smilWithTransition.html new file mode 100644 index 0000000000..4378841f50 --- /dev/null +++ b/dom/smil/test/test_smilWithTransition.html @@ -0,0 +1,14 @@ + + + + + + +
+
+
diff --git a/dom/smil/test/test_smilWithXlink.xhtml b/dom/smil/test/test_smilWithXlink.xhtml
new file mode 100644
index 0000000000..46ac0f12ef
--- /dev/null
+++ b/dom/smil/test/test_smilWithXlink.xhtml
@@ -0,0 +1,47 @@
+
+
+  Test for animate with xlink:href attribute.
+  
+  
+  
+
+
+

+
+ + + +
+
+
+ + diff --git a/dom/smil/test/test_smilXHR.xhtml b/dom/smil/test/test_smilXHR.xhtml new file mode 100644 index 0000000000..eb0f84268c --- /dev/null +++ b/dom/smil/test/test_smilXHR.xhtml @@ -0,0 +1,88 @@ + + + Test for SMIL Behavior in Data Documents + + + + + +Mozilla Bug 529387 +

+ +
+
+
+ + -- cgit v1.2.3