href-attr-change-restyles.svg 903 B

123456789101112131415161718192021222324252627282930313233
  1. <svg xmlns="http://www.w3.org/2000/svg" version="1.1"
  2. xmlns:xlink="http://www.w3.org/1999/xlink"
  3. onload="document.getElementById('link1').removeAttribute('xlink:href');
  4. document.getElementById('link2').setAttributeNS('http://www.w3.org/1999/xlink', 'href', 'http://example.com/1');
  5. document.getElementById('link3').setAttributeNS('http://www.w3.org/1999/xlink', 'href', '');">
  6. <title>Test for bug 549797 - Removing href attribute doesn't remove link styling</title>
  7. <style type="text/css">
  8. <![CDATA[
  9. a {
  10. fill: blue;
  11. }
  12. a:link, a:visited {
  13. fill: red;
  14. }
  15. ]]>
  16. </style>
  17. <a id="link1" xlink:href="http://example.com/1">
  18. <text x="10" y="100">Test anchor 1</text>
  19. </a>
  20. <a id="link2">
  21. <text x="10" y="200">Test anchor 2</text>
  22. </a>
  23. <a id="link3">
  24. <text x="10" y="300">Test anchor 3</text>
  25. </a>
  26. </svg>