summaryrefslogtreecommitdiffstats
path: root/dom/smil/test/smilAnimateMotionValueLists.js
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 17:32:43 +0000
commit6bf0a5cb5034a7e684dcc3500e841785237ce2dd (patch)
treea68f146d7fa01f0134297619fbe7e33db084e0aa /dom/smil/test/smilAnimateMotionValueLists.js
parentInitial commit. (diff)
downloadthunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.tar.xz
thunderbird-6bf0a5cb5034a7e684dcc3500e841785237ce2dd.zip
Adding upstream version 1:115.7.0.upstream/1%115.7.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/smil/test/smilAnimateMotionValueLists.js')
-rw-r--r--dom/smil/test/smilAnimateMotionValueLists.js116
1 files changed, 116 insertions, 0 deletions
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 <animateMotion> 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",
+];