link-root-1.xhtml 533 B

123456789101112131415161718192021222324252627
  1. <?xml version="1.0"?>
  2. <!DOCTYPE html>
  3. <a xmlns="http://www.w3.org/1999/xhtml"
  4. href="http://www.example-notvisited.tld" class="reftest-wait">
  5. <style>
  6. <![CDATA[
  7. a { display: block; width: 100%; height: 100% }
  8. :link { background: red }
  9. :visited { background: green }
  10. ]]>
  11. </style>
  12. <script>
  13. <![CDATA[
  14. var a = document.documentElement;
  15. getComputedStyle(a, "").backgroundColor; // flush style
  16. a.href = "";
  17. getComputedStyle(a, "").backgroundColor; // flush style
  18. document.documentElement.removeAttribute("class");
  19. ]]>
  20. </script>
  21. </a>