summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/scripting
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/html/scripting
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/html/scripting')
-rw-r--r--testing/web-platform/tests/html/scripting/the-script-element/attr-script-fetchpriority.html26
-rw-r--r--testing/web-platform/tests/html/scripting/the-script-element/resources/script.js0
2 files changed, 26 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/scripting/the-script-element/attr-script-fetchpriority.html b/testing/web-platform/tests/html/scripting/the-script-element/attr-script-fetchpriority.html
new file mode 100644
index 0000000000..738c9eab74
--- /dev/null
+++ b/testing/web-platform/tests/html/scripting/the-script-element/attr-script-fetchpriority.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<title>Fetch Priority - Script element</title>
+<meta name="author" title="Patrick Meenan" href="mailto:patmeenan@gmail.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<script id=script1 src="resources/script.js" fetchpriority=high></script>
+<script id=script2 src="resources/script.js" fetchpriority=low></script>
+<script id=script3 src="resources/script.js" fetchpriority=auto></script>
+<script id=script4 src="resources/script.js" fetchpriority=xyz></script>
+<script id=script5 src="resources/script.js"></script>
+
+<script>
+ test(() => {
+ assert_equals(script1.fetchPriority, "high", "high fetchPriority is a valid IDL value on the script element");
+ assert_equals(script2.fetchPriority, "low", "low fetchPriority is a valid IDL value on the script element");
+ assert_equals(script3.fetchPriority, "auto", "auto fetchPriority is a valid IDL value on the script element");
+ assert_equals(script4.fetchPriority, "auto", "invalid fetchPriority reflects as 'auto' IDL attribute on the script element");
+ assert_equals(script5.fetchPriority, "auto", "missing fetchPriority reflects as 'auto' IDL attribute on the script element");
+ }, "fetchpriority attribute on <script> elements should reflect valid IDL values");
+
+ test(() => {
+ const script = document.createElement("script");
+ assert_equals(script.fetchPriority, "auto");
+ }, "default fetchpriority attribute on <script> elements should be 'auto'");
+</script>
diff --git a/testing/web-platform/tests/html/scripting/the-script-element/resources/script.js b/testing/web-platform/tests/html/scripting/the-script-element/resources/script.js
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/testing/web-platform/tests/html/scripting/the-script-element/resources/script.js