no-help-cursor-on-links-wrapped-in-svg.historical.html (2025B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>link with rel="help" cursor tests</title> 4 <script src="/resources/testharness.js"></script> 5 <script src="/resources/testharnessreport.js"></script> 6 7 <link rel="help" href="https://html.spec.whatwg.org/#phrasing-content-3"> 8 <link rel="help" href="https://github.com/w3c/svgwg/issues/468"> 9 10 <div id="log"></div> 11 12 <svg> 13 <a href="/common/blank.html?unvisited" rel="help" id="unvisited">unvisited</a> 14 <a href="/common/blank.html?willbevisited" rel="help" id="willbevisited">will be visited</a> 15 </svg> 16 17 <script> 18 "use strict"; 19 20 21 test(() => { 22 const el = document.querySelector("#unvisited"); 23 const style = window.getComputedStyle(el); 24 25 assert_equals(style.cursor, "pointer"); 26 },"Unvisited help links must have pointer cursor, not help cursor"); 27 28 29 // This test is kind of dubious. Browsers don't allow you to distinguish visited and unvisited links 30 // from script, for privacy reasons. So we can't really be sure that loading the iframe would make 31 // the link count as visited. Manually running this test turns the link purple in some browsers, 32 // but leaves it blue in others. Even then it's not clear whether it turned purple before or after 33 // the onload; this test assumes that once the iframe onload fires, it counts as visited, which 34 // may not be justified even in the purple-turning browsers. 35 // 36 // Still, the test doesn't really hurt. At worst it's redundant with the above. 37 // 38 // If someone comes up with a better way of testing this (i.e. something that truly guarantees that 39 // the link will count as "visited" for UA stylesheet purposes), then please submit a PR. 40 async_test(t => { 41 const el = document.querySelector("#willbevisited"); 42 43 const iframe = document.createElement("iframe"); 44 iframe.src = el.href; 45 iframe.onload = t.step_func_done(() => { 46 const style = window.getComputedStyle(el); 47 assert_equals(style.cursor, "pointer"); 48 }); 49 50 document.body.appendChild(iframe); 51 }, "Visited help links must have pointer cursor, not help cursor"); 52 </script>