summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/forms/the-progress-element/progress.window.js
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/html/semantics/forms/the-progress-element/progress.window.js')
-rw-r--r--testing/web-platform/tests/html/semantics/forms/the-progress-element/progress.window.js18
1 files changed, 18 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/semantics/forms/the-progress-element/progress.window.js b/testing/web-platform/tests/html/semantics/forms/the-progress-element/progress.window.js
new file mode 100644
index 0000000000..37526053de
--- /dev/null
+++ b/testing/web-platform/tests/html/semantics/forms/the-progress-element/progress.window.js
@@ -0,0 +1,18 @@
+test(() => {
+ const pr = document.createElement("progress");
+ assert_equals(pr.value, 0);
+ assert_equals(pr.position, -1);
+ pr.value = 2;
+ assert_equals(pr.value, 1);
+ assert_equals(pr.position, 1);
+}, "If value > max, then current value = max");
+
+test(() => {
+ const pr = document.createElement("progress");
+ pr.value = 2;
+ assert_equals(pr.value, 1);
+ assert_equals(pr.position, 1);
+ pr.max = 4;
+ assert_equals(pr.value, 2);
+ assert_equals(pr.position, 0.5);
+}, "If value < max, then current value = value");