Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /svg/embedded/attr-image-fetchpriority.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>Fetch Priority - SVG Image element</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<svg>
<image id=image1 fetchpriority="high"/>
<image id=image2 fetchpriority="low"/>
<image id=image3 fetchpriority="auto"/>
<image id=image4 fetchpriority="xyz"/>
<image id=image5 />
</svg>
<script>
test(() => {
assert_equals(image1.fetchPriority, "high", "high fetchPriority is a valid IDL value on the image element");
assert_equals(image2.fetchPriority, "low", "low fetchPriority is a valid IDL value on the image element");
assert_equals(image3.fetchPriority, "auto", "auto fetchPriority is a valid IDL value on the image element");
assert_equals(image4.fetchPriority, "auto", "invalid fetchPriority reflects as 'auto' IDL attribute on the image element");
assert_equals(image5.fetchPriority, "auto", "missing fetchPriority reflects as 'auto' IDL attribute on the image element");
}, "fetchpriority attribute on <image> elements should reflect valid IDL values");
test(() => {
assert_equals(image.fetchPriority, "auto");
}, "default fetchpriority attribute on <image> elements should be 'auto'");
</script>