tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

no-help-cursor-on-links.historical.html (2013B)


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