test_bug691059.html 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. <!DOCTYPE HTML>
  2. <html>
  3. <!--
  4. https://bugzilla.mozilla.org/show_bug.cgi?id=691059
  5. -->
  6. <head>
  7. <title>Test for Bug 691059</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=691059">Mozilla Bug 691059</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 691059 **/
  19. function f() {}
  20. function testEventTarget(obj) {
  21. obj.onmouseenter = f;
  22. is(obj.onmouseenter, f,
  23. "onmouseenter should be settable");
  24. obj.onmouseleave = f;
  25. is(obj.onmouseleave, f,
  26. "onmouseenter should be settable");
  27. }
  28. function testInterface(obj) {
  29. try {
  30. obj.prototype.onmouseenter = f;
  31. is("onmouseenter" in obj, false,
  32. "setting <Interface>.prototype.onmouseenter has no effect on the " +
  33. "non-existent <Interface>.onmouseenter");
  34. obj.prototype.onmouseleave = f;
  35. is("onmouseleave" in obj, false,
  36. "setting <Interface>.prototype.onmouseleave has no effect on the " +
  37. "non-existent <Interface>.onmouseleave");
  38. } catch(ex) {
  39. ok(false, ex);
  40. }
  41. }
  42. testEventTarget(window);
  43. testEventTarget(document);
  44. testEventTarget(document.documentElement);
  45. testInterface(Document);
  46. testInterface(HTMLElement);
  47. </script>
  48. </pre>
  49. </body>
  50. </html>