test_bug387615.html 1.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=387615
  5. -->
  6. <head>
  7. <title>Test for Bug 387615</title>
  8. <script type="text/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css" />
  10. <style type="text/css">
  11. @namespace html url(http://www.w3.org/1999/xhtml);
  12. a { color: red; }
  13. a[rel="next"] { color: green; }
  14. a[html|rel="next"] { color: green; }
  15. </style>
  16. </head>
  17. <body>
  18. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=387615">Mozilla Bug 387615</a>
  19. <p id="display"><a>link</a></p>
  20. <div id="content" style="display: none">
  21. </div>
  22. <pre id="test">
  23. <script class="testbody" type="text/javascript">
  24. /** Test for Bug 387615 **/
  25. var htmlns = "http://www.w3.org/1999/xhtml";
  26. var a = document.getElementById("display").firstChild;
  27. function col(elt) { return getComputedStyle(elt, "").color; }
  28. var red_cs = col(a);
  29. a.setAttribute("rel", "next");
  30. var green_cs = col(a);
  31. isnot(green_cs, red_cs, "computed values for red and green are different");
  32. a.setAttribute("rel", "NEXT");
  33. is(col(a), green_cs, "rel attribute should match case insensitively");
  34. a.removeAttribute("rel");
  35. a.setAttributeNS(htmlns, "html:rel", "next");
  36. is(col(a), green_cs, "html:rel attribute should match case-sensitively");
  37. a.setAttributeNS(htmlns, "html:rel", "NEXT");
  38. is(col(a), red_cs, "html:rel attribute should not match case-insensitively");
  39. </script>
  40. </pre>
  41. </body>
  42. </html>