summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/css/css-values/progress-computed.tentative.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/css/css-values/progress-computed.tentative.html
parentInitial commit. (diff)
downloadfirefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz
firefox-26a029d407be480d791972afb5975cf62c9360a6.zip
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-values/progress-computed.tentative.html')
-rw-r--r--testing/web-platform/tests/css/css-values/progress-computed.tentative.html38
1 files changed, 38 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-values/progress-computed.tentative.html b/testing/web-platform/tests/css/css-values/progress-computed.tentative.html
new file mode 100644
index 0000000000..933d7075c1
--- /dev/null
+++ b/testing/web-platform/tests/css/css-values/progress-computed.tentative.html
@@ -0,0 +1,38 @@
+<!DOCTYPE html>
+<link rel="help" href="https://drafts.csswg.org/css-values-5/#progress">
+<link rel="author" title="sakhapov@chromuim.org">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+<script src="../support/numeric-testcommon.js"></script>
+<div id="target"></div>
+<script>
+
+// Identity tests
+test_math_used('progress(1 from 0 to 1)', '1', {type:'number'});
+
+// Nestings
+test_math_used('progress(progress(1 from 0 to 1) from progress(0px from 0px to 1px) to progress(1deg from 0deg to 1deg))', '1', {type:'number'});
+test_math_used('progress(sign(-10px) * 10px from (10px - 10px) to 10px * progress(1deg from 0deg to 1deg))', '-1', {type:'number'});
+
+// General calculations
+test_math_used('calc(progress(100px from 0px to 50px) * 10px + 100px)', '120px');
+test_math_used('calc(progress(100 from 0 to sign(50px)))', '100', {type:'number'});
+test_math_used('calc(progress(abs(5%) from hypot(3%, 4%) to 10%))', '0', {type:'number', approx:0.001});
+test_math_used('progress(1000em from 10em to 110em)', '9.9', {type:'number', approx:0.1});
+test_math_used('scale(progress(1000em from 10rem to 110em))', 'scale(9.9)', {prop:'transform', type:'number', approx:0.1});
+test_math_used('scale(progress(0em from 0rem to 0em))', 'scale(0)', {prop:'transform', type:'number'});
+test_math_used('scale(progress(sign(1em - 1rem) * 1ex from 0rem to 0em))', 'scale(0)', {prop:'transform', type:'number'});
+
+// Type checking
+test_math_used('calc(progress(1 from 0 to 1) * 10px)', '10px');
+test_math_used('calc(progress(1 from 0 to 1) * 1s)', '1s', {type:'time'});
+test_math_used('calc(progress(1 from 0 to 1) * 1deg)', '1deg', {type:'angle', approx:0.001});
+
+// Test different number accepting properties
+test_math_used('calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 10em from 2rem to 12em) / 2)', '0.4', {prop:'opacity', type:'number'});
+test_math_used('calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 20em from 2rem to 12em) * 10)', '18', {prop:'order', type:'number'});
+test_math_used('calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 20em from 2rem to 12em) * 30)', '54', {prop:'flex-grow', type:'number'});
+test_math_used('calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 20em from 2rem to 12em) / 4)', '0.45', {prop:'flex-grow', type:'number'});
+test_math_used('calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 20em from 2rem to 12em) * 4)', '7', {prop:'column-count', type:'number'});
+test_math_used('calc(progress(sign(1001em - 10lh * progress(100px from 2rex to 10ex)) * 20em from 2rem to 12em) * 2)', '3.6', {prop:'scale'});
+</script>