attr-link-fetchpriority.html (1445B)
1 <!DOCTYPE html> 2 <title>Fetch Priority - Link element</title> 3 <meta name="author" title="Dominic Farolino" href="mailto:domfarolino@gmail.com"> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 7 <link id=link1 href=resources/stylesheet.css fetchpriority=high> 8 <link id=link2 href=resources/stylesheet.css fetchpriority=low> 9 <link id=link3 href=resources/stylesheet.css fetchpriority=auto> 10 <link id=link4 href=resources/stylesheet.css fetchpriority=xyz> 11 <link id=link5 href=resources/stylesheet.css> 12 13 <script> 14 test(() => { 15 assert_equals(link1.fetchPriority, "high", "high fetchPriority is a valid IDL value on the link element"); 16 assert_equals(link2.fetchPriority, "low", "low fetchPriority is a valid IDL value on the link element"); 17 assert_equals(link3.fetchPriority, "auto", "auto fetchPriority is a valid IDL value on the link element"); 18 assert_equals(link4.fetchPriority, "auto", "invalid fetchPriority reflects as 'auto' IDL attribute on the link element"); 19 assert_equals(link5.fetchPriority, "auto", "missing fetchPriority reflects as 'auto' IDL attribute on the link element"); 20 }, "fetchpriority attribute on <link> elements should reflect valid IDL values"); 21 22 test(() => { 23 const link = document.createElement("link"); 24 assert_equals(link.fetchPriority, "auto"); 25 }, "default fetchpriority attribute on <link> elements should be 'auto'"); 26 </script>