test_bug585745.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=585745
  5. -->
  6. <head>
  7. <title>Test for Bug 585745</title>
  8. <script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
  9. <link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
  10. </head>
  11. <body>
  12. <a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=585745">Mozilla Bug 585745</a>
  13. <p id="display"></p>
  14. <div id="content" style="display: none">
  15. </div>
  16. <pre id="test">
  17. <script type="application/javascript">
  18. /** Test for Bug 585745 **/
  19. var a = document.createElementNS("http://www.w3.org/1998/Math/MathML", 'mrow');
  20. var b = document.createElementNS("http://www.w3.org/1999/xhtml", 'span');
  21. var htmlProto = Object.getPrototypeOf(b);
  22. var mathMLProto = Object.getPrototypeOf(a);
  23. // XXXbz once bug 560072 is fixed, we should be able to use
  24. // getOwnPropertyDescriptor here.
  25. Object.defineProperty(mathMLProto, "style", {
  26. get: htmlProto.__lookupGetter__("style"),
  27. });
  28. var threw = false;
  29. try {
  30. a.style;
  31. } catch(e) {
  32. threw = true;
  33. }
  34. is(threw, true,
  35. "Getting .style off a mathml element should throw in this case");
  36. </script>
  37. </pre>
  38. </body>
  39. </html>