HTMLLinkElement-disabled-005.html (1128B)
1 <!doctype html> 2 <title><link disabled>'s "explicitly enabled" persists across rel changes</title> 3 <link rel="author" title="Emilio Cobos Álvarez" href="mailto:emilio@crisal.io"> 4 <link rel="author" title="Mozilla" href="https://mozilla.org"> 5 <link rel="help" href="https://html.spec.whatwg.org/#attr-link-disabled"> 6 <script src="/resources/testharness.js"></script> 7 <script src="/resources/testharnessreport.js"></script> 8 <link title="alt" rel="yadayada" disabled href="data:text/css,html { background: green }"> 9 <script> 10 function assert_applies(applies) { 11 (applies ? assert_equals : assert_not_equals)(getComputedStyle(document.documentElement).backgroundColor, "rgb(0, 128, 0)"); 12 } 13 14 const link = document.querySelector("link[disabled]"); 15 16 async_test(function(t) { 17 link.onload = t.step_func_done(function() { 18 assert_applies(true); 19 link.setAttribute("rel", "alternate stylesheet"); 20 assert_applies(true); 21 assert_false(link.disabled); 22 }); 23 link.disabled = false; 24 link.setAttribute("rel", "stylesheet"); 25 }, "HTMLLinkElement.disabled's explicitly enabled state persists regardless of rel"); 26 </script>