Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<title>Fetch Priority - SVG Script element</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<svg>
<script id=script1 href="resources/script.js" fetchpriority="high"></script>
<script id=script2 href="resources/script.js" fetchpriority="low"></script>
<script id=script3 href="resources/script.js" fetchpriority="auto"></script>
<script id=script4 href="resources/script.js" fetchpriority="xyz"></script>
<script id=script5 href="resources/script.js"></script>
</svg>
<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 SVG <script> elements should reflect valid IDL values");
test(() => {
const script = document.createElementNS("http://www.w3.org/2000/svg", "script");
assert_equals(script.fetchPriority, "auto");
}, "default fetchpriority attribute on SVG <script> elements should be 'auto'");
</script>