summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-values/calc-infinity-nan-serialize-time.html
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 /testing/web-platform/tests/css/css-values/calc-infinity-nan-serialize-time.html
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 'testing/web-platform/tests/css/css-values/calc-infinity-nan-serialize-time.html')
-rw-r--r--testing/web-platform/tests/css/css-values/calc-infinity-nan-serialize-time.html54
1 files changed, 54 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-values/calc-infinity-nan-serialize-time.html b/testing/web-platform/tests/css/css-values/calc-infinity-nan-serialize-time.html
new file mode 100644
index 0000000000..2baa890259
--- /dev/null
+++ b/testing/web-platform/tests/css/css-values/calc-infinity-nan-serialize-time.html
@@ -0,0 +1,54 @@
+<!DOCTYPE HTML>
+<title>Infinity and NaN: calc() serialization for time values.</title>
+<link rel="author" title="Seokho Song" href="mailto:0xdevssh@gmail.com">
+<link rel="help" href="https://drafts.csswg.org/css-values/#calc-type-checking">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../support/serialize-testcommon.js"></script>
+<div id="target"></div>
+<div id="log"></div>
+<script>
+function test_serialization(t,s, {prop="animationDuration"}={}) {
+ test_specified_serialization(prop, t, s)
+}
+//TEST CASE | EXPECTED
+var test_map = {
+ "1s * NaN" :"calc(NaN * 1s)",
+ "1s * nan" :"calc(NaN * 1s)",
+ "1ms * NaN" :"calc(NaN * 1s)",
+ "1s * infinity / infinity" :"calc(NaN * 1s)",
+ "1s * 0 * infinity" :"calc(NaN * 1s)",
+ "1s * (infinity + -infinity)" :"calc(NaN * 1s)",
+ "1s * (-infinity + infinity)" :"calc(NaN * 1s)",
+ "1s * (infinity - infinity)" :"calc(NaN * 1s)",
+ "1s * infinity" :"calc(infinity * 1s)",
+ "1s * -infinity" :"calc(-infinity * 1s)",
+ "1s * iNFinIty" :"calc(infinity * 1s)",
+ "1s * (infinity + infinity)" :"calc(infinity * 1s)",
+ "1s * (-infinity + -infinity)" :"calc(-infinity * 1s)",
+ "1s * 1/infinity" :"calc(0s)",
+ "1s * infinity * infinity" :"calc(infinity * 1s)",
+ "1s * -infinity * -infinity" :"calc(infinity * 1s)",
+ "1 * max(INFinity*3s, 0s)" :"calc(infinity * 1s)",
+ "1 * min(inFInity*4s, 0s)" :"calc(0s)",
+ "1 * max(nAn*2s, 0s)" :"calc(NaN * 1s)",
+ "1 * min(nan*3s, 0s)" :"calc(NaN * 1s)",
+ "1 * clamp(-INFINITY*20s, 0s, infiniTY*10s)" :"calc(0s)",
+
+ "1s * max(NaN, min(0,10))" :"calc(NaN * 1s)",
+ "1s * clamp(NaN, 0, 10)" :"calc(NaN * 1s)",
+
+ "1s * max(0, min(10, NaN))" :"calc(NaN * 1s)",
+ "1s * clamp(0, 10, NaN)" :"calc(NaN * 1s)",
+
+ "1s * max(0, min(NaN, 10))" :"calc(NaN * 1s)",
+ "1s * clamp(0, NaN, 10)" :"calc(NaN * 1s)",
+
+ "1s * clamp(-Infinity, 0, infinity)" :"calc(0s)",
+ "1s * clamp(-inFinity, infinity, 10)" :"calc(10s)",
+};
+
+for (var exp in test_map) {
+ test_serialization("calc("+exp+")", test_map[exp]);
+}
+</script> \ No newline at end of file